You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
3.5 KiB
Dart
102 lines
3.5 KiB
Dart
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
|
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
|
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class SearchResults extends StatefulWidget {
|
|
List<DoctorList> doctorsList = [];
|
|
|
|
SearchResults({@required this.doctorsList});
|
|
|
|
@override
|
|
_SearchResultsState createState() => _SearchResultsState();
|
|
}
|
|
|
|
class _SearchResultsState extends State<SearchResults> {
|
|
var event = RobotProvider();
|
|
List<DoctorList> tempList = [];
|
|
|
|
@override
|
|
void initState() {
|
|
event.controller.stream.listen((p) {
|
|
// if (p['project_id'] != null) {
|
|
// tempList = [];
|
|
// widget.doctorsList.forEach((e) => {
|
|
// if (e.projectID == int.parse(p['project_id'])) {tempList.add(e)}
|
|
// });
|
|
// } else if (p['doctor_id'] != null) {
|
|
// tempList = [];
|
|
// widget.doctorsList.forEach((e) => {
|
|
// if (e.doctorID == int.parse(p['doctor_id'])) {tempList.add(e)}
|
|
// });
|
|
// DoctorView().getDoctorsProfile(context, tempList[0], isAppo: true);
|
|
// }
|
|
// setState(() {
|
|
// widget.doctorsList = tempList;
|
|
// });
|
|
});
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppScaffold(
|
|
appBarTitle: TranslationBase.of(context).bookAppo,
|
|
isShowAppBar: true,
|
|
body: Container(
|
|
margin: EdgeInsets.only(bottom: 10.0),
|
|
child: SingleChildScrollView(
|
|
physics: BouncingScrollPhysics(),
|
|
child: FractionallySizedBox(
|
|
widthFactor: 1.0,
|
|
child: Column(
|
|
children: <Widget>[
|
|
...List.generate(
|
|
widget.doctorsList.length,
|
|
(index) => AppExpandableNotifier(
|
|
title: widget.doctorsList[index].projectName,
|
|
bodyWidget: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: widget.doctorsList.map((doctorObj) {
|
|
return DoctorView(
|
|
doctor: doctorObj,
|
|
);
|
|
}).toList(),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
|
|
// ListView.builder(
|
|
// scrollDirection: Axis.vertical,
|
|
// shrinkWrap: true,
|
|
// physics: ScrollPhysics(),
|
|
// padding: EdgeInsets.all(0.0),
|
|
// itemCount: widget.doctorsList.length,
|
|
// itemBuilder: (context, index) {
|
|
// return AppExpandableNotifier(
|
|
// title: widget.doctorsList[index].projectName,
|
|
// bodyWidget: Column(
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
// children: widget.doctorsList.map((labOrder) {
|
|
// return DoctorView(
|
|
// doctor: widget.doctorsList[index],
|
|
// );
|
|
// }).toList(),
|
|
// ),
|
|
// );
|
|
// },
|
|
// ),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|