Merge branch 'inpatient_scroll' into 'development'

fix in patient issues

See merge request Cloud_Solution/doctor_app_flutter!831
merge-requests/832/merge
Mohammad Aljammal 5 years ago
commit b62d4d1dad

@ -708,5 +708,6 @@ const Map<String, Map<String, String>> localizedValues = {
"requestType":{ "requestType":{
"en":"Request Type", "en":"Request Type",
"ar":"نوع الطلب"}, "ar":"نوع الطلب"},
"special": {"en": "Special", "ar": "خاص"} "special": {"en": "Special", "ar": "خاص"},
"allClinic": {"en": "All Clinics", "ar": "جميع العيادات"}
}; };

@ -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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -37,7 +39,6 @@ class _InPatientListPageState extends State<InPatientListPage> {
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -63,6 +64,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
setState(() { setState(() {
isAllClinic = true; isAllClinic = true;
showBottomSheet = false; showBottomSheet = false;
selectedClinicName = null;
}); });
widget.patientSearchViewModel widget.patientSearchViewModel
.setDefaultInPatientList(); .setDefaultInPatientList();
@ -71,7 +73,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
activeColor: Colors.red, activeColor: Colors.red,
), ),
AppText( AppText(
"All Clinic", "${TranslationBase.of(context).allClinic}",
fontSize: 15, fontSize: 15,
), ),
], ],
@ -79,6 +81,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
onTap: () { onTap: () {
setState(() { setState(() {
isAllClinic = true; isAllClinic = true;
selectedClinicName = null;
showBottomSheet = false; showBottomSheet = false;
}); });
widget.patientSearchViewModel.setDefaultInPatientList(); widget.patientSearchViewModel.setDefaultInPatientList();
@ -87,7 +90,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isAllClinic = false;
if (widget.patientSearchViewModel.InpatientClinicList if (widget.patientSearchViewModel.InpatientClinicList
.length > .length >
0) showBottomSheet = true; 0) showBottomSheet = true;
@ -101,7 +104,6 @@ class _InPatientListPageState extends State<InPatientListPage> {
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
setState(() { setState(() {
isAllClinic = false;
if (widget.patientSearchViewModel if (widget.patientSearchViewModel
.InpatientClinicList.length > .InpatientClinicList.length >
0) showBottomSheet = true; 0) showBottomSheet = true;
@ -111,7 +113,7 @@ class _InPatientListPageState extends State<InPatientListPage> {
activeColor: Colors.red, activeColor: Colors.red,
), ),
AppText( AppText(
selectedClinicName ?? "Select Clinic", selectedClinicName ?? TranslationBase.of(context).clinicSelect,
fontSize: 15, fontSize: 15,
), ),
Container( Container(
@ -209,50 +211,100 @@ class _InPatientListPageState extends State<InPatientListPage> {
height: 0, height: 0,
) )
: Container( : Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
color: Colors.white, padding: EdgeInsets.only(top: 13, left: 10, right: 10),
child: ListView.builder( child: Column(
itemCount: children: [
widget.patientSearchViewModel.InpatientClinicList.length, Row(
scrollDirection: Axis.vertical, mainAxisAlignment: MainAxisAlignment.end,
physics: ScrollPhysics(), children: [
shrinkWrap: true, InkWell(
itemBuilder: (context, index) { onTap: () {
return InkWell( setState(() {
onTap: () { showBottomSheet = false;
setState(() { });
isAllClinic = false; },
showBottomSheet = false; child: Icon(DoctorApp.close_1,
selectedClinicName = widget.patientSearchViewModel size: SizeConfig.getTextMultiplierBasedOnWidth() *
.InpatientClinicList[index]; 4.5,
}); color: Color(0xFF2B353E)))
widget.patientSearchViewModel.filterByClinic( ],
clinicName: widget.patientSearchViewModel ),
.InpatientClinicList[index]); Row(
}, children: [
child: Row( AppText(
children: [ "${TranslationBase.of(context).clinicSelect} :",
Radio( fontFamily: 'Poppins',
value: widget.patientSearchViewModel fontWeight: FontWeight.w700,
.InpatientClinicList[index], fontSize: 18,
groupValue: selectedClinicName, ),
onChanged: (value) { ],
),
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(() {
setState(() { isAllClinic = false;
isAllClinic = false; showBottomSheet = false;
showBottomSheet = false; selectedClinicName = widget
}); .patientSearchViewModel
widget.patientSearchViewModel .InpatientClinicList[index];
.filterByClinic(clinicName: value);
}); });
widget.patientSearchViewModel.filterByClinic(
clinicName: widget.patientSearchViewModel
.InpatientClinicList[index]);
}, },
activeColor: Colors.red, child: Row(
), children: [
AppText(widget.patientSearchViewModel Radio(
.InpatientClinicList[index]), 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,
),
],
),
), ),
); );
} }

@ -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) { onNotification: (notification) {
if (isAllClinic && !hasQuery) if (notification if (isAllClinic && !hasQuery) if (notification

@ -44,7 +44,7 @@ class ListOfMyInpatient extends StatelessWidget {
Navigator.of(context) Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: { .pushNamed(PATIENTS_PROFILE, arguments: {
"patient": "patient":
patientSearchViewModel.filteredInPatientItems[index], patientSearchViewModel.filteredMyInPatientItems[index],
"patientType": "1", "patientType": "1",
"from": "0", "from": "0",
"to": "0", "to": "0",
@ -57,16 +57,6 @@ class ListOfMyInpatient extends StatelessWidget {
); );
}), }),
onNotification: (t) { 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; return;
}, },
), ),

@ -1102,6 +1102,7 @@ class TranslationBase {
String get textResponse => localizedValues['textResponse'][locale.languageCode]; String get textResponse => localizedValues['textResponse'][locale.languageCode];
String get special => localizedValues['special'][locale.languageCode]; String get special => localizedValues['special'][locale.languageCode];
String get requestType => localizedValues['requestType'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode];
String get allClinic => localizedValues['allClinic'][locale.languageCode];
} }

@ -692,7 +692,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1026,7 +1026,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1231,5 +1231,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: 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" flutter: ">=1.22.2 <2.0.0"

Loading…
Cancel
Save