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.
PatientApp-KKUMC/lib/pages/BookAppointment/SearchResults.dart

70 lines
2.1 KiB
Dart

import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'widgets/DoctorView.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(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.doctorsList.length,
itemBuilder: (context, index) {
return DoctorView(
//AJ note
doctor: widget.doctorsList[index],
);
},
),
),
),
);
}
}