From 99868a058c03bad7806ccc49ba11b57df390b814 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 12 Sep 2021 10:30:25 +0300 Subject: [PATCH 1/3] 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" From 5e90f14a89b426314a5cbd48c8fb5f158080eaba Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 12 Sep 2021 10:59:44 +0300 Subject: [PATCH 2/3] add translation --- lib/config/localized_values.dart | 3 ++- lib/screens/patients/In_patient/in_patient_list_page.dart | 6 +++--- lib/util/translations_delegate_base.dart | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9ef70508..9c5a0b8b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -708,5 +708,6 @@ const Map> localizedValues = { "requestType":{ "en":"Request Type", "ar":"نوع الطلب"}, - "special": {"en": "Special", "ar": "خاص"} + "special": {"en": "Special", "ar": "خاص"}, + "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} }; 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 b184234b..3b4681a0 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -72,7 +72,7 @@ class _InPatientListPageState extends State { activeColor: Colors.red, ), AppText( - "All Clinic", + "${TranslationBase.of(context).allClinic}", fontSize: 15, ), ], @@ -112,7 +112,7 @@ class _InPatientListPageState extends State { activeColor: Colors.red, ), AppText( - selectedClinicName ?? "Select Clinic", + selectedClinicName ?? TranslationBase.of(context).clinicSelect, fontSize: 15, ), Container( @@ -236,7 +236,7 @@ class _InPatientListPageState extends State { Row( children: [ AppText( - "Select Clinic :", + "${TranslationBase.of(context).clinicSelect} :", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 18, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 118efbfb..ebab8f65 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1102,6 +1102,7 @@ class TranslationBase { String get textResponse => localizedValues['textResponse'][locale.languageCode]; String get special => localizedValues['special'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; + String get allClinic => localizedValues['allClinic'][locale.languageCode]; } From c74dca14043ad7376f8df8cab191eb21c6034c10 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 12 Sep 2021 11:32:41 +0300 Subject: [PATCH 3/3] fix select clinic --- lib/screens/patients/In_patient/in_patient_list_page.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 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 3b4681a0..84c54a6e 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -64,6 +64,7 @@ class _InPatientListPageState extends State { setState(() { isAllClinic = true; showBottomSheet = false; + selectedClinicName = null; }); widget.patientSearchViewModel .setDefaultInPatientList(); @@ -80,6 +81,7 @@ class _InPatientListPageState extends State { onTap: () { setState(() { isAllClinic = true; + selectedClinicName = null; showBottomSheet = false; }); widget.patientSearchViewModel.setDefaultInPatientList(); @@ -88,7 +90,7 @@ class _InPatientListPageState extends State { InkWell( onTap: () { setState(() { - isAllClinic = false; + if (widget.patientSearchViewModel.InpatientClinicList .length > 0) showBottomSheet = true; @@ -102,7 +104,6 @@ class _InPatientListPageState extends State { onChanged: (value) { setState(() { setState(() { - isAllClinic = false; if (widget.patientSearchViewModel .InpatientClinicList.length > 0) showBottomSheet = true;