From 99868a058c03bad7806ccc49ba11b57df390b814 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 12 Sep 2021 10:30:25 +0300 Subject: [PATCH] fix in patient issues --- .../In_patient/in_patient_list_page.dart | 133 ++++++++++++------ .../In_patient/list_of_all_in_patient.dart | 38 ----- .../In_patient/list_of_my_inpatient.dart | 12 +- pubspec.lock | 6 +- 4 files changed, 96 insertions(+), 93 deletions(-) diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 61abf434..b184234b 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -1,5 +1,7 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -37,7 +39,6 @@ class _InPatientListPageState extends State { super.dispose(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -209,50 +210,100 @@ class _InPatientListPageState extends State { height: 0, ) : Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), height: MediaQuery.of(context).size.height * 0.5, - color: Colors.white, - child: ListView.builder( - itemCount: - widget.patientSearchViewModel.InpatientClinicList.length, - scrollDirection: Axis.vertical, - physics: ScrollPhysics(), - shrinkWrap: true, - itemBuilder: (context, index) { - return InkWell( - onTap: () { - setState(() { - isAllClinic = false; - showBottomSheet = false; - selectedClinicName = widget.patientSearchViewModel - .InpatientClinicList[index]; - }); - widget.patientSearchViewModel.filterByClinic( - clinicName: widget.patientSearchViewModel - .InpatientClinicList[index]); - }, - child: Row( - children: [ - Radio( - value: widget.patientSearchViewModel - .InpatientClinicList[index], - groupValue: selectedClinicName, - onChanged: (value) { + padding: EdgeInsets.only(top: 13, left: 10, right: 10), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + InkWell( + onTap: () { + setState(() { + showBottomSheet = false; + }); + }, + child: Icon(DoctorApp.close_1, + size: SizeConfig.getTextMultiplierBasedOnWidth() * + 4.5, + color: Color(0xFF2B353E))) + ], + ), + Row( + children: [ + AppText( + "Select Clinic :", + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 18, + ), + ], + ), + SizedBox( + height: 10, + ), + Expanded( + child: ListView.builder( + itemCount: widget + .patientSearchViewModel.InpatientClinicList.length, + scrollDirection: Axis.vertical, + physics: ScrollPhysics(), + shrinkWrap: true, + itemBuilder: (context, index) { + return InkWell( + onTap: () { setState(() { - setState(() { - isAllClinic = false; - showBottomSheet = false; - }); - widget.patientSearchViewModel - .filterByClinic(clinicName: value); + isAllClinic = false; + showBottomSheet = false; + selectedClinicName = widget + .patientSearchViewModel + .InpatientClinicList[index]; }); + widget.patientSearchViewModel.filterByClinic( + clinicName: widget.patientSearchViewModel + .InpatientClinicList[index]); }, - activeColor: Colors.red, - ), - AppText(widget.patientSearchViewModel - .InpatientClinicList[index]), - ], - )); - }), + child: Row( + children: [ + Radio( + value: widget.patientSearchViewModel + .InpatientClinicList[index], + groupValue: selectedClinicName, + onChanged: (value) { + setState(() { + setState(() { + isAllClinic = false; + showBottomSheet = false; + selectedClinicName = widget + .patientSearchViewModel + .InpatientClinicList[index]; + }); + widget.patientSearchViewModel + .filterByClinic(clinicName: value); + }); + }, + activeColor: Colors.red, + ), + AppText( + widget.patientSearchViewModel + .InpatientClinicList[index], + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: 15, + ), + ], + )); + }), + ), + SizedBox( + height: 20, + ), + ], + ), ), ); } diff --git a/lib/screens/patients/In_patient/list_of_all_in_patient.dart b/lib/screens/patients/In_patient/list_of_all_in_patient.dart index 6aa13094..169e9da6 100644 --- a/lib/screens/patients/In_patient/list_of_all_in_patient.dart +++ b/lib/screens/patients/In_patient/list_of_all_in_patient.dart @@ -64,44 +64,6 @@ class ListOfAllInPatient extends StatelessWidget { }); }, ); - // else if (widget.patientSearchViewModel - // .filteredInPatientItems[index].doctorId == - // widget.patientSearchViewModel.doctorProfile.doctorID && - // widget.isMyInPatient) - // return PatientCard( - // patientInfo: widget - // .patientSearchViewModel.filteredInPatientItems[index], - // patientType: "1", - // arrivalType: "1", - // isInpatient: true, - // isMyPatient: widget.patientSearchViewModel - // .filteredInPatientItems[index].doctorId == - // widget.patientSearchViewModel.doctorProfile.doctorID, - // onTap: () { - // FocusScopeNode currentFocus = FocusScope.of(context); - // if (!currentFocus.hasPrimaryFocus) { - // currentFocus.unfocus(); - // } - // - // Navigator.of(context) - // .pushNamed(PATIENTS_PROFILE, arguments: { - // "patient": widget.patientSearchViewModel - // .filteredInPatientItems[index], - // "patientType": "1", - // "from": "0", - // "to": "0", - // "isSearch": false, - // "isInpatient": true, - // "arrivalType": "1", - // "isMyPatient": widget.patientSearchViewModel - // .filteredInPatientItems[index].doctorId == - // widget - // .patientSearchViewModel.doctorProfile.doctorID, - // }); - // }, - // ); - // else - // return SizedBox(); }), onNotification: (notification) { if (isAllClinic && !hasQuery) if (notification diff --git a/lib/screens/patients/In_patient/list_of_my_inpatient.dart b/lib/screens/patients/In_patient/list_of_my_inpatient.dart index 306f99ac..f5f7c070 100644 --- a/lib/screens/patients/In_patient/list_of_my_inpatient.dart +++ b/lib/screens/patients/In_patient/list_of_my_inpatient.dart @@ -44,7 +44,7 @@ class ListOfMyInpatient extends StatelessWidget { Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": - patientSearchViewModel.filteredInPatientItems[index], + patientSearchViewModel.filteredMyInPatientItems[index], "patientType": "1", "from": "0", "to": "0", @@ -57,16 +57,6 @@ class ListOfMyInpatient extends StatelessWidget { ); }), onNotification: (t) { - if (isAllClinic && !hasQuery) if (t is ScrollUpdateNotification) { - //TODO Elham* - // if (t.metrics.pixels >= t.metrics.maxScrollExtent - 50) { - // patientSearchViewModel.addOnFilteredList(); - // } - // - // if (t.metrics.pixels <= t.metrics.minScrollExtent - 50) { - // patientSearchViewModel.removeOnFilteredList(); - // } - } return; }, ), diff --git a/pubspec.lock b/pubspec.lock index 53035a4a..43aefcb2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -692,7 +692,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -1026,7 +1026,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1231,5 +1231,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.2 <=2.11.0-213.1.beta" + dart: ">=2.10.2 <2.11.0" flutter: ">=1.22.2 <2.0.0"