From f1e0bcf86eea105ff5dcca857998be2e4661cb51 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 31 Aug 2020 17:54:03 +0300 Subject: [PATCH 01/65] speech to tex --- lib/widgets/others/bottom_bar.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 32df2dfc..ce480abb 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -206,12 +206,13 @@ class _SearchBot extends State { if (result['ProjectId'] != 0 && result['ClinicId'] != 0 && result['DoctorId'] != 0) { + var name = result['DoctorName'].replaceAll('دكتور', ''); getDoctorsList( result['ProjectId'], result['ClinicId'], context, doctorId: result['DoctorId'], - doctorName: result['DoctorName'], + doctorName: name.trim(), ); } else if (result['ProjectId'] != 0 && result['ClinicId'] != 0 && @@ -232,12 +233,13 @@ class _SearchBot extends State { } else if (result['ProjectId'] == 0 && result['ClinicId'] != 0 && result['DoctorId'] != 0) { + var name = result['DoctorName'].replaceAll('دكتور', ''); getDoctorsList( result['ProjectId'], result['ClinicId'], context, doctorId: result['DoctorId'], - doctorName: result['DoctorName'], + doctorName: name.trim(), ); } else { Navigator.push( @@ -304,8 +306,7 @@ class _SearchBot extends State { } }).catchError((err) { print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { From e7a3d1a4ab75fc97826e1a3158fe916b8c8731cf Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 1 Sep 2020 10:28:58 +0300 Subject: [PATCH 02/65] speech search --- lib/widgets/others/bottom_bar.dart | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index ce480abb..ed9be80f 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -1,3 +1,4 @@ +import 'dart:collection'; import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; @@ -311,6 +313,7 @@ class _SearchBot extends State { getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { List doctorsList = []; + List arr = []; DoctorsListService service = new DoctorsListService(); service .getDoctorsList(clinicId, projectId, context, doctorId: doctorName) @@ -319,8 +322,10 @@ class _SearchBot extends State { setState(() { if (res['DoctorList'].length != 0) { doctorsList.clear(); + res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); + arr.add(new DoctorList.fromJson(v).projectName); }); if (res['DoctorList'].length == 1 && doctorId != null) { getDoctorProfile( @@ -328,7 +333,7 @@ class _SearchBot extends State { //speak(); } else { - navigateToSearchResults(context, doctorsList); + navigateToSearchResults(context, doctorsList, arr); } } }); @@ -353,11 +358,20 @@ class _SearchBot extends State { ))); } - Future navigateToSearchResults(context, docList) async { + Future navigateToSearchResults(context, docList, arr) async { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => SearchResults(doctorsList: docList))); + var result = LinkedHashSet.from(arr).toList(); + var numAll = result.length; Navigator.push( - context, - MaterialPageRoute( - builder: (context) => SearchResults(doctorsList: docList))); + context, + MaterialPageRoute( + builder: (context) => + BranchView(doctorsList: docList, result: result, num: numAll), + ), + ); } speak() async { From 3a4c016f4ebdefc9b30cd213a8ca391bf04c11b7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 2 Sep 2020 18:05:34 +0300 Subject: [PATCH 03/65] search --- lib/pages/BookAppointment/Search.dart | 10 +- .../components/SearchByClinic.dart | 21 ++-- .../appointment_services/GetDoctorsList.dart | 4 +- lib/widgets/others/bottom_bar.dart | 111 +++++++++++------- 4 files changed, 91 insertions(+), 55 deletions(-) diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 9af6b449..d3ceaafd 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -7,7 +7,8 @@ import 'package:flutter/material.dart'; class Search extends StatefulWidget { final int type; - Search({this.type = 0}); + final List clnicIds; + Search({this.type = 0, this.clnicIds}); @override _SearchState createState() => _SearchState(); } @@ -41,7 +42,12 @@ class _SearchState extends State with TickerProviderStateMixin { ), body: TabBarView( physics: NeverScrollableScrollPhysics(), - children: [SearchByClinic(), SearchByDoctor()], + children: [ + SearchByClinic( + clnicIds: widget.clnicIds, + ), + SearchByDoctor() + ], controller: _tabController), bottomNavigationBar: BottomBarSearch()); } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index bfadd3b0..28e3bcb6 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -17,6 +17,8 @@ import '../SearchResults.dart'; import "dart:collection"; class SearchByClinic extends StatefulWidget { + final List clnicIds; + SearchByClinic({this.clnicIds}); @override _SearchByClinicState createState() => _SearchByClinicState(); } @@ -30,14 +32,7 @@ class _SearchByClinicState extends State { @override void initState() { WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); - // event.controller.stream.listen((p) { - // if (p['clinic_id'] != null) { - // // setState(() { - // dropdownValue = p['clinic_id'].toString(); - // //}); - // getDoctorsList(context); - // } - // }); + super.initState(); } @@ -109,6 +104,7 @@ class _SearchByClinicState extends State { clinicsList.add(new ListClinicCentralized.fromJson(v)); }); }); + filterClinic(); } else {} }).catchError((err) { print(err); @@ -167,4 +163,13 @@ class _SearchByClinicState extends State { ); //builder: (context) => SearchResults(doctorsList: docList))); } + + filterClinic() { + setState(() { + clinicsList = clinicsList + .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) + .toList(); + print(clinicsList); + }); + } } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index ba3ad56e..b183aa63 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -54,7 +54,9 @@ class DoctorsListService extends BaseService { "IsGetNearAppointment": false, "Latitude": 0, "Longitude": 0, - "License": true + "License": true, + // "IsVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, + // "DoctorIDsList": doctorId }; dynamic localRes; diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index ed9be80f..bce06dab 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -194,62 +194,70 @@ class _SearchBot extends State { searchProvider .getBotPages(request) .then((value) => {getCommands(value['Understand'])}); - //getDoctorsList(12, 17, 40036, context); } getCommands(result) async { - //RoboSearch.closeAlertDialog(context); print(result); results = result; - //getDoctorsList(12, 17, 40036, context); - + List clnicID = unique(result['ClinicId']); switch (result["CommandNumber"]) { case 100: if (result['ProjectId'] != 0 && - result['ClinicId'] != 0 && - result['DoctorId'] != 0) { + clnicID.length > 0 && + result['DoctorId'].length > 0) { var name = result['DoctorName'].replaceAll('دكتور', ''); - getDoctorsList( - result['ProjectId'], - result['ClinicId'], - context, - doctorId: result['DoctorId'], - doctorName: name.trim(), - ); + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + doctorId: result['DoctorId'], + doctorName: name.trim(), + ); + } else { + goToClinic(clnicID); + } } else if (result['ProjectId'] != 0 && - result['ClinicId'] != 0 && - result['DoctorId'] == 0) { - getDoctorsList( - result['ProjectId'], - result['ClinicId'], - context, - ); + clnicID.length > 0 && + result['DoctorId'].length == 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + ); + } else { + goToClinic(clnicID); + } } else if (result['ProjectId'] == 0 && - result['ClinicId'] != 0 && - result['DoctorId'] == 0) { - getDoctorsList( - result['ProjectId'], - result['ClinicId'], - context, - ); + clnicID.length > 0 && + result['DoctorId'].length == 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + ); + } else { + goToClinic(clnicID); + } } else if (result['ProjectId'] == 0 && - result['ClinicId'] != 0 && - result['DoctorId'] != 0) { + clnicID.length > 0 && + result['DoctorId'].length > 0) { var name = result['DoctorName'].replaceAll('دكتور', ''); - getDoctorsList( - result['ProjectId'], - result['ClinicId'], - context, - doctorId: result['DoctorId'], - doctorName: name.trim(), - ); + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + doctorId: result['DoctorId'], + doctorName: name.trim(), + ); + } else { + goToClinic(clnicID); + } } else { - Navigator.push( - AppGlobal.context, - MaterialPageRoute( - builder: (context) => Search( - type: 0, - ))); + goToClinic(clnicID); } speak(); break; @@ -327,9 +335,9 @@ class _SearchBot extends State { doctorsList.add(new DoctorList.fromJson(v)); arr.add(new DoctorList.fromJson(v).projectName); }); - if (res['DoctorList'].length == 1 && doctorId != null) { + if (res['DoctorList'].length == 1) { getDoctorProfile( - projectId, clinicId, doctorId, context, doctorsList); + projectId, clinicId, doctorId[0], context, doctorsList); //speak(); } else { @@ -384,4 +392,19 @@ class _SearchBot extends State { // initSpeechState().then((value) => startVoiceSearch()); // }); } + + goToClinic(List ids) { + Navigator.push( + AppGlobal.context, + MaterialPageRoute( + builder: (context) => Search( + type: 0, + clnicIds: ids, + ))); + // eventProvider.setValue({"clinic_id": ids}); + } + + List unique(List list) { + return list.toSet().toList(); + } } From 4a75215a19a90afef70af232d2622be3d12cf0b1 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 3 Sep 2020 10:11:22 +0300 Subject: [PATCH 04/65] search --- lib/config/localized_values.dart | 40 ++++++++++++------- .../appointment_services/GetDoctorsList.dart | 4 +- lib/widgets/others/bottom_bar.dart | 15 +++++-- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea14b71f..257a3995 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -343,7 +343,10 @@ const Map> localizedValues = { "en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني' }, - "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, + "OffersAndPackages": { + "en": "Online transfer request", + 'ar': 'طلب التحويل الالكتروني' + }, "ComprehensiveMedicalCheckup": { "en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل' @@ -363,17 +366,26 @@ const Map> localizedValues = { "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "ar": "السجلات"}, "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}, - "locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."} - "parking":{"en":"Parking","ar":"مواقف"}, - "alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"}, - "parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, - "readBarcode":{"en":"Read Barcode","ar":"قراءة الكود"}, - "showMyPark":{"en":"Show My Park","ar":"عرض بارك"}, - "clearMyData":{"en":"clear My Data","ar":"امسح البيانات"}, - "floor":{"en":"Floor:","ar":"الطابق"}, - "gate":{"en":"Gate:","ar":"بوابة"}, - "building":{"en":"Building:","ar":"المبنى"}, - "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"}, - "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"} + "locationDialogMessage": { + "en": + "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", + "ar": + "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." + }, + "parking": {"en": "Parking", "ar": "مواقف"}, + "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, + "parkingTitle": { + "en": + "Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.", + "ar": + " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " + }, + "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, + "showMyPark": {"en": "Show My Park", "ar": "عرض بارك"}, + "clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"}, + "floor": {"en": "Floor:", "ar": "الطابق"}, + "gate": {"en": "Gate:", "ar": "بوابة"}, + "building": {"en": "Building:", "ar": "المبنى"}, + "branch": {"en": "Branch:", "ar": "الفرع"}, + "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, }; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 4f16ab77..b8969a3a 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -66,8 +66,8 @@ class DoctorsListService extends BaseService { // "License": true, // "IsVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, // "DoctorIDsList": doctorId - "Latitude": lat.toString(), - "Longitude": long.toString(), + "Latitude": lat != null ? lat.toString() : 0, + "Longitude": long != null ? long.toString() : 0, "License": true }; diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index bce06dab..49651ca1 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -322,6 +322,7 @@ class _SearchBot extends State { getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { List doctorsList = []; List arr = []; + List arrDistance = []; DoctorsListService service = new DoctorsListService(); service .getDoctorsList(clinicId, projectId, context, doctorId: doctorName) @@ -334,6 +335,9 @@ class _SearchBot extends State { res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); }); if (res['DoctorList'].length == 1) { getDoctorProfile( @@ -341,7 +345,7 @@ class _SearchBot extends State { //speak(); } else { - navigateToSearchResults(context, doctorsList, arr); + navigateToSearchResults(context, doctorsList, arr, arrDistance); } } }); @@ -366,7 +370,7 @@ class _SearchBot extends State { ))); } - Future navigateToSearchResults(context, docList, arr) async { + Future navigateToSearchResults(context, docList, arr, arrDistance) async { // Navigator.push( // context, // MaterialPageRoute( @@ -376,8 +380,11 @@ class _SearchBot extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - BranchView(doctorsList: docList, result: result, num: numAll), + builder: (context) => BranchView( + doctorsList: docList, + result: result, + num: numAll, + resultDistance: arrDistance), ), ); } From 20a17c0070bd46817ed4f1495affa26a00901366 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 3 Sep 2020 10:55:38 +0300 Subject: [PATCH 05/65] clinic search --- .../appointment_services/GetDoctorsList.dart | 6 +++--- lib/widgets/others/bottom_bar.dart | 21 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index b8969a3a..653d6e43 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -54,7 +54,7 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "ClinicID": clinicID, "ProjectID": projectID, - "DoctorName": doctorId, //!= null ? doctorId : 0, + //"DoctorName": doctorId, //!= null ? doctorId : 0, "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": true, "PatientID": authUser.patientID != null ? authUser.patientID : 0, @@ -64,8 +64,8 @@ class DoctorsListService extends BaseService { // "Latitude": 0, // "Longitude": 0, // "License": true, - // "IsVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, - // "DoctorIDsList": doctorId + "IsVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, + "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, "License": true diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 49651ca1..1747ef19 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -325,21 +325,22 @@ class _SearchBot extends State { List arrDistance = []; DoctorsListService service = new DoctorsListService(); service - .getDoctorsList(clinicId, projectId, context, doctorId: doctorName) + .getDoctorsList(clinicId, projectId, context, doctorId: doctorId) .then((res) { if (res['MessageStatus'] == 1) { setState(() { - if (res['DoctorList'].length != 0) { + if (res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { doctorsList.clear(); - - res['DoctorList'].forEach((v) { - doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { + v1['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); }); - if (res['DoctorList'].length == 1) { + if (doctorsList.length == 1) { getDoctorProfile( projectId, clinicId, doctorId[0], context, doctorsList); From f6a3f0e61555e4123f15500b5ec885608d703ad0 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 6 Sep 2020 09:13:48 +0300 Subject: [PATCH 06/65] family file --- lib/config/localized_values.dart | 20 +- .../components/SearchByClinic.dart | 10 +- lib/pages/family/my-family.dart | 475 ++++++++++++------ .../appointment_services/GetDoctorsList.dart | 7 +- .../family_files/family_files_provider.dart | 46 ++ lib/uitl/translations_delegate_base.dart | 72 ++- lib/widgets/others/bottom_bar.dart | 185 +++---- 7 files changed, 538 insertions(+), 277 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfb13581..0ce36f70 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -388,16 +388,12 @@ const Map> localizedValues = { "building": {"en": "Building:", "ar": "المبنى"}, "branch": {"en": "Branch:", "ar": "الفرع"}, "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, - "locationDialogMessage": {"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.", "ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."}, - "parking":{"en":"Parking","ar":"مواقف"}, - "alhabiServices":{"en":"HMG Service","ar":"خدمات الحبيب"}, - "parkingTitle":{"en":"Car service, car service, service to save parking information, return to it later, 1- By clicking on (Read the code), save the parking data. 2- By clicking on the button (view my car park), it shows you the car’s location in Google Maps. 3- Read another position by pressing the Clear Position Data button.","ar":" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "}, - "readBarcode":{"en":"Read Barcode","ar":"قراءة الكود"}, - "showMyPark":{"en":"Show My Park","ar":"عرض بارك"}, - "clearMyData":{"en":"clear My Data","ar":"امسح البيانات"}, - "floor":{"en":"Floor:","ar":"الطابق"}, - "gate":{"en":"Gate:","ar":"بوابة"}, - "building":{"en":"Building:","ar":"المبنى"}, - "branch":{"en":"Branch:","ar":"الفرع"}, - "emergencyServices":{"en":"Emergency Services:","ar":"خدمات الطوارئ"} + "user-view-requester": { + "en": "User Wants To View Your Medical File", + "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي" + }, + "user-view": { + "en": "User Can View Your Medical File", + "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي" + }, }; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 8056de24..2ba7d571 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -256,10 +256,12 @@ class _SearchByClinicState extends State { filterClinic() { setState(() { - clinicsList = clinicsList - .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) - .toList(); - print(clinicsList); + if (widget.clnicIds.length > 0) { + clinicsList = clinicsList + .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) + .toList(); + print(clinicsList); + } }); } } diff --git a/lib/pages/family/my-family.dart b/lib/pages/family/my-family.dart index b2757514..bfce655d 100644 --- a/lib/pages/family/my-family.dart +++ b/lib/pages/family/my-family.dart @@ -1,178 +1,351 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/routes.dart'; -class MyFamily extends StatelessWidget { - //bool isLoading = true; +class MyFamily extends StatefulWidget { + @override + _MyFamily createState() => _MyFamily(); +} + +class _MyFamily extends State with TickerProviderStateMixin { final familyFileProvider = FamilyFilesProvider(); AppSharedPreferences sharedPref = new AppSharedPreferences(); var userID; + TabController _tabController; + + @override + void initState() { + _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); + super.initState(); + } + + bool expandFlag = false; Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: TranslationBase.of(context).myFamilyFiles, - isShowAppBar: true, - body: DefaultTabController( - length: 2, - child: SingleChildScrollView( - padding: EdgeInsets.all(20), - child: Container( - height: SizeConfig.realScreenHeight, - width: SizeConfig.realScreenWidth, - child: Stack( - children: [ - TabBar( - indicatorColor: Colors.red, - tabs: [ - Padding( - padding: EdgeInsets.all(6), - child: - Text(TranslationBase.of(context).family)), - Padding( - padding: EdgeInsets.all(6), - child: - Text(TranslationBase.of(context).request)), - ], - ), - TabBarView( - children: [ - myFamilyDetails(context), - myFamilyRequest(context) - ], - ) - ], - ))))); + return Scaffold( + appBar: AppBar( + bottom: TabBar( + indicatorColor: Colors.red, + tabs: [ + Padding( + padding: EdgeInsets.all(6), + child: AppText( + TranslationBase.of(context).family, + color: Colors.white, + )), + Padding( + padding: EdgeInsets.all(6), + child: AppText( + TranslationBase.of(context).request, + color: Colors.white, + )), + ], + controller: _tabController, + ), + title: AppText(TranslationBase.of(context).myFamilyFiles, + color: Colors.white)), + body: TabBarView( + // physics: NeverScrollableScrollPhysics(), + children: [myFamilyDetails(context), myFamilyRequest(context)], + controller: _tabController), + bottomNavigationBar: BottomBarSearch()); + + // AppScaffold( + // appBarTitle: TranslationBase.of(context).myFamilyFiles, + // isShowAppBar: true, + // body: SingleChildScrollView( + // child: Container( + // height: SizeConfig.screenHeight, + // width: SizeConfig.realScreenWidth, + // padding: EdgeInsets.all(20), + // child: Stack( + // children: [ + // TabBar( + // controller: _tabController, + // indicatorColor: Colors.red, + // tabs: [ + // Padding( + // padding: EdgeInsets.all(6), + // child: Text(TranslationBase.of(context).family)), + // Padding( + // padding: EdgeInsets.all(6), + // child: Text(TranslationBase.of(context).request)), + // ], + // ), + // TabBarView( + // controller: _tabController, + // children: [ + // myFamilyDetails(context), + // myFamilyRequest(context) + // ], + // ) + // ], + // )))); } Widget myFamilyDetails(context) { - return // Padding( - //padding: EdgeInsets.only(top: 50), - //child: - Column( - // mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 3, - child: FutureBuilder( - future: getFamilyFiles(), // async work - builder: (BuildContext context, - AsyncSnapshot snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return Padding( - padding: EdgeInsets.only(top: 50), - child: Text('Loading....')); - default: - if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(snapshot.error)); - else - return Padding( - padding: EdgeInsets.only(top: 50), - child: Column(children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 3, - child: Text( - TranslationBase.of(context).request)), - Expanded( - flex: 2, - child: Text( - TranslationBase.of(context).switchUser, - )), - Expanded( - flex: 1, - child: Text( - TranslationBase.of(context).deleteView, - )), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: snapshot - .data.getAllSharedRecordsByStatusList - .map((result) { - return result.status == 3 - ? Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: - Text(result.patientName)), - Expanded( - flex: 2, - child: IconButton( - icon: Icon(Icons.group), - color: Colors.black, - onPressed: () { - switchUser( - result, context); - }, - )), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.black, - ), - onPressed: () { - deleteFamily( - result, context); - }, - )), - ], - )) - : SizedBox(); - }).toList()) - ])); - } - }, - )), - Expanded( - flex: 1, - child: Column( - children: [ - Row( + return Container( + height: MediaQuery.of(context).size.height, + margin: EdgeInsets.fromLTRB(20.0, 0, 20.0, 0.0), + child: Column( + children: [ + Expanded( + flex: 1, + child: FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Padding( + padding: EdgeInsets.only(top: 50), + child: Column(children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text(TranslationBase.of(context) + .request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context) + .switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context) + .deleteView, + )), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return result.status == 3 + ? Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 2, + child: IconButton( + icon: Icon(Icons.group), + color: Colors.black, + onPressed: () { + switchUser( + result, context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deleteFamily( + result, context); + }, + )), + ], + )) + : SizedBox(); + }).toList()) + ])); + } + }, + )), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).addFamilyMember, - () => { - Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE) - }, - color: Colors.grey[900], - textColor: Colors.white, - )) + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).addFamilyMember, + () => { + Navigator.of(context) + .pushNamed(ADD_FAMILY_MEMBER_TYPE) + }, + color: Colors.grey[900], + textColor: Colors.white, + )) + ], + ), ], - ), - ], - )) - ], - ); + )) + ], + )); } - addMember() {} Widget myFamilyRequest(context) { - return Column( - children: [], + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 10.0), + child: Column( + children: [ + // SizedBox(height: 20.0), + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).userViewRequest, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + FutureBuilder( + future: getUserViewRequest(), // async work + builder: (BuildContext context, + AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text(TranslationBase.of(context) + .request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context) + .switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context) + .deleteView, + )), + ], + ), + Column( + children: [], + ) + ], + ); + } + }) + ], + ), + ), + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).sentRequest, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + FutureBuilder( + future: getSentRequest(), // async work + builder: + (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text( + TranslationBase.of(context).request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context).switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context).deleteView, + )), + ], + ), + Column( + children: [], + ) + ], + ); + } + }) + ], + )), + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).userView, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + ListTile( + title: Text('data'), + ) + ], + )) + ], + ), ); } @@ -186,6 +359,16 @@ class MyFamily extends StatelessWidget { } } + Future getUserViewRequest() async { + var user = await sharedPref.getObject(USER_PROFILE); + return familyFileProvider.getUserViewRequest(user['PatientID']); + } + + Future getSentRequest() async { + // var user = await sharedPref.getObject(USER_PROFILE); + return familyFileProvider.getUserSentRequest(); + } + deleteFamily(family, context) { ConfirmDialog dialog = new ConfirmDialog( context: context, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 5a9cf3f4..ad58175c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -24,7 +24,7 @@ class DoctorsListService extends BaseService { double long; Future getDoctorsList(int clinicID, int projectID, BuildContext context, - {doctorId}) async { + {doctorId, doctorName}) async { //Utils.showProgressDialog(context); Map request; @@ -54,7 +54,7 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "ClinicID": clinicID, "ProjectID": projectID, - //"DoctorName": doctorId, //!= null ? doctorId : 0, + "DoctorName": doctorName, //!= null ? doctorId : 0, "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": true, "PatientID": authUser.patientID != null ? authUser.patientID : 0, @@ -94,7 +94,8 @@ class DoctorsListService extends BaseService { authUser = data; } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { lat = await this.sharedPref.getDouble(USER_LAT); long = await this.sharedPref.getDouble(USER_LONG); } diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index ea2247d3..4a70c0b1 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -33,6 +33,10 @@ const String REMOVE_FILE_STATUS = const String ACTIVATION_CODE_URL = "Services/Authentication.svc/REST/CheckActivationCode"; +const String SENT_REQUEST_URL = + 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; +const String RECEVIED_REQUEST_URL = + 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; class FamilyFilesProvider with ChangeNotifier { bool isLogin = false; @@ -60,6 +64,48 @@ class FamilyFilesProvider with ChangeNotifier { } } + Future getUserViewRequest(responseID) async { + try { + dynamic localRes; + Map request = {}; + request['ResponseID'] = responseID; + await new BaseAppClient().post(RECEVIED_REQUEST_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + sharedPref.setObject(FAMILY_FILE, localRes); + return Future.value( + GetAllSharedRecordsByStatusResponse.fromJson(localRes)); + } catch (error) { + print(error); + throw error; + } + } + + Future getUserSentRequest() async { + try { + dynamic localRes; + Map request = {}; + request['Status'] = 0; + await new BaseAppClient().post(SENT_REQUEST_URL, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); + throw error; + }, body: request); + sharedPref.setObject(FAMILY_FILE, localRes); + return Future.value( + GetAllSharedRecordsByStatusResponse.fromJson(localRes)); + } catch (error) { + print(error); + throw error; + } + } + Future addFamilyFile(AddFamilyFileReq request) async { try { dynamic localRes; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d9fc04bc..023a1318 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -417,33 +417,46 @@ class TranslationBase { String get removeFamilyMember => localizedValues['remove-family-member'][locale.languageCode]; - String get myMedicalFile =>localizedValues['MyMedicalFile'][locale.languageCode]; - String get myMedicalFileSubTitle =>localizedValues['myMedicalFileSubTitle'][locale.languageCode]; - String get viewMore =>localizedValues['viewMore'][locale.languageCode]; - String get homeHealthCareService =>localizedValues['homeHealthCareService'][locale.languageCode]; - String get onlinePharmacy =>localizedValues['OnlinePharmacy'][locale.languageCode]; - String get emergencyService =>localizedValues['EmergencyService'][locale.languageCode]; - String get onlinePaymentService =>localizedValues['OnlinePaymentService'][locale.languageCode]; - String get offersAndPackages =>localizedValues['OffersAndPackages'][locale.languageCode]; - String get comprehensiveMedicalCheckup =>localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; - String get hMGService =>localizedValues['HMGService'][locale.languageCode]; - String get viewAllHabibMedicalService =>localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; - String get viewAll =>localizedValues['viewAll'][locale.languageCode]; - String get contactUs =>localizedValues['ContactUs'][locale.languageCode]; - String get viewAllWaysReachUs =>localizedValues['ViewAllWaysReachUs'][locale.languageCode]; - String get medicalProfile =>localizedValues['medicalProfile'][locale.languageCode]; - String get parking =>localizedValues['parking'][locale.languageCode]; - String get alhabiServices =>localizedValues['alhabiServices'][locale.languageCode]; - String get parkingTitle =>localizedValues['parkingTitle'][locale.languageCode]; - String get readBarcode =>localizedValues['readBarcode'][locale.languageCode]; - String get showMyPark =>localizedValues['showMyPark'][locale.languageCode]; - String get clearMyData =>localizedValues['clearMyData'][locale.languageCode]; - String get floor =>localizedValues['floor'][locale.languageCode]; - String get gate =>localizedValues['gate'][locale.languageCode]; - String get building =>localizedValues['building'][locale.languageCode]; - String get branch =>localizedValues['branch'][locale.languageCode]; - String get emergencyServices =>localizedValues['emergencyServices'][locale.languageCode]; - + String get myMedicalFile => + localizedValues['MyMedicalFile'][locale.languageCode]; + String get myMedicalFileSubTitle => + localizedValues['myMedicalFileSubTitle'][locale.languageCode]; + String get viewMore => localizedValues['viewMore'][locale.languageCode]; + String get homeHealthCareService => + localizedValues['homeHealthCareService'][locale.languageCode]; + String get onlinePharmacy => + localizedValues['OnlinePharmacy'][locale.languageCode]; + String get emergencyService => + localizedValues['EmergencyService'][locale.languageCode]; + String get onlinePaymentService => + localizedValues['OnlinePaymentService'][locale.languageCode]; + String get offersAndPackages => + localizedValues['OffersAndPackages'][locale.languageCode]; + String get comprehensiveMedicalCheckup => + localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; + String get hMGService => localizedValues['HMGService'][locale.languageCode]; + String get viewAllHabibMedicalService => + localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; + String get viewAll => localizedValues['viewAll'][locale.languageCode]; + String get contactUs => localizedValues['ContactUs'][locale.languageCode]; + String get viewAllWaysReachUs => + localizedValues['ViewAllWaysReachUs'][locale.languageCode]; + String get medicalProfile => + localizedValues['medicalProfile'][locale.languageCode]; + String get parking => localizedValues['parking'][locale.languageCode]; + String get alhabiServices => + localizedValues['alhabiServices'][locale.languageCode]; + String get parkingTitle => + localizedValues['parkingTitle'][locale.languageCode]; + String get readBarcode => localizedValues['readBarcode'][locale.languageCode]; + String get showMyPark => localizedValues['showMyPark'][locale.languageCode]; + String get clearMyData => localizedValues['clearMyData'][locale.languageCode]; + String get floor => localizedValues['floor'][locale.languageCode]; + String get gate => localizedValues['gate'][locale.languageCode]; + String get building => localizedValues['building'][locale.languageCode]; + String get branch => localizedValues['branch'][locale.languageCode]; + String get emergencyServices => + localizedValues['emergencyServices'][locale.languageCode]; String get consultation => localizedValues['consultation'][locale.languageCode]; @@ -452,6 +465,11 @@ class TranslationBase { localizedValues['textToSpeech'][locale.languageCode]; String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; + String get userViewRequest => + localizedValues['user-view-requester'][locale.languageCode]; + String get userView => localizedValues['user-view'][locale.languageCode]; + String get sentRequest => + localizedValues['sent-requests'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 1747ef19..b6108c36 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -138,7 +138,7 @@ class _SearchBot extends State { } Future _speak(reconizedWord) async { - await flutterTts.speak(reconizedWord); + //await flutterTts.speak(reconizedWord); getPages(reconizedWord); } @@ -199,94 +199,88 @@ class _SearchBot extends State { getCommands(result) async { print(result); results = result; - List clnicID = unique(result['ClinicId']); + switch (result["CommandNumber"]) { - case 100: - if (result['ProjectId'] != 0 && - clnicID.length > 0 && - result['DoctorId'].length > 0) { - var name = result['DoctorName'].replaceAll('دكتور', ''); - if (clnicID.length == 1) { - getDoctorsList( - result['ProjectId'], - clnicID[0], - context, - doctorId: result['DoctorId'], - doctorName: name.trim(), - ); - } else { - goToClinic(clnicID); - } - } else if (result['ProjectId'] != 0 && - clnicID.length > 0 && - result['DoctorId'].length == 0) { - if (clnicID.length == 1) { - getDoctorsList( - result['ProjectId'], - clnicID[0], - context, - ); - } else { - goToClinic(clnicID); - } - } else if (result['ProjectId'] == 0 && - clnicID.length > 0 && - result['DoctorId'].length == 0) { - if (clnicID.length == 1) { - getDoctorsList( - result['ProjectId'], - clnicID[0], - context, - ); - } else { - goToClinic(clnicID); - } - } else if (result['ProjectId'] == 0 && - clnicID.length > 0 && - result['DoctorId'].length > 0) { - var name = result['DoctorName'].replaceAll('دكتور', ''); - if (clnicID.length == 1) { - getDoctorsList( - result['ProjectId'], - clnicID[0], - context, - doctorId: result['DoctorId'], - doctorName: name.trim(), - ); + case '100': + { + List clnicID = unique(result['ClinicId']); + if (result['ProjectId'] != 0 && + clnicID.length > 0 && + result['DoctorId'].length > 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + doctorId: result['DoctorId'], + doctorName: null, + ); + } else { + goToClinic(clnicID); + } + } else if (result['ProjectId'] != 0 && + clnicID.length > 0 && + result['DoctorId'].length == 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + ); + } else { + goToClinic(clnicID); + } + } else if (result['ProjectId'] == 0 && + clnicID.length > 0 && + result['DoctorId'].length == 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + ); + } else { + goToClinic(clnicID); + } + } else if (result['ProjectId'] == 0 && + clnicID.length > 0 && + result['DoctorId'].length > 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + doctorId: result['DoctorId'], + doctorName: null, + ); + } else { + goToClinic(clnicID); + } } else { goToClinic(clnicID); } - } else { - goToClinic(clnicID); + speak(); + } + break; + case '102': + { + // getDoctorsList( + // 0, + // 0, + // context, + // doctorId: null, + // doctorName: result['DoctorName'], + // ); + getDoctorsList( + 0, + 0, + context, + doctorId: result['DoctorId'], + doctorName: null, + ); + speak(); } - speak(); break; - // case '101': - // Navigator.push( - // AppGlobal.context, - // MaterialPageRoute( - // builder: (context) => Search( - // type: 0, - // ))); - // break; - // case '102': - // Navigator.push( - // AppGlobal.context, - // MaterialPageRoute( - // builder: (context) => Search( - // type: 1, - // ))); - // break; - // case '103': - // eventProvider.setValue({"clinic_id": understand}); - // break; - - // case '104': - // eventProvider.setValue({"project_id": understand}); - // break; - // case '105': - // eventProvider.setValue({"doctor_id": understand}); - // break; default: Navigator.of(context).pushNamed(HOME); speak(); @@ -325,11 +319,13 @@ class _SearchBot extends State { List arrDistance = []; DoctorsListService service = new DoctorsListService(); service - .getDoctorsList(clinicId, projectId, context, doctorId: doctorId) + .getDoctorsList(clinicId, projectId, context, + doctorId: doctorId, doctorName: doctorName) .then((res) { if (res['MessageStatus'] == 1) { setState(() { - if (res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { + if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && + res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { doctorsList.clear(); res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { v1['DoctorList'].forEach((v) { @@ -340,6 +336,25 @@ class _SearchBot extends State { .toString()); }); }); + if (doctorsList.length == 1) { + getDoctorProfile( + projectId, clinicId, doctorId[0], context, doctorsList); + + //speak(); + } else { + navigateToSearchResults(context, doctorsList, arr, arrDistance); + } + } else if (res['DoctorList'].length != 0) { + doctorsList.clear(); + + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); + if (doctorsList.length == 1) { getDoctorProfile( projectId, clinicId, doctorId[0], context, doctorsList); From 0f63b922d128ec864b06cc15984510a7a83b5b74 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 7 Sep 2020 14:50:43 +0300 Subject: [PATCH 07/65] speech to text --- .../Appointments/DoctorListResponse.dart | 4 +- lib/pages/BookAppointment/Search.dart | 52 +-- .../components/SearchByClinic.dart | 122 ++++-- .../BookAppointment/widgets/BranchView.dart | 6 + lib/pages/family/my-family.dart | 374 ++++++++++++------ .../family_files/family_files_provider.dart | 2 +- lib/widgets/others/app_scaffold_widget.dart | 10 +- lib/widgets/others/bottom_bar.dart | 18 +- 8 files changed, 383 insertions(+), 205 deletions(-) diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 66c0c855..e0468c1f 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -173,7 +173,9 @@ class PatientDoctorAppointmentList { List patientDoctorAppointmentList = List(); PatientDoctorAppointmentList( - {this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) { + {this.filterName, + this.distanceInKMs, + DoctorList patientDoctorAppointment}) { patientDoctorAppointmentList.add(patientDoctorAppointment); } } diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index b5f83c4c..095d72a6 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,8 +1,10 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; @@ -28,29 +30,35 @@ class _SearchState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { + AppGlobal.context = context; return Scaffold( - appBar: AppBar( - bottom: TabBar( - tabs: [ - Tab(text: TranslationBase.of(context).clinicName), - Tab( - text: TranslationBase.of(context).doctorName, - ) - ], - controller: _tabController, - ), - title: Text(TranslationBase.of(context).bookAppo, - style: TextStyle(color: Colors.white)), + appBar: AppBar( + bottom: TabBar( + tabs: [ + Tab(text: TranslationBase.of(context).clinicName), + Tab( + text: TranslationBase.of(context).doctorName, + ) + ], + controller: _tabController, ), - body: TabBarView( - physics: NeverScrollableScrollPhysics(), - children: [ - SearchByClinic( - clnicIds: widget.clnicIds, - ), - SearchByDoctor() - ], - controller: _tabController), - bottomNavigationBar: BottomBarSearch()); + title: Text(TranslationBase.of(context).bookAppo, + style: TextStyle(color: Colors.white)), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + ), + body: TabBarView( + physics: NeverScrollableScrollPhysics(), + children: [ + SearchByClinic( + clnicIds: widget.clnicIds, + ), + SearchByDoctor() + ], + controller: _tabController), + ); } } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 2ba7d571..de3aaed0 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,5 +1,5 @@ import "dart:collection"; - +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -29,7 +30,7 @@ class _SearchByClinicState extends State { List clinicsList = []; List projectsList = []; bool isMobileAppDentalAllow = false; - + bool isLoaded = false; @override void initState() { WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); @@ -58,40 +59,70 @@ class _SearchByClinicState extends State { style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), ], ), - Container( - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - border: Border.all( - color: Colors.grey[400], - width: 1.0, - ), - borderRadius: BorderRadius.circular(10), - ), - // margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), - padding: EdgeInsets.all(8.0), - width: MediaQuery.of(context).size.width, - child: DropdownButtonHideUnderline( - child: DropdownButton( - hint: new Text("Select Clinic"), - value: dropdownValue, - items: clinicsList.map((item) { - return new DropdownMenuItem( - value: item.clinicID.toString(), - child: new Text(item.clinicDescription), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - dropdownValue = newValue; - if (!isDentalSelectedAndSupported()) { - projectDropdownValue = ""; - getDoctorsList(context); - } - }); - }, - ), - )), + widget.clnicIds != null && + widget.clnicIds.length > 1 && + isLoaded == true + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: clinicsList.map((result) { + return RoundedContainer( + child: ListTile( + onTap: () { + // setState(() { + dropdownValue = result.clinicID.toString(); + setState(() { + if (!isDentalSelectedAndSupported()) { + projectDropdownValue = ""; + getDoctorsList(context); + } + }); + }, + trailing: Icon(TranslationBase.of(AppGlobal.context) + .locale + .languageCode == + 'en' + ? Icons.keyboard_arrow_right + : Icons.keyboard_arrow_left), + title: Text(result.clinicDescription, + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700], + letterSpacing: 1.0)))); + }).toList()) + : Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + // margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text("Select Clinic"), + value: dropdownValue, + items: clinicsList.map((item) { + return new DropdownMenuItem( + value: item.clinicID.toString(), + child: new Text(item.clinicDescription), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + dropdownValue = newValue; + if (!isDentalSelectedAndSupported()) { + projectDropdownValue = ""; + getDoctorsList(context); + } + }); + }, + ), + )), isDentalSelectedAndSupported() == true || nearestAppo ? Container( height: 60.0, @@ -202,15 +233,18 @@ class _SearchByClinicState extends State { if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorList'].length != 0) { - print(res['DoctorList']); doctorsList.clear(); res['DoctorList'].forEach((v) { - doctorsList.add(new DoctorList.fromJson(v)); + try { + doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + } catch (issue) { + print(issue); + } }); } else {} }); @@ -260,7 +294,9 @@ class _SearchByClinicState extends State { clinicsList = clinicsList .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) .toList(); - print(clinicsList); + isLoaded = true; + + ///print(clinicsList); } }); } diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 6819c54b..63d47b5f 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -27,6 +27,7 @@ class _BranchViewState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, + isBottomBar: false, body: new ListView.builder( itemBuilder: (BuildContext context, int index) { return new ExpandableListView( @@ -58,6 +59,8 @@ class ExpandableListView extends StatefulWidget { class _ExpandableListViewState extends State { bool expandFlag = false; + var _radioValue1; + @override Widget build(BuildContext context) { return new Container( @@ -150,6 +153,9 @@ class _ExpandableListViewState extends State { return ""; } } + + sortByProject() {} + sortByClinic() {} } class ExpandableContainer extends StatelessWidget { diff --git a/lib/pages/family/my-family.dart b/lib/pages/family/my-family.dart index bfce655d..8a9ff531 100644 --- a/lib/pages/family/my-family.dart +++ b/lib/pages/family/my-family.dart @@ -106,113 +106,113 @@ class _MyFamily extends State with TickerProviderStateMixin { child: Column( children: [ Expanded( - flex: 1, - child: FutureBuilder( - future: getFamilyFiles(), // async work - builder: (BuildContext context, - AsyncSnapshot - snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: + flex:4, + child: FutureBuilder( + future: getFamilyFiles(), // async work + builder: (BuildContext context, + AsyncSnapshot + snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else return Padding( padding: EdgeInsets.only(top: 50), - child: Text('Loading....')); - default: - if (snapshot.hasError) - return Padding( - padding: EdgeInsets.all(10), - child: Text(snapshot.error)); - else - return Padding( - padding: EdgeInsets.only(top: 50), - child: Column(children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 3, - child: Text(TranslationBase.of(context) - .request)), - Expanded( - flex: 2, - child: Text( - TranslationBase.of(context) - .switchUser, - )), - Expanded( - flex: 1, - child: Text( - TranslationBase.of(context) - .deleteView, - )), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: snapshot - .data.getAllSharedRecordsByStatusList - .map((result) { - return result.status == 3 - ? Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Text( - result.patientName)), - Expanded( - flex: 2, - child: IconButton( - icon: Icon(Icons.group), + child: Column(children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text( + TranslationBase.of(context).request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context).switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context).deleteView, + )), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return result.status == 3 + ? Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 2, + child: IconButton( + icon: Icon(Icons.group), + color: Colors.black, + onPressed: () { + switchUser( + result, context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, color: Colors.black, - onPressed: () { - switchUser( - result, context); - }, - )), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.black, - ), - onPressed: () { - deleteFamily( - result, context); - }, - )), - ], - )) - : SizedBox(); - }).toList()) - ])); - } - }, - )), + ), + onPressed: () { + deleteFamily( + result, context); + }, + )), + ], + )) + : SizedBox(); + }).toList()) + ])); + } + }, + ), + ), Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).addFamilyMember, - () => { - Navigator.of(context) - .pushNamed(ADD_FAMILY_MEMBER_TYPE) - }, - color: Colors.grey[900], - textColor: Colors.white, - )) - ], - ), - ], - )) + flex:1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).addFamilyMember, + () => { + Navigator.of(context) + .pushNamed(ADD_FAMILY_MEMBER_TYPE) + }, + color: Colors.grey[900], + textColor: Colors.white, + )) + ], + ), + ], + ), + ) ], )); } @@ -270,7 +270,53 @@ class _MyFamily extends State with TickerProviderStateMixin { ], ), Column( - children: [], + + children: [ + Row(children: [ + Expanded(flex:3,child:AppText('Name')), + Expanded(flex:1,child:AppText('Allow')), + Expanded(flex:1,child:AppText('Reject')), + ]), + Column(children: snapshot + .data['GetAllPendingRecordsList'] + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.check_circle, + color: Colors.black, + ), + onPressed: () { + acceptRequest( + result, context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deleteRequest( + result, context); + }, + )) + ], + )); + + }).toList()) + ] ) ], ); @@ -289,7 +335,57 @@ class _MyFamily extends State with TickerProviderStateMixin { FutureBuilder( future: getSentRequest(), // async work builder: - (BuildContext context, AsyncSnapshot snapshot) { + (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.waiting: + return Padding( + padding: EdgeInsets.only(top: 50), + child: Text('Loading....')); + default: + if (snapshot.hasError) + return Padding( + padding: EdgeInsets.all(10), + child: Text(snapshot.error)); + else + return SingleChildScrollView( + child: Container( + height: SizeConfig.screenHeight *.3, + child: ListView( + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 2, + child: AppText(result.statusDescription, color: Colors.red,)), + + ], + )); + + }).toList(), + ))); + } + }) + ], + )), + RoundedContainer( + child: ExpansionTile( + title: Text( + TranslationBase.of(context).userView, + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + children: [ + FutureBuilder( + future: getUserViewRequest(), // async work + builder: (BuildContext context, + AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: return Padding( @@ -305,44 +401,68 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Expanded( flex: 3, - child: Text( - TranslationBase.of(context).request)), + child: Text(TranslationBase.of(context) + .request)), Expanded( flex: 2, child: Text( - TranslationBase.of(context).switchUser, + TranslationBase.of(context) + .switchUser, )), Expanded( flex: 1, child: Text( - TranslationBase.of(context).deleteView, + TranslationBase.of(context) + .deleteView, )), ], ), Column( - children: [], + + children: [ + Row(children: [ + Expanded(flex:3,child:AppText('Name')), + Expanded(flex:1,child:AppText('Delete')), + ]), + Column(children: snapshot + .data['GetAllPendingRecordsList'] + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text( + result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deleteRequest( + result, context); + }, + )), + + ], + )); + + }).toList()) + ] ) ], ); } }) ], - )), - RoundedContainer( - child: ExpansionTile( - title: Text( - TranslationBase.of(context).userView, - style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), - ), - children: [ - ListTile( - title: Text('data'), - ) - ], )) ], ), @@ -364,7 +484,7 @@ class _MyFamily extends State with TickerProviderStateMixin { return familyFileProvider.getUserViewRequest(user['PatientID']); } - Future getSentRequest() async { + Future getSentRequest() async { // var user = await sharedPref.getObject(USER_PROFILE); return familyFileProvider.getUserSentRequest(); } @@ -419,4 +539,10 @@ class _MyFamily extends State with TickerProviderStateMixin { HOME, ); } + deleteRequest(result, context){ + + } + acceptRequest(result, context){ + + } } diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 4a70c0b1..1fcaefd2 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -85,7 +85,7 @@ class FamilyFilesProvider with ChangeNotifier { } } - Future getUserSentRequest() async { + Future getUserSentRequest() async { try { dynamic localRes; Map request = {}; diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index b18a5fd9..eda27361 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -25,7 +25,7 @@ class AppScaffold extends StatelessWidget { final bool isShowAppBar; final bool hasAppBarParam; final BaseViewModel baseViewModel; - + final bool isBottomBar; AppScaffold( {@required this.body, this.appBarTitle = '', @@ -33,7 +33,8 @@ class AppScaffold extends StatelessWidget { this.isShowAppBar = false, this.hasAppBarParam, this.bottomSheet, - this.baseViewModel}); + this.baseViewModel, + this.isBottomBar = true}); @override Widget build(BuildContext context) { @@ -74,7 +75,8 @@ class AppScaffold extends StatelessWidget { ) : buildBodyWidget(), bottomSheet: bottomSheet, - bottomNavigationBar: BottomBarSearch() + bottomNavigationBar: + this.isBottomBar == true ? BottomBarSearch() : SizedBox() //floatingActionButton: FloatingSearchButton(), ); } @@ -84,6 +86,6 @@ class AppScaffold extends StatelessWidget { } buildBodyWidget() { - return body ;//Stack(children: [body, buildAppLoaderWidget(isLoading)]); + return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); } } diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index b6108c36..25649b06 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -259,18 +259,11 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - speak(); + // speak(); } break; case '102': { - // getDoctorsList( - // 0, - // 0, - // context, - // doctorId: null, - // doctorName: result['DoctorName'], - // ); getDoctorsList( 0, 0, @@ -278,7 +271,12 @@ class _SearchBot extends State { doctorId: result['DoctorId'], doctorName: null, ); - speak(); + } + break; + case '103': + { + List clnicID = unique(result['ClinicId']); + goToClinic(clnicID); } break; default: @@ -424,7 +422,7 @@ class _SearchBot extends State { type: 0, clnicIds: ids, ))); - // eventProvider.setValue({"clinic_id": ids}); + speak(); } List unique(List list) { From 77f6dd94ef06f72d261f686b5f16781b76cd3429 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 8 Sep 2020 10:54:16 +0300 Subject: [PATCH 08/65] search page change --- lib/services/robo_search/search_provider.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/services/robo_search/search_provider.dart b/lib/services/robo_search/search_provider.dart index bd129d1b..5a192d74 100644 --- a/lib/services/robo_search/search_provider.dart +++ b/lib/services/robo_search/search_provider.dart @@ -10,9 +10,11 @@ class SearchProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; dynamic pageData = {}; - + static bool isNewSession = false; + static var sessionID = new DateTime.now().millisecondsSinceEpoch; Future getBotPages(request) async { try { + request['SessionID'] = sessionID; await BaseAppClient().post(SEARCH_BOT, onSuccess: (dynamic response, int statusCode) { pageData = response; @@ -34,4 +36,12 @@ class SearchProvider with ChangeNotifier { //projectProvider.setSearchValue(pageData); notifyListeners(); } + + getSessionID() { + if (isNewSession == true) { + return new DateTime.now().millisecondsSinceEpoch; + } else { + return sessionID; + } + } } From a535543863c4c67eb0e3913222e7e64692f5a9e7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 8 Sep 2020 15:05:46 +0300 Subject: [PATCH 09/65] more pages added on the voice search --- .../BookAppointment/widgets/BranchView.dart | 18 +++-- lib/pages/login/login-type.dart | 4 +- lib/pages/login/login.dart | 2 + lib/widgets/others/bottom_bar.dart | 66 +++++++++++++++++++ 4 files changed, 84 insertions(+), 6 deletions(-) diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 48613ebf..455a579b 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -47,7 +47,7 @@ class ExpandableListView extends StatefulWidget { final List resultDistance; final List doctorsList2; final val; - + static int doctorListheight = 0; const ExpandableListView( {Key key, this.result2, this.resultDistance, this.val, this.doctorsList2}) : super(key: key); @@ -59,8 +59,6 @@ class ExpandableListView extends StatefulWidget { class _ExpandableListViewState extends State { bool expandFlag = false; - var _radioValue1; - @override Widget build(BuildContext context) { return new Container( @@ -112,6 +110,10 @@ class _ExpandableListViewState extends State { onPressed: () { setState(() { expandFlag = !expandFlag; + if (expandFlag == true) { + setDoctorViewHeight( + widget.result2[widget.val].toString()); + } }); }), ], @@ -146,6 +148,11 @@ class _ExpandableListViewState extends State { ); } + setDoctorViewHeight(name) { + ExpandableListView.doctorListheight = + widget.doctorsList2.where((e) => e.projectName == name).toList().length; + } + String getProjectDistance(String distance) { if (distance != "0") return " - " + distance + " " + TranslationBase.of(context).km; @@ -178,9 +185,12 @@ class ExpandableContainer extends StatelessWidget { duration: new Duration(milliseconds: 500), curve: Curves.easeInOut, width: screenWidth, - height: expanded ? MediaQuery.of(context).size.height : collapsedHeight, + height: expanded + ? (ExpandableListView.doctorListheight * 160).toDouble() + : collapsedHeight, child: new Container( child: child, + padding: EdgeInsets.only(bottom: 30), decoration: new BoxDecoration( border: new Border.all(width: 1.0, color: Colors.white)), ), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 7a8a940d..24d28ba1 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -23,7 +23,7 @@ class LoginType extends StatelessWidget { Expanded( flex: 4, child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ Image.asset( @@ -135,7 +135,7 @@ class LoginType extends StatelessWidget { ]), ), Expanded( - flex: 2, + flex: 1, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 7510987c..b0942a88 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -180,6 +180,7 @@ class _Login extends State { // request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); // request.activationCode = code ?? "0000"; // request.isSilentLogin = code != null ? false : true; + if (code == null) showLoader(true); request['PatientMobileNumber'] = int.parse(mobileNo); request['ZipCode'] = countryCode; request['SearchType'] = loginType; @@ -201,6 +202,7 @@ class _Login extends State { Navigator.of(context).pushNamed( HOME, ), + showLoader(false), appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index cd264111..2e936c1d 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -11,9 +11,15 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -289,6 +295,66 @@ class _SearchBot extends State { } } break; + case '4': + { + Navigator.push(context, FadePage(page: LabsHomePage())); + } + break; + case '6': + { + Navigator.push(context, FadePage(page: RadiologyHomePage())); + } + break; + case '7': + { + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); + } + break; + case '7': + { + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); + } + break; + case '8': + { + Navigator.push( + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); + } + break; + case '9': + { + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); + } + break; + case '10': + { + Navigator.push( + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ); + } + break; default: Navigator.of(context).pushNamed(HOME); speak(); From 5d3439899828452ce385eef26a3c8a973bee60c3 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 8 Sep 2020 15:10:11 +0300 Subject: [PATCH 10/65] insurance updated --- lib/widgets/others/bottom_bar.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 2e936c1d..209d6b98 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -40,6 +40,7 @@ import 'dart:math'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -355,6 +356,11 @@ class _SearchBot extends State { ); } break; + case '11': + { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + } + break; default: Navigator.of(context).pushNamed(HOME); speak(); From f5d68642916a20db864f25d2ec3e837b74c1ea2e Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 9 Sep 2020 10:11:04 +0300 Subject: [PATCH 11/65] voice search coc --- lib/widgets/others/bottom_bar.dart | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 209d6b98..87672c58 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -41,6 +41,7 @@ import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -316,16 +317,6 @@ class _SearchBot extends State { ); } break; - case '7': - { - Navigator.push( - context, - FadePage( - page: MyAppointments(), - ), - ); - } - break; case '8': { Navigator.push( @@ -361,6 +352,12 @@ class _SearchBot extends State { Navigator.push(context, FadePage(page: InsuranceUpdate())); } break; + case '12': + { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } + break; + default: Navigator.of(context).pushNamed(HOME); speak(); From 5e252d21d20d1e4c9adfe8c6d7054dcd3d80a125 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 9 Sep 2020 11:04:22 +0300 Subject: [PATCH 12/65] voice search added more medical option --- lib/pages/feedback/feedback_home_page.dart | 11 ++++------- lib/widgets/others/bottom_bar.dart | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 68f0bfab..d7c7361f 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -33,6 +33,7 @@ class _FeedbackHomePageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + isBottomBar: false, appBarTitle: 'Feedback', body: Scaffold( extendBodyBehindAppBar: true, @@ -62,8 +63,7 @@ class _FeedbackHomePageState extends State decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.7), + color: Theme.of(context).dividerColor, width: 0.7), ), color: Colors.white), child: Center( @@ -75,7 +75,7 @@ class _FeedbackHomePageState extends State indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( @@ -104,10 +104,7 @@ class _FeedbackHomePageState extends State child: TabBarView( physics: BouncingScrollPhysics(), controller: _tabController, - children: [ - SendFeedbackPage(), - StatusFeedbackPage() - ], + children: [SendFeedbackPage(), StatusFeedbackPage()], ), ) ], diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 87672c58..f5d4d8bf 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; @@ -19,7 +20,9 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; +import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -354,9 +357,25 @@ class _SearchBot extends State { break; case '12': { - Navigator.push(context, FadePage(page: FeedbackHomePage())); + Navigator.push(context, FadePage(page: InsuranceApproval())); } break; + case '13': + { + Navigator.push(context, FadePage(page: MyVaccines())); + } + break; + case '14': + { + Navigator.push(context, FadePage(page: HomeReportPage())); + } + break; + + // case '12': + // { + // Navigator.push(context, FadePage(page: FeedbackHomePage())); + // } + // break; default: Navigator.of(context).pushNamed(HOME); From 0a2cb22042dfe36225d4bcbd2e44a1928429e24c Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 9 Sep 2020 13:13:50 +0300 Subject: [PATCH 13/65] design issues fixed --- lib/pages/MyAppointments/MyAppointments.dart | 205 ++++++++------- .../widgets/AppointmentCardView.dart | 5 +- lib/pages/family/my-family.dart | 245 +++++++++--------- lib/pages/landing/home_page.dart | 23 +- .../family_files/family_files_provider.dart | 8 +- .../others/app_expandable_notifier.dart | 68 ++++- 6 files changed, 299 insertions(+), 255 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index dc6fc65c..aa0e7d98 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -216,87 +216,91 @@ class _MyAppointmentsState extends State Widget getBookedAppointments() { return Container( - child: widget.bookedAppoList.length != 0 - ? new ListView.builder( - itemCount: widget.bookedAppoList.length, - itemBuilder: (context, i) { - return AppointmentCard( - appo: widget.bookedAppoList[i], - onReloadAppointmentHistory: getPatientAppointmentHistory, - ); - }, - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/new-design/noAppointmentIcon.png"), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noBookedAppointments, - style: TextStyle( - fontSize: 16.0, - )), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Container( - child: widget.bookedAppoList.length != 0 - ? SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - children: [ - ...List.generate( - widget._patientBookedAppointmentListHospital.length, + child: widget.bookedAppoList.length != 0 + ? new ListView.builder( + itemCount: widget.bookedAppoList.length, + itemBuilder: (context, i) { + return AppointmentCard( + appo: widget.bookedAppoList[i], + onReloadAppointmentHistory: getPatientAppointmentHistory, + ); + }, + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Image.asset( + // "assets/images/new-design/noAppointmentIcon.png"), + // Container( + // margin: EdgeInsets.only(top: 10.0), + // child: Text(TranslationBase.of(context).noBookedAppointments, + // style: TextStyle( + // fontSize: 16.0, + // )), + // ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Container( + child: widget.bookedAppoList.length != 0 + ? SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + children: [ + ...List.generate( + widget._patientBookedAppointmentListHospital + .length, (index) => AppExpandableNotifier( - title: widget - ._patientBookedAppointmentListHospital[index] - .filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientBookedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), - )), - ) - ], - ), - ) - : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/new-design/noAppointmentIcon.png"), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", - style: TextStyle( - fontSize: 16.0, - )), + title: widget + ._patientBookedAppointmentListHospital[ + index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: widget + ._patientBookedAppointmentListHospital[ + index] + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + )), + ) + ], + ), + ) + : Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/new-design/noAppointmentIcon.png"), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text("No Booked Appointments", + style: TextStyle( + fontSize: 16.0, + )), + ), + ], ), - ], + ), ), - ), - ), - ), - ) - ], - - )))); + ), + ) + ], + )))); } Widget getConfirmedAppointments() { @@ -341,7 +345,8 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noConfirmedAppointments , + child: Text( + TranslationBase.of(context).noConfirmedAppointments, style: TextStyle( fontSize: 16.0, )), @@ -363,23 +368,24 @@ class _MyAppointmentsState extends State ...List.generate( widget._patientArrivedAppointmentListHospital.length, (index) => AppExpandableNotifier( - title: widget + title: widget + ._patientArrivedAppointmentListHospital[index] + .filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: widget ._patientArrivedAppointmentListHospital[index] - .filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: widget - ._patientArrivedAppointmentListHospital[index] - .patientDoctorAppointmentList - .map((doctor) { - return AppointmentCard( - appo: doctor, - onReloadAppointmentHistory: - getPatientAppointmentHistory, - ); - }).toList(), - )), + .patientDoctorAppointmentList + .map((doctor) { + return AppointmentCard( + appo: doctor, + onReloadAppointmentHistory: + getPatientAppointmentHistory, + ); + }).toList(), + ), + ), ) ], ), @@ -394,10 +400,11 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noArrivedAppointments, - style: TextStyle( - fontSize: 16.0, - )), + child: + Text(TranslationBase.of(context).noArrivedAppointments, + style: TextStyle( + fontSize: 16.0, + )), ), ], ), diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index b64bd232..a0bb7f40 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -24,7 +24,7 @@ class _ApointmentCardState extends State { navigateToAppointmentDetails(context, widget.appo); }, child: Card( - margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), + // margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -95,7 +95,8 @@ class _ApointmentCardState extends State { emptyIcon: Icons.star, ), Container( - transform: Matrix4.translationValues(15.0, -40.0, 0.0), + transform: + Matrix4.translationValues(15.0, -40.0, 0.0), child: Image.asset( "assets/images/new-design/arrow.png", width: 25.0, diff --git a/lib/pages/family/my-family.dart b/lib/pages/family/my-family.dart index 8a9ff531..698a6c75 100644 --- a/lib/pages/family/my-family.dart +++ b/lib/pages/family/my-family.dart @@ -106,7 +106,7 @@ class _MyFamily extends State with TickerProviderStateMixin { child: Column( children: [ Expanded( - flex:4, + flex: 4, child: FutureBuilder( future: getFamilyFiles(), // async work builder: (BuildContext context, @@ -192,7 +192,7 @@ class _MyFamily extends State with TickerProviderStateMixin { ), ), Expanded( - flex:1, + flex: 1, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -269,55 +269,52 @@ class _MyFamily extends State with TickerProviderStateMixin { )), ], ), - Column( - - children: [ - Row(children: [ - Expanded(flex:3,child:AppText('Name')), - Expanded(flex:1,child:AppText('Allow')), - Expanded(flex:1,child:AppText('Reject')), - ]), - Column(children: snapshot + Column(children: [ + Row(children: [ + Expanded(flex: 3, child: AppText('Name')), + Expanded(flex: 1, child: AppText('Allow')), + Expanded(flex: 1, child: AppText('Reject')), + ]), + Column( + children: snapshot .data['GetAllPendingRecordsList'] .map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Text( - result.patientName)), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.check_circle, - color: Colors.black, - ), - onPressed: () { - acceptRequest( - result, context); - }, - )), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.black, - ), - onPressed: () { - deleteRequest( - result, context); - }, - )) - ], - )); - - }).toList()) - ] - ) + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: + Text(result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.check_circle, + color: Colors.black, + ), + onPressed: () { + acceptRequest( + result, context); + }, + )), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deleteRequest( + result, context); + }, + )) + ], + )); + }).toList()) + ]) ], ); } @@ -334,8 +331,9 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getSentRequest(), // async work - builder: - (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, + AsyncSnapshot + snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: return Padding( @@ -345,32 +343,33 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text(snapshot.error)); + child: Text('No data found..')); else - return SingleChildScrollView( - child: Container( - height: SizeConfig.screenHeight *.3, - child: ListView( - children: snapshot - .data.getAllSharedRecordsByStatusList - .map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Text( - result.patientName)), - Expanded( - flex: 2, - child: AppText(result.statusDescription, color: Colors.red,)), - - ], - )); - - }).toList(), - ))); + return SingleChildScrollView( + child: Container( + height: SizeConfig.screenHeight * .3, + child: ListView( + children: snapshot + .data.getAllSharedRecordsByStatusList + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: + Text(result.patientName)), + Expanded( + flex: 2, + child: AppText( + result.statusDescription, + color: Colors.red, + )), + ], + )); + }).toList(), + ))); } }) ], @@ -384,8 +383,8 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ FutureBuilder( future: getUserViewRequest(), // async work - builder: (BuildContext context, - AsyncSnapshot snapshot) { + builder: + (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: return Padding( @@ -395,69 +394,62 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text(snapshot.error)); + child: Text('No data found..')); else return Column( children: [ Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Expanded( flex: 3, - child: Text(TranslationBase.of(context) - .request)), + child: Text( + TranslationBase.of(context).request)), Expanded( flex: 2, child: Text( - TranslationBase.of(context) - .switchUser, + TranslationBase.of(context).switchUser, )), Expanded( flex: 1, child: Text( - TranslationBase.of(context) - .deleteView, + TranslationBase.of(context).deleteView, )), ], ), - Column( - - children: [ - Row(children: [ - Expanded(flex:3,child:AppText('Name')), - Expanded(flex:1,child:AppText('Delete')), - ]), - Column(children: snapshot - .data['GetAllPendingRecordsList'] - .map((result) { - return Padding( - padding: EdgeInsets.all(10), - child: Row( - children: [ - Expanded( - flex: 3, - child: Text( - result.patientName)), - Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.delete, - color: Colors.black, - ), - onPressed: () { - deleteRequest( - result, context); - }, - )), - - ], - )); - - }).toList()) - ] - ) + Column(children: [ + Row(children: [ + Expanded(flex: 3, child: AppText('Name')), + Expanded(flex: 1, child: AppText('Delete')), + ]), + Column( + children: snapshot + .data['GetAllPendingRecordsList'] + .map((result) { + return Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Expanded( + flex: 3, + child: Text(result.patientName)), + Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.delete, + color: Colors.black, + ), + onPressed: () { + deleteRequest( + result, context); + }, + )), + ], + )); + }).toList()) + ]) ], ); } @@ -539,10 +531,7 @@ class _MyFamily extends State with TickerProviderStateMixin { HOME, ); } - deleteRequest(result, context){ - } - acceptRequest(result, context){ - - } + deleteRequest(result, context) {} + acceptRequest(result, context) {} } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index da9d9348..7d7138d0 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -468,7 +468,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.9, ) ], ), @@ -500,7 +500,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.9, ) ], ), @@ -515,8 +515,12 @@ class _HomePageState extends State { Container( width: MediaQuery.of(context).size.width * 0.29, child: InkWell( - onTap: ()=>Navigator.push(context, - FadePage(page: ErOptions(isAppbar: true,))), + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -531,11 +535,12 @@ class _HomePageState extends State { height: 15, ), Texts( - TranslationBase.of(context).emergencyServices, + TranslationBase.of(context) + .emergencyServices, textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 1.9, ) ], ), @@ -598,9 +603,9 @@ class _HomePageState extends State { context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( - onTap: (){ - Navigator.push(context, FadePage(page: FeedbackHomePage())); - + onTap: () { + Navigator.push( + context, FadePage(page: FeedbackHomePage())); }, child: Container( width: double.infinity, diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 1fcaefd2..f5a06df9 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -73,8 +73,7 @@ class FamilyFilesProvider with ChangeNotifier { onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { - AppToast.showErrorToast(message: error); - throw error; + return Future.value(error); }, body: request); sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( @@ -94,8 +93,9 @@ class FamilyFilesProvider with ChangeNotifier { onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { - AppToast.showErrorToast(message: error); - throw error; + return Future.value(error); + //AppToast.showErrorToast(message: error); + //throw error; }, body: request); sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 353846e1..55cc7bee 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -6,48 +7,89 @@ import 'package:flutter/material.dart'; /// [bodyWidget] widget want to show in the body /// [title] the widget title /// [collapsed] The widget shown in the collapsed state -class AppExpandableNotifier extends StatelessWidget { +class AppExpandableNotifier extends StatefulWidget { final Widget headerWidget; final Widget bodyWidget; final String title; final Widget collapsed; - + bool expandFlag = false; + var controller = new ExpandableController(); AppExpandableNotifier( {this.headerWidget, this.bodyWidget, this.title, this.collapsed}); + _AppExpandableNotifier createState() => _AppExpandableNotifier(); +} +class _AppExpandableNotifier extends State { @override Widget build(BuildContext context) { return ExpandableNotifier( child: Padding( - padding: const EdgeInsets.only(left: 10,right: 10,top: 4), + padding: const EdgeInsets.only(left: 10, right: 10, top: 4), child: Card( clipBehavior: Clip.antiAlias, child: Column( children: [ SizedBox( - child: headerWidget, + child: widget.headerWidget, ), ScrollOnExpand( scrollOnExpand: true, scrollOnCollapse: false, child: ExpandablePanel( + hasIcon: false, theme: const ExpandableThemeData( headerAlignment: ExpandablePanelHeaderAlignment.center, tapBodyToCollapse: true, ), - header: Padding( - padding: EdgeInsets.all(10), - child: Text( - title?? 'Details', - style: TextStyle(fontWeight: FontWeight.bold,fontSize: 22,), - ), - ), - collapsed: collapsed ?? Container(), - expanded: bodyWidget, + header: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Text( + widget.title ?? 'Details', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + ), + ), + ), + new IconButton( + icon: new Container( + height: 28.0, + width: 30.0, + decoration: new BoxDecoration( + color: Colors.red, + shape: BoxShape.circle, + ), + child: new Center( + child: new Icon( + widget.expandFlag + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 30.0, + ), + ), + ), + onPressed: () { + setState(() { + widget.expandFlag = !widget.expandFlag; + if (widget.expandFlag == true) { + widget.controller.expanded = true; + } else { + widget.controller.expanded = false; + } + }); + }), + ]), + collapsed: widget.collapsed ?? Container(), + expanded: widget.bodyWidget, builder: (_, collapsed, expanded) { return Padding( padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), child: Expandable( + controller: widget.controller, collapsed: collapsed, expanded: expanded, theme: const ExpandableThemeData(crossFadePoint: 0), From 92efbcbd2f92a6dce97a6fc8d7d74ad31d7f5392 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 9 Sep 2020 14:11:46 +0300 Subject: [PATCH 14/65] my family --- lib/pages/family/my-family.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/family/my-family.dart b/lib/pages/family/my-family.dart index 698a6c75..b4024b0a 100644 --- a/lib/pages/family/my-family.dart +++ b/lib/pages/family/my-family.dart @@ -121,7 +121,7 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text(snapshot.error)); + child: Text("No data found")); else return Padding( padding: EdgeInsets.only(top: 50), @@ -243,7 +243,7 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text(snapshot.error)); + child: Text('No data found')); else return Column( children: [ @@ -343,7 +343,7 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found..')); + child: Text('No data found')); else return SingleChildScrollView( child: Container( @@ -394,7 +394,7 @@ class _MyFamily extends State with TickerProviderStateMixin { if (snapshot.hasError) return Padding( padding: EdgeInsets.all(10), - child: Text('No data found..')); + child: Text('No data found')); else return Column( children: [ From 591e9e9a4cfc99f80b8b0a172078bb6ac9460345 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 27 Sep 2020 09:35:46 +0300 Subject: [PATCH 15/65] updated --- lib/pages/landing/home_page.dart | 12 ++++++------ lib/widgets/data_display/text.dart | 2 +- lib/widgets/others/bottom_bar.dart | 28 +++++++++++++++++++++++----- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 7d7138d0..24a6f714 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -362,7 +362,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 15, + height: 5, ), Texts( TranslationBase.of(context) @@ -420,7 +420,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 15, + height: 5, ), Texts( TranslationBase.of(context).emergencyService, @@ -460,7 +460,7 @@ class _HomePageState extends State { height: 55, ), SizedBox( - height: 15, + height: 5, ), Texts( TranslationBase.of(context) @@ -492,7 +492,7 @@ class _HomePageState extends State { height: 55, ), SizedBox( - height: 15, + height: 5, ), Texts( TranslationBase.of(context) @@ -532,7 +532,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 15, + height: 5, ), Texts( TranslationBase.of(context) @@ -595,7 +595,7 @@ class _HomePageState extends State { ), ), height: 100, - imageName: 'hmg_services_bg .png', + imageName: 'hmg_services_bg.png', opacity: 0.5, color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 17ddf05b..4b9fc551 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -225,7 +225,7 @@ class _TextsState extends State { fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color ?? Colors.black, fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.variant == "overline" ? 1.5 : null, + letterSpacing: widget.variant == "overline" ? 1 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), ), ), diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index f5d4d8bf..4de9efdf 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -11,13 +11,16 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/ErService/NearestEr.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; @@ -370,12 +373,27 @@ class _SearchBot extends State { Navigator.push(context, FadePage(page: HomeReportPage())); } break; + case '5': + { + Navigator.push(context, FadePage(page: NearestEr())); + } + break; + case '15': + { + Navigator.push(context, FadePage(page: PatientSickLeavePage())); + } + break; + case '16': + { + Navigator.push(context, FadePage(page: LiveCareHome())); + } + break; - // case '12': - // { - // Navigator.push(context, FadePage(page: FeedbackHomePage())); - // } - // break; + case '200': + { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } + break; default: Navigator.of(context).pushNamed(HOME); From f25d18353f4c08c98d11b04ee91602412126ad1f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 27 Sep 2020 10:22:32 +0300 Subject: [PATCH 16/65] icons updated --- lib/pages/ContactUs/findus/hospitrals_page.dart | 2 +- lib/pages/ContactUs/findus/pharmacies_page.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 9b1e2f5f..12e7baac 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -57,7 +57,7 @@ class _HospitalsPageState extends State { child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())), Container(child: Texts('${model.FindusHospitalModelList[index].locationName}')),//model.cOCItemList[index].cOCTitl IconButton( - icon: Icon(Icons.person_pin_circle_outlined), + icon: Icon(Icons.location_on, color: Colors.red[900]), tooltip: 'Increase volume by 10', onPressed: () { setState(() { diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index 68e3c8bc..cf3f5972 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -80,7 +80,7 @@ class _PharmaciesPageState extends State { ), Container(child: Texts('${model.FindusPharmaciesModelList[index].locationName}')),//model.cOCItemList[index].cOCTitl IconButton( - icon: Icon(Icons.person_pin_circle_outlined), + icon: Icon(Icons.location_on, color: Colors.red[900]), tooltip: 'Increase volume by 10', onPressed: () { setState(() { From 79502de6823fc195558212c2bb839e9f7871597b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 28 Sep 2020 09:50:06 +0300 Subject: [PATCH 17/65] update --- .../LiveChat/hospitalsLivechat_page.dart | 3 +- .../ContactUs/findus/hospitrals_page.dart | 347 ++++++++++-------- .../ContactUs/findus/pharmacies_page.dart | 53 ++- 3 files changed, 237 insertions(+), 166 deletions(-) diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 66ad31ee..5936328a 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -112,8 +112,7 @@ class _HospitalsLiveChatPageState extends State { children: [ IconButton( icon: Icon( - Icons - .arrow_forward_rounded, + Icons.arrow_forward, color: tappedIndex == index ? Colors.white diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 315fe553..aafc3472 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -1,4 +1,3 @@ - import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; @@ -9,6 +8,7 @@ import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart'; + class HospitalsPage extends StatefulWidget { @override _HospitalsPageState createState() => _HospitalsPageState(); @@ -18,167 +18,220 @@ class _HospitalsPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getFindUsRequestOrders(),//model.getCOC(), + onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only(left: 15,right: 15,top: 70), + margin: EdgeInsets.only(left: 15, right: 15, top: 70), child: Column( children: [ - ...List.generate(model.FindusHospitalModelList.length, (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - InkWell( - onTap:(){ - showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(model.FindusHospitalModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ),image:Image.network(model.FindusHospitalModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), - buttonCancelText:Text('cancel') , - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - - ) ); - }, - child: Container( - width: 70, - height: 70, - child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only(left: 5,right: 5), - child: Texts('${model.FindusHospitalModelList[index].locationName}',textAlign: TextAlign.center,))),//model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - children: [ - IconButton( - icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates(double.parse(model.FindusHospitalModelList[index].latitude),double.parse(model.FindusHospitalModelList[index].longitude),model.FindusHospitalModelList[index].locationName); - // _volume += 10; - }); - }, - ), - IconButton( - icon: Icon(Icons.phone,color: Colors.red,), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - ], + ...List.generate( + model.FindusHospitalModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap: () { + showDialog( + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + model + .FindusHospitalModelList[ + index] + .locationName, + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: Image.network( + model + .FindusHospitalModelList[ + index] + .projectImageURL + .toString(), + fit: BoxFit.cover, + ), + buttonCancelText: + Text('cancel'), + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(model + .FindusHospitalModelList[ + index] + .projectImageURL + .toString())), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Texts( + '${model.FindusHospitalModelList[index].locationName}', + textAlign: TextAlign.center, + ))), //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + icon: Icon( + Icons.person_pin_circle, + color: Colors.red, + ), + tooltip: + 'Increase volume by 10', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(model + .FindusHospitalModelList[ + index] + .latitude), + double.parse(model + .FindusHospitalModelList[ + index] + .longitude), + model + .FindusHospitalModelList[ + index] + .locationName); + // _volume += 10; + }); + }, + ), + IconButton( + icon: Icon( + Icons.phone, + color: Colors.red, + ), + tooltip: + 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + model + .FindusHospitalModelList[ + index] + .phoneNumber); + }); + }, + ), + ], + ), + ), + ], + ), ), - ), - - - - ], - ), + ], + ), + // Texts('${model.FindusHospitalModelList[index].locationName}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], ), - - ], - ), - // Texts('${model.FindusHospitalModelList[index].locationName}'), - Divider(height: 4.5,color: Colors.grey[500],) - ], - ), - ), - )), - SizedBox(height: 8,), - Container(width: double.infinity, - height: 100,color: Colors.white, - child: Row( - mainAxisSize:MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - - children: [ - - IconButton( - icon: new Image.asset('assets/images/new-design/youtube.png'), - iconSize: 70, - tooltip: 'Youtube', - onPressed: () { - setState(() { - - launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/linkedin.png'), - tooltip: 'LinkedIn', - iconSize: 70, - onPressed: () { - setState(() { - - launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/twitter.png'), - tooltip: 'Twitter', - iconSize: 70, - onPressed: () { - setState(() { - - launch("https://twitter.com/HMG"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/facebook.png'), - tooltip: 'facebook', - iconSize: 70, - onPressed: () { - setState(() { - - launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); - }); - }, - ), - ], + ), + )), + SizedBox( + height: 8, ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], + ), ), ], ), ), ), - ), ); - } } diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index f127f842..9ade351d 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -53,19 +53,37 @@ class _PharmaciesPageState extends State { CrossAxisAlignment.center, children: [ InkWell( - onTap:(){ + onTap: () { showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(model.FindusPharmaciesModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ),image:Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), - buttonCancelText:Text('cancel') , - // buttonCancelText:Text(model.user.projectID) , - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - - ) ); + context: context, + builder: (_) => + AssetGiffyDialog( + title: Text( + model + .FindusPharmaciesModelList[ + index] + .locationName, + style: TextStyle( + fontSize: 22.0, + fontWeight: + FontWeight + .w600), + ), + image: Image.network( + model + .FindusPharmaciesModelList[ + index] + .projectImageURL + .toString(), + fit: BoxFit.cover, + ), + buttonCancelText: + Text('cancel'), + // buttonCancelText:Text(model.user.projectID) , + buttonCancelColor: + Colors.grey, + onlyCancelButton: true, + )); }, child: Container( width: 70, @@ -82,13 +100,16 @@ class _PharmaciesPageState extends State { margin: EdgeInsets.only( left: 5, right: 5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( '${model.FindusPharmaciesModelList[index].locationName}', textAlign: TextAlign.start, ), - SizedBox(height: 4,), + SizedBox( + height: 4, + ), Texts( '${model.FindusPharmaciesModelList[index].cityName}', textAlign: TextAlign.center, @@ -104,8 +125,7 @@ class _PharmaciesPageState extends State { children: [ IconButton( icon: Icon( - Icons - .person_pin_circle_outlined, + Icons.person_pin_circle, color: Colors.red, ), tooltip: @@ -155,7 +175,6 @@ class _PharmaciesPageState extends State { ), ], ), - Divider( height: 4.5, color: Colors.grey[500], From c9256a654ade4cffc63dac3c8079eb4c2e70cbe9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Sep 2020 18:01:42 +0300 Subject: [PATCH 18/65] LiveCare Scheduling updates --- lib/config/localized_values.dart | 1 + lib/config/shared_pref_kay.dart | 1 + .../Appointments/PatientShareResposne.dart | 16 +- .../LiveCareScheduleClinicsListResponse.dart | 64 +++ lib/pages/BookAppointment/BookConfirm.dart | 79 +++- lib/pages/BookAppointment/BookSuccess.dart | 73 ++-- lib/pages/BookAppointment/DoctorProfile.dart | 13 +- lib/pages/BookAppointment/SearchResults.dart | 4 +- .../components/DocAvailableAppointments.dart | 49 ++- .../components/SearchByDoctor.dart | 1 + .../BookAppointment/widgets/BranchView.dart | 4 +- .../BookAppointment/widgets/DoctorView.dart | 4 +- .../LiveChat/hospitalsLivechat_page.dart | 2 +- .../widgets/AppointmentActions.dart | 5 +- lib/pages/ToDoList/ToDo.dart | 30 +- lib/pages/livecare/livecare_home.dart | 2 + .../livecare_scheduling_clinic_list.dart | 0 .../schedule_clinic_card.dart | 51 +++ lib/pages/livecare/livecare_type_select.dart | 224 +++++++++++ lib/pages/livecare/widgets/clinic_list.dart | 378 ++++++++++++++---- .../appointment_services/GetDoctorsList.dart | 135 +++++++ .../livecare_services/livecare_provider.dart | 75 ++++ lib/uitl/translations_delegate_base.dart | 2 + 23 files changed, 1075 insertions(+), 138 deletions(-) create mode 100644 lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart create mode 100644 lib/pages/livecare/livecare_scheduling/livecare_scheduling_clinic_list.dart create mode 100644 lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart create mode 100644 lib/pages/livecare/livecare_type_select.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ac7ee547..6053dd4a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,6 +47,7 @@ const Map> localizedValues = { }, 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, + 'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'}, 'appointment': {'en': 'Appointment', 'ar': 'الموعد'}, 'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'}, 'todoList': {'en': 'Todo List', 'ar': 'مهامي'}, diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 61e36022..8087a7f1 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -14,3 +14,4 @@ const FAMILY_FILE = 'family-file'; const USER_LAT = 'user-lat'; const USER_LONG = 'user-long'; const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING'; +const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; diff --git a/lib/models/Appointments/PatientShareResposne.dart b/lib/models/Appointments/PatientShareResposne.dart index e4a05e04..e3a596d6 100644 --- a/lib/models/Appointments/PatientShareResposne.dart +++ b/lib/models/Appointments/PatientShareResposne.dart @@ -13,17 +13,17 @@ class PatientShareResponse { String doctorImageURL; String doctorNameObj; List doctorSpeciality; - Null errCode; + dynamic errCode; int groupID; bool iSAllowOnlineCheckedIN; - Null insurancePolicyNo; + dynamic insurancePolicyNo; bool isExcludedForOnlineCheckin; int isFollowup; bool isLiveCareAppointment; bool isOnlineCheckedIN; String message; int nextAction; - Null patientCardID; + dynamic patientCardID; int patientID; dynamic patientShare; dynamic patientShareWithTax; @@ -32,20 +32,20 @@ class PatientShareResponse { String patientType; int paymentAmount; String paymentDate; - Null paymentMethodName; - Null paymentReferenceNumber; + dynamic paymentMethodName; + dynamic paymentReferenceNumber; int policyId; String policyName; String procedureName; int projectID; String projectName; - Null setupID; + dynamic setupID; int sourceType; String startTime; int status; int statusCode; - Null statusDesc; - Null subPolicyNo; + dynamic statusDesc; + dynamic subPolicyNo; int userID; PatientShareResponse( diff --git a/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart b/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart new file mode 100644 index 00000000..8951370c --- /dev/null +++ b/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart @@ -0,0 +1,64 @@ +class LiveCareScheduleClinicsListResponse { + List clinicsHaveScheduleList; + + LiveCareScheduleClinicsListResponse({this.clinicsHaveScheduleList}); + + LiveCareScheduleClinicsListResponse.fromJson(Map json) { + if (json['ClinicsHaveScheduleList'] != null) { + clinicsHaveScheduleList = new List(); + json['ClinicsHaveScheduleList'].forEach((v) { + clinicsHaveScheduleList.add(new ClinicsHaveScheduleList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.clinicsHaveScheduleList != null) { + data['ClinicsHaveScheduleList'] = + this.clinicsHaveScheduleList.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ClinicsHaveScheduleList { + int clinicID; + int serviceID; + int projectID; + String clinicDesc; + String clinicDescN; + String projectDesc; + String projectDescN; + + ClinicsHaveScheduleList( + {this.clinicID, + this.serviceID, + this.projectID, + this.clinicDesc, + this.clinicDescN, + this.projectDesc, + this.projectDescN}); + + ClinicsHaveScheduleList.fromJson(Map json) { + clinicID = json['ClinicID']; + serviceID = json['ServiceID']; + projectID = json['ProjectID']; + clinicDesc = json['ClinicDesc']; + clinicDescN = json['ClinicDescN']; + projectDesc = json['ProjectDesc']; + projectDescN = json['ProjectDescN']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicID'] = this.clinicID; + data['ServiceID'] = this.serviceID; + data['ProjectID'] = this.projectID; + data['ClinicDesc'] = this.clinicDesc; + data['ClinicDescN'] = this.clinicDescN; + data['ProjectDesc'] = this.projectDesc; + data['ProjectDescN'] = this.projectDescN; + return data; + } +} diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 88ecdb6b..8647b2f0 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -24,10 +24,12 @@ class BookConfirm extends StatefulWidget { String appoDateFormatted = ""; String appoTimeFormatted = ""; + bool isLiveCareAppointment; BookConfirm( {@required this.doctor, @required this.selectedDate, + @required this.isLiveCareAppointment, @required this.selectedTime}); DoctorsListService service; @@ -358,7 +360,11 @@ class _BookConfirmState extends State { disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), onPressed: () { - insertAppointment(context, widget.doctor); + if (!widget.isLiveCareAppointment) { + insertAppointment(context, widget.doctor); + } else { + insertLiveCareScheduledAppointment(context, widget.doctor); + } }, child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)), @@ -375,7 +381,11 @@ class _BookConfirmState extends State { service.cancelAppointment(appo, context).then((res) { if (res['MessageStatus'] == 1) { Future.delayed(new Duration(milliseconds: 1500), () { - insertAppointment(context, docObject); + if (!widget.isLiveCareAppointment) { + insertAppointment(context, widget.doctor); + } else { + insertLiveCareScheduledAppointment(context, widget.doctor); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); @@ -434,6 +444,55 @@ class _BookConfirmState extends State { text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } + insertLiveCareScheduledAppointment(context, DoctorList docObject) { + AppoitmentAllHistoryResultList appo; + widget.service + .insertLiveCareScheduleAppointment( + docObject.doctorID, + docObject.clinicID, + docObject.projectID, + docObject.serviceID, + widget.selectedTime, + widget.selectedDate, + context) + .then((res) { + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + print(res['AppointmentNo']); + + Future.delayed(new Duration(milliseconds: 1800), () { + getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], + docObject.clinicID, docObject.projectID, docObject); + }); + } else { + appo = new AppoitmentAllHistoryResultList(); + appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; + appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; + appo.projectID = res['SameClinicApptList'][0]['ProjectID']; + appo.endTime = res['SameClinicApptList'][0]['EndTime']; + appo.startTime = res['SameClinicApptList'][0]['StartTime']; + appo.doctorID = res['SameClinicApptList'][0]['DoctorID']; + appo.isLiveCareAppointment = true; + appo.originalClinicID = 0; + appo.originalProjectID = 0; + appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(docObject, appo, context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + AppToast.showErrorToast(message: err); + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { widget.service @@ -448,6 +507,21 @@ class _BookConfirmState extends State { text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } + getLiveCareAppointmentPatientShare(context, String appointmentNo, + int clinicID, int projectID, DoctorList docObject) { + widget.service + .getLiveCareAppointmentPatientShare( + appointmentNo, clinicID, projectID, context) + .then((res) { + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToBookSuccess(context, docObject, widget.patientShareResponse); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + String getTime(DateTime dateTime) { final DateFormat formatter = DateFormat('HH:mm'); setState(() { @@ -502,7 +576,6 @@ class _BookConfirmState extends State { Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { - Navigator.push( context, MaterialPageRoute( diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 7a19ea28..2f7bde88 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -39,12 +39,6 @@ class _BookSuccessState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; - @override - void initState() { - // TODO: implement initState - super.initState(); - } - @override Widget build(BuildContext context) { return Scaffold( @@ -184,6 +178,9 @@ class _BookSuccessState extends State { case 30: return _getQRAppo(); break; + case 50: + return _getConfirmAppo(); + break; } } @@ -204,6 +201,9 @@ class _BookSuccessState extends State { case 30: return 'QR Code'; break; + case 50: + return 'Confirm LiveCare'; + break; } } @@ -286,8 +286,19 @@ class _BookSuccessState extends State { textColor: Colors.white, disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), - onPressed: () {}, - child: Text(TranslationBase.of(context).confirm.toUpperCase(), + onPressed: () { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + confirmAppointment(appo); + }, + child: Text( + widget.patientShareResponse.isLiveCareAppointment + ? TranslationBase.of(context) + .confirmLiveCare + .toUpperCase() + : TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), ), @@ -321,6 +332,23 @@ class _BookSuccessState extends State { return Container(); } + confirmAppointment(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .confirmAppointment( + appo.appointmentNo, appo.clinicID, appo.projectID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + navigateToHome(context); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + Widget _getPayNowAppo() { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -543,7 +571,8 @@ class _BookSuccessState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { @@ -560,22 +589,12 @@ class _BookSuccessState extends State { appo.appointmentNo.toString()); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } -// -// Future navigateToQR( -// context, String appoQR, PatientShareResponse patientShareResponse) async { -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => QRCode( -// patientShareResponse: patientShareResponse, -// appoQR: appoQR, -// ))).then((value) {}); -// } - - addAdvancedNumberRequest(String advanceNumber, String paymentReference, - String appointmentID) { + + addAdvancedNumberRequest( + String advanceNumber, String paymentReference, String appointmentID) { DoctorsListService service = new DoctorsListService(); service .addAdvancedNumberRequest( @@ -585,7 +604,8 @@ class _BookSuccessState extends State { getAppoQR(context); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Widget _getQRAppo() { @@ -742,7 +762,8 @@ class _BookSuccessState extends State { navigateToQR(context, res['AppointmentQR']); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToQR(context, String appoQR) async { diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index d3b6fc7c..2c7e723a 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,7 +11,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; + import 'BookConfirm.dart'; import 'components/DocAvailableAppointments.dart'; import 'components/DocInfo.dart'; @@ -19,9 +20,12 @@ class DoctorProfile extends StatefulWidget { DoctorList doctor; DoctorProfileList docProfileList; final bool isOpenAppt; + bool isLiveCareAppointment; + DoctorProfile( {@required this.doctor, @required this.docProfileList, + @required this.isLiveCareAppointment, this.isOpenAppt = false}); AuthenticatedUser authUser; @@ -35,6 +39,7 @@ class _DoctorProfileState extends State TabController _tabController; bool showFooterButton = false; var event = RobotProvider(); + @override void initState() { _tabController = new TabController( @@ -54,6 +59,7 @@ class _DoctorProfileState extends State }); _tabController = new TabController(length: 2, vsync: this); widget.authUser = new AuthenticatedUser(); + widget.doctor.speciality = widget.docProfileList.specialty; getPatientData(); super.initState(); } @@ -190,7 +196,9 @@ class _DoctorProfileState extends State physics: NeverScrollableScrollPhysics(), children: [ DoctorInformation(docProfileList: widget.docProfileList), - DocAvailableAppointments(doctor: widget.doctor) + DocAvailableAppointments( + doctor: widget.doctor, + isLiveCareAppointment: widget.isLiveCareAppointment) ], controller: _tabController, ), @@ -245,6 +253,7 @@ class _DoctorProfileState extends State MaterialPageRoute( builder: (context) => BookConfirm( doctor: widget.doctor, + isLiveCareAppointment: widget.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime))); } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 2b5fac17..1ed1b6a0 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -9,9 +9,10 @@ import 'package:flutter/material.dart'; class SearchResults extends StatefulWidget { List doctorsList = []; List patientDoctorAppointmentListHospital; + bool isLiveCareAppointment; SearchResults( - {@required this.doctorsList, this.patientDoctorAppointmentListHospital}); + {@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment}); @override _SearchResultsState createState() => _SearchResultsState(); @@ -53,6 +54,7 @@ class _SearchResultsState extends State { .map((doctor) { return DoctorView( doctor: doctor, + isLiveCareAppointment: widget.isLiveCareAppointment, ); }).toList(), )), diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 3c5e49ff..aca0884f 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -2,12 +2,13 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:table_calendar/table_calendar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:table_calendar/table_calendar.dart'; import '../../../uitl/date_uitl.dart'; @@ -17,8 +18,10 @@ class DocAvailableAppointments extends StatefulWidget { static DateTime selectedAppoDateTime; static String selectedDate; static String selectedTime; + bool isLiveCareAppointment; - DocAvailableAppointments({@required this.doctor}); + DocAvailableAppointments( + {@required this.doctor, @required this.isLiveCareAppointment}); @override _DocAvailableAppointmentsState createState() => @@ -31,6 +34,8 @@ class _DocAvailableAppointmentsState extends State AnimationController _animationController; CalendarController _calendarController; + AppSharedPreferences sharedPref = new AppSharedPreferences(); + var selectedDate = ""; dynamic selectedDateJSON; dynamic jsonFreeSlots; @@ -56,8 +61,13 @@ class _DocAvailableAppointmentsState extends State _selectedDay: ['Event A0'] }; - WidgetsBinding.instance - .addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor)); + WidgetsBinding.instance.addPostFrameCallback((_) async { + if (widget.isLiveCareAppointment) + getDoctorScheduledFreeSlots(context, widget.doctor); + else { + getDoctorFreeSlots(context, widget.doctor); + } + }); _calendarController = CalendarController(); _animationController = AnimationController( @@ -323,8 +333,8 @@ class _DocAvailableAppointmentsState extends State getDoctorFreeSlots(context, DoctorList docObject) { DoctorsListService service = new DoctorsListService(); service - .getDoctorFreeSlots( - docObject.doctorID, docObject.clinicID, docObject.projectID, context) + .getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, + docObject.projectID, context) .then((res) { if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { @@ -340,7 +350,32 @@ class _DocAvailableAppointmentsState extends State } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + getDoctorScheduledFreeSlots(context, DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + service + .getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID, + docObject.projectID, docObject.serviceID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + if (res['PatientER_DoctorFreeSlots'].length != 0) { + freeSlotsResponse = res['PatientER_DoctorFreeSlots']; + print("res['PatientER_DoctorFreeSlots']"); + print(res['PatientER_DoctorFreeSlots'].length); + _getJSONSlots().then((value) => { + setState(() => {_events.clear(), _events = value}) + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Widget _buildEventsMarker(DateTime date, List events) { diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 1e7deb38..80288085 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -162,6 +162,7 @@ class _SearchByDoctorState extends State { context, MaterialPageRoute( builder: (context) => SearchResults( + isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))); diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 88912a3f..76741874 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -128,8 +128,8 @@ class _ExpandableListViewState extends State { widget.doctorsList2[index].projectName.toString() ? DoctorView( //AJ note - doctor: widget.doctorsList2[index] - + doctor: widget.doctorsList2[index], + isLiveCareAppointment: false, // widget.doctorsList2[index] ) : Container(); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d3150459..441b7e10 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -11,9 +11,10 @@ import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { final DoctorList doctor; + bool isLiveCareAppointment; - DoctorView({@required this.doctor}); + DoctorView({@required this.doctor, @required this.isLiveCareAppointment}); @override Widget build(BuildContext context) { @@ -185,6 +186,7 @@ class DoctorView extends StatelessWidget { MaterialPageRoute( builder: (context) => DoctorProfile( doctor: docObject, + isLiveCareAppointment: isLiveCareAppointment, docProfileList: docProfile, isOpenAppt: isAppo, ))); diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 66ad31ee..dec4cb7d 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -113,7 +113,7 @@ class _HospitalsLiveChatPageState extends State { IconButton( icon: Icon( Icons - .arrow_forward_rounded, + .arrow_forward_ios, color: tappedIndex == index ? Colors.white diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 19e82086..b0330282 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -356,14 +356,15 @@ class _AppointmentActionsState extends State { print(res); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - Navigator.of(context).pop(); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { print(err); }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)).then((value) { + Navigator.of(context).pop(); + }); } openAppointmentRadiology() { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index dc96864a..f83a62d5 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -284,7 +284,7 @@ class _ToDoState extends State { break; case 50: - return "assets/images/new-design/liveCare_logo_icon.png"; + return "assets/images/new-design/confirm_button.png"; break; default: @@ -297,14 +297,15 @@ class _ToDoState extends State { case 10: confirmAppointment(appo); break; - case 20: getPatientShare(context, appo); break; - case 30: getAppoQR(context, appo); break; + case 50: + confirmAppointment(appo); + break; } } @@ -334,7 +335,7 @@ class _ToDoState extends State { break; case 50: - return TranslationBase.of(context).livecare; + return TranslationBase.of(context).confirmLiveCare; break; default: @@ -444,7 +445,8 @@ class _ToDoState extends State { }).catchError((err) { print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getPatientShare(context, AppoitmentAllHistoryResultList appo) { @@ -457,7 +459,8 @@ class _ToDoState extends State { openPaymentDialog(appo, widget.patientShareResponse); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getAppoQR(context, AppoitmentAllHistoryResultList appo) { @@ -478,7 +481,8 @@ class _ToDoState extends State { navigateToQR(context, res['AppointmentQR'], patientShareResponse); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToQR( @@ -592,7 +596,8 @@ class _ToDoState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { @@ -610,7 +615,8 @@ class _ToDoState extends State { appo); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } addAdvancedNumberRequest(String advanceNumber, String paymentReference, @@ -624,7 +630,8 @@ class _ToDoState extends State { getAppoQR(context, appo); }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToPaymentMethod( @@ -670,6 +677,7 @@ class _ToDoState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } } diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index f3129823..fc5c4eab 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'livecare_type_select.dart'; + class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; diff --git a/lib/pages/livecare/livecare_scheduling/livecare_scheduling_clinic_list.dart b/lib/pages/livecare/livecare_scheduling/livecare_scheduling_clinic_list.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart new file mode 100644 index 00000000..4309cc62 --- /dev/null +++ b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart @@ -0,0 +1,51 @@ +import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; +import 'package:flutter/material.dart'; + +class ScheduleClinicCard extends StatefulWidget { + bool isSelected; + final ClinicsHaveScheduleList clinicsHaveScheduleList; + var languageID; + + ScheduleClinicCard( + {this.isSelected, + this.languageID, + @required this.clinicsHaveScheduleList}); + + @override + _ScheduleClinicCardState createState() => _ScheduleClinicCardState(); +} + +class _ScheduleClinicCardState extends State { + @override + Widget build(BuildContext context) { + return Container( + child: Card( + margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0), + color: widget.isSelected ? Colors.blue : Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + child: Text( + widget.languageID == 'ar' + ? widget.clinicsHaveScheduleList.clinicDescN + : widget.clinicsHaveScheduleList.clinicDesc, + style: TextStyle( + fontSize: 16.0, + color: + widget.isSelected ? Colors.white : Colors.black)), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart new file mode 100644 index 00000000..d8978d8e --- /dev/null +++ b/lib/pages/livecare/livecare_type_select.dart @@ -0,0 +1,224 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class LiveCareTypeSelect extends StatefulWidget { + @override + _LiveCareTypeSelectState createState() => _LiveCareTypeSelectState(); +} + +class _LiveCareTypeSelectState extends State { + var languageID; + AppSharedPreferences sharedPref = AppSharedPreferences(); + + @override + void initState() { + getLanguageID(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + leading: InkWell( + onTap: () { + Navigator.pop(context, null); + }, + child: Icon( + Icons.close, + color: Colors.white, + ), + ), + title: Text(TranslationBase.of(context).bookAppo, + style: TextStyle(color: Colors.white)), + ), + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0), + child: Column( + children: [ + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 15.0, bottom: 10.0), + child: Image.asset( + languageID == 'ar' + ? "assets/images/new-design/liveCare_ar_bg.png" + : "assets/images/new-design/liveCare_en_bg.png", + width: 120), + ), + Container( + alignment: Alignment.center, + child: Text("LiveCare Service", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 20.0))), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text( + "is to obtain medical advice with a specialist doctor Via a video call", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 18.0))), + Container( + margin: EdgeInsets.only(top: 15.0), + alignment: Alignment.centerLeft, + child: Text("WHY LIVECARE?", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 20.0))), + Container( + margin: EdgeInsets.only(top: 20.0, left: 20.0), + child: Row( + children: [ + SvgPicture.asset("assets/images/new-design/check_icon.svg", + width: 25), + Container( + width: MediaQuery.of(context).size.width * 0.75, + margin: EdgeInsets.all(10.0), + child: Text( + "No need to wait, you will get Medical consultation immediately via Video call.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 14.0)), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0, left: 20.0), + child: Row( + children: [ + SvgPicture.asset("assets/images/new-design/check_icon.svg", + width: 25), + Container( + width: MediaQuery.of(context).size.width * 0.75, + margin: EdgeInsets.all(10.0), + child: Text("The doctor will see your medical file.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 14.0)), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 5.0, left: 20.0), + child: Row( + children: [ + SvgPicture.asset("assets/images/new-design/check_icon.svg", + width: 25), + Container( + width: MediaQuery.of(context).size.width * 0.75, + margin: EdgeInsets.all(10.0), + child: Text("Free Prescription delivery service.", + overflow: TextOverflow.clip, + style: TextStyle(fontSize: 14.0)), + ) + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Text( + "** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness", + style: TextStyle(fontSize: 16.0))), + InkWell( + onTap: (){ + Navigator.pop(context, "immediate"); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[900], + borderRadius: BorderRadius.all(Radius.circular(10.0))), + height: 120.0, + margin: EdgeInsets.only(top: 20.0), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 20.0), + child: SvgPicture.asset( + "assets/images/new-design/liveCare_logo_icon_white.svg", + width: 80), + ), + Container( + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), + child: Column( + children: [ + Text("Get Medical consultation immediately", + overflow: TextOverflow.clip, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + color: Colors.white)), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.centerLeft, + child: Text("Instant video call", + style: TextStyle( + fontSize: 18.0, color: Colors.white)), + ) + ], + ), + ), + ], + )), + ), + InkWell( + onTap: (){ + Navigator.pop(context, "schedule"); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[700], + borderRadius: BorderRadius.all(Radius.circular(10.0))), + height: 120.0, + margin: EdgeInsets.only(top: 20.0), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 20.0), + child: Image.asset( + "assets/images/new-design/calendar.png", + width: 70), + ), + Container( + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0), + child: Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text("Book Appointment", + overflow: TextOverflow.clip, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + color: Colors.white)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.centerLeft, + child: Text("Schedule Video Call", + style: TextStyle( + fontSize: 18.0, color: Colors.white)), + ) + ], + ), + ), + ], + )), + ), + ], + ), + ), + ), + ); + } + + getLanguageID() async { + var languageID = await sharedPref.getString(APP_LANGUAGE); + setState(() { + this.languageID = languageID; + }); + } +} diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 9100a64e..c1f5eb75 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -1,9 +1,14 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePaymentDialog.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; @@ -30,8 +35,11 @@ class _clinic_listState extends State { int currentSelectedIndex = 0; LiveCareClinicsListResponse liveCareClinicsListResponse; + LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse; + bool isDataLoaded = false; var languageID; + var currentSelectedLiveCareType; int selectedClinicID = 1; String selectedClinicName = "-"; @@ -46,11 +54,13 @@ class _clinic_listState extends State { @override void initState() { liveCareClinicsListResponse = new LiveCareClinicsListResponse(); + liveCareScheduleClinicsListResponse = + new LiveCareScheduleClinicsListResponse(); + WidgetsBinding.instance.addPostFrameCallback((_) { -// Future.delayed(new Duration(milliseconds: 1200), () { - getLiveCareClinicsList(); -// }); + openLiveCareSelectionDialog(); }); + getLanguageID(); super.initState(); } @@ -58,77 +68,9 @@ class _clinic_listState extends State { @override Widget build(BuildContext context) { return SingleChildScrollView( - child: Column( - children: [ - isDataLoaded - ? Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.all(15.0), - child: Text("Online Clinics: ", - style: TextStyle( - fontSize: 20.0, fontWeight: FontWeight.bold)), - ), - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: liveCareClinicsListResponse - .patientERGetClinicsList.length, - itemBuilder: (context, index) { - return InkWell( - onTap: () { - updateSelectedIndex(liveCareClinicsListResponse - .patientERGetClinicsList[index]); - }, - child: ClinicCard( - isSelected: selectedClinicID == - liveCareClinicsListResponse - .patientERGetClinicsList[index] - .serviceID - ? true - : false, - patientERGetClinicsList: - liveCareClinicsListResponse - .patientERGetClinicsList[index], - languageID: languageID, - ), - ); - }, - ), - Container( - height: 10.0, - ), - ], - ), - ) - : Container(), - isDataLoaded ? Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: startLiveCare, - child: Text("Start", style: TextStyle(fontSize: 18.0)), - ), - ), - ) : Container(), - ], - ), - ); + child: currentSelectedLiveCareType == "immediate" + ? getLiveCareImmediateClinicList() + : getLiveCareScheduleClinicList()); } void startLiveCare() { @@ -388,10 +330,298 @@ class _clinic_listState extends State { text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } + getLiveCareScheduleClinicsList() { + isDataLoaded = false; + LiveCareService service = new LiveCareService(); + service.getLiveCareScheduledClinics(context).then((res) { + print(res['ClinicsHaveScheduleList'].length); + if (res['MessageStatus'] == 1) { + setState(() { + liveCareScheduleClinicsListResponse = + LiveCareScheduleClinicsListResponse.fromJson(res); + print(liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList.length); + selectedClinicID = liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[0].serviceID; + selectedClinicName = liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[0].clinicDesc; + isDataLoaded = true; + }); + } else { + isDataLoaded = true; + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + openLiveCareSelectionDialog() { + Navigator.of(context) + .push(new MaterialPageRoute( + builder: (BuildContext context) { + return LiveCareTypeSelect(); + }, + fullscreenDialog: true)) + .then((value) { + if (value == null) { + Navigator.pop(context); + } else { + print(value); + if (value == "immediate") { + setState(() { + currentSelectedLiveCareType = "immediate"; + }); + getLiveCareClinicsList(); + } + if (value == "schedule") { + setState(() { + currentSelectedLiveCareType = "schedule"; + }); + getLiveCareScheduleClinicsList(); + } + } + }); + } + + Widget getLiveCareScheduleClinicList() { + return Column( + children: [ + isDataLoaded + ? Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ +// Container( +// margin: EdgeInsets.all(15.0), +// child: Text("Online Clinics: ", +// style: TextStyle( +// fontSize: 20.0, fontWeight: FontWeight.bold)), +// ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + updateSelectedScheduleIndex( + liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[index]); + }, + child: ScheduleClinicCard( + isSelected: selectedClinicID == + liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[index] + .serviceID + ? true + : false, + clinicsHaveScheduleList: + liveCareScheduleClinicsListResponse + .clinicsHaveScheduleList[index], + languageID: languageID, + ), + ); + }, + ), + Container( + height: 10.0, + ), + ], + ), + ) + : Container(), + isDataLoaded + ? Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: startScheduleLiveCare, + child: Text("Start", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ) + : Container(), + ], + ); + } + + Widget getLiveCareImmediateClinicList() { + return Column( + children: [ + isDataLoaded + ? Container( + height: MediaQuery.of(context).size.height * 0.7, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(15.0), + child: Text("Online Clinics: ", + style: TextStyle( + fontSize: 20.0, fontWeight: FontWeight.bold)), + ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: liveCareClinicsListResponse + .patientERGetClinicsList.length, + itemBuilder: (context, index) { + return InkWell( + onTap: () { + updateSelectedIndex(liveCareClinicsListResponse + .patientERGetClinicsList[index]); + }, + child: ClinicCard( + isSelected: selectedClinicID == + liveCareClinicsListResponse + .patientERGetClinicsList[index] + .serviceID + ? true + : false, + patientERGetClinicsList: liveCareClinicsListResponse + .patientERGetClinicsList[index], + languageID: languageID, + ), + ); + }, + ), + Container( + height: 10.0, + ), + ], + ), + ) + : Container(), + isDataLoaded + ? Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: startLiveCare, + child: Text("Start", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ) + : Container(), + ], + ); + } + + void startScheduleLiveCare() { + List doctorsList = []; + LiveCareService service = new LiveCareService(); + List _patientDoctorAppointmentListHospital = + List(); + service + .getLiveCareScheduledDoctorList(context, selectedClinicID) + .then((res) { + print(res['DoctorByClinicIDList']); + print(res['DoctorByClinicIDList'].length); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorByClinicIDList'].length != 0) { + res['DoctorByClinicIDList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + } else {} + }); + this.sharedPref.setBool(IS_LIVECARE_APPOINTMENT, true); + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => SearchResults( + doctorsList: docList, + isLiveCareAppointment: true, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))); + } + updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) { setState(() { selectedClinicID = patientERGetClinicsList.serviceID; selectedClinicName = patientERGetClinicsList.serviceName; }); } + + updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) { + setState(() { + selectedClinicID = patientERGetClinicsList.serviceID; + selectedClinicName = patientERGetClinicsList.clinicDesc; + }); + } } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index c992e8e9..8d5b62f6 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -205,6 +205,42 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getDoctorScheduledFreeSlots( + int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { + Map request; + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "DoctorID": docID, + "IsBookingForLiveCare": 1, + "ClinicID": clinicID, + "ProjectID": projectID, + "OriginalClinicID": clinicID, + "ServiceID": serviceID, + "days": 50, + "isReschadual": false, + "VersionID": req.VersionID, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": 0, + "SessionID": null, + "isDentalAllowedBackend": false, + "DeviceTypeID": 1 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, BuildContext context) async { Map request; @@ -258,6 +294,60 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, + String selectedTime, String selectedDate, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "IsForLiveCare": true, + "ProjectID": projectID, + "ClinicID": clinicID, + "DoctorID": docID, + "ServiceID": serviceID, + "StartTime": selectedTime, + "SelectedTime": selectedTime, + "EndTime": selectedTime, + "InitialSlotDuration": 0, + "StrAppointmentDate": selectedDate, + "IsVirtual": false, + "DeviceType": Platform.isIOS ? 'iOS' : 'Android', + "BookedBy": 102, + "VisitType": 1, + "VisitFor": 1, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getPatientShare( String appoID, int clinicID, int projectID, BuildContext context) async { Map request; @@ -302,6 +392,51 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getLiveCareAppointmentPatientShare( + String appoID, int clinicID, int projectID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + + request = { + "ProjectID": projectID, + "ClinicID": clinicID, + "AppointmentNo": appoID, + "IsActiveAppointment": true, + "IsForLiveCare": true, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE, + onSuccess: (response, statusCode) async { + localRes = response['OnlineCheckInAppointments'][0]; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getPatientAppointmentHistory( bool isActiveAppointment, BuildContext context) async { Map request; diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index f76e0336..65cf6daf 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -53,6 +53,81 @@ class LiveCareService extends BaseService { return Future.value(localRes); } + Future getLiveCareScheduledClinics(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINICS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getLiveCareScheduledDoctorList(BuildContext context, int serviceID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": 0, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "ServiceID": serviceID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0 + }; + + dynamic localRes; + + await baseAppClient.post(GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getLivecareHistory(BuildContext context) async { Map request; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ba89fc2c..272d983f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -95,6 +95,8 @@ class TranslationBase { String get confirm => localizedValues['confirm'][locale.languageCode]; + String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; + String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; From 7fdc0da9dc08997edd45e1fb12f6c8524f5f0dc2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 30 Sep 2020 15:33:14 +0300 Subject: [PATCH 19/65] livecare scheduling implemented --- lib/config/config.dart | 22 +- lib/config/localized_values.dart | 2 + .../AppoimentAllHistoryResultList.dart | 141 +++--- .../InsertAppointmentRequest.dart | 1 - .../Appointments/PatientShareResposne.dart | 102 ++-- lib/models/LiveCare/insertVIDARequest.dart | 92 ++++ lib/models/Request.dart | 1 + lib/pages/BookAppointment/BookConfirm.dart | 5 + lib/pages/BookAppointment/BookSuccess.dart | 40 +- .../widgets/AppointmentActions.dart | 36 +- .../widgets/AppointmentCardView.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 464 ++++++++++-------- lib/pages/ToDoList/widgets/upcomingCard.dart | 30 +- lib/pages/landing/home_page.dart | 122 ++++- lib/pages/livecare/livecare_type_select.dart | 13 +- .../appointment_services/GetDoctorsList.dart | 72 ++- lib/uitl/translations_delegate_base.dart | 5 + 17 files changed, 775 insertions(+), 375 deletions(-) create mode 100644 lib/models/LiveCare/insertVIDARequest.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 90c37129..5cad4efd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; @@ -121,6 +121,9 @@ const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; +const INSERT_VIDA_REQUEST = + "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; + //URL to cancel appointment const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; @@ -150,6 +153,22 @@ const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; + +const GET_LIVECARE_SCHEDULE_CLINICS = + 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; + +const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = + 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; + +const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = + 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; + +const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = + 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; + +const GET_PATIENT_SHARE_LIVECARE = + "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; + const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; @@ -232,6 +251,7 @@ class AppGlobal { request.TokenID = "@dm!n"; request.isDentalAllowedBackend = false; request.DeviceTypeID = Platform.isIOS ? 1 : 2; + request.DeviceType = Platform.isIOS ? "iOS" : "Android"; return request; } diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6053dd4a..1472ffe2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -48,6 +48,7 @@ const Map> localizedValues = { 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, 'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'}, + 'waitingForDoctor': {'en': 'Waiting for doctor', 'ar': 'في انتظار الطبيب'}, 'appointment': {'en': 'Appointment', 'ar': 'الموعد'}, 'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'}, 'todoList': {'en': 'Todo List', 'ar': 'مهامي'}, @@ -59,6 +60,7 @@ const Map> localizedValues = { 'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'}, 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, + 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'}, 'cancelAppoMsg': { 'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart index 9ba1fb8e..20eace25 100644 --- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart +++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart @@ -64,73 +64,75 @@ class AppoitmentAllHistoryResultList { String qR; int remaniningHoursTocanPay; bool sMSButtonVisable; + int serviceID; AppoitmentAllHistoryResultList( {this.setupID, - this.projectID, - this.appointmentNo, - this.appointmentDate, - this.appointmentDateN, - this.appointmentType, - this.bookDate, - this.patientType, - this.patientID, - this.clinicID, - this.doctorID, - this.endDate, - this.startTime, - this.endTime, - this.status, - this.visitType, - this.visitFor, - this.patientStatusType, - this.companyID, - this.bookedBy, - this.bookedOn, - this.confirmedBy, - this.confirmedOn, - this.arrivalChangedBy, - this.arrivedOn, - this.editedBy, - this.editedOn, - this.doctorName, - this.doctorNameN, - this.statusDesc, - this.statusDescN, - this.vitalStatus, - this.vitalSignAppointmentNo, - this.episodeID, - this.actualDoctorRate, - this.clinicName, - this.complainExists, - this.doctorImageURL, - this.doctorNameObj, - this.doctorRate, - this.doctorSpeciality, - this.doctorTitle, - this.gender, - this.genderDescription, - this.iSAllowOnlineCheckedIN, - this.isActiveDoctor, - this.isActiveDoctorProfile, - this.isDoctorAllowVedioCall, - this.isExecludeDoctor, - this.isFollowup, - this.isLiveCareAppointment, - this.isMedicalReportRequested, - this.isOnlineCheckedIN, - this.latitude, - this.listHISGetContactLensPerscription, - this.listHISGetGlassPerscription, - this.longitude, - this.nextAction, - this.noOfPatientsRate, - this.originalClinicID, - this.originalProjectID, - this.projectName, - this.qR, - this.remaniningHoursTocanPay, - this.sMSButtonVisable}); + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.actualDoctorRate, + this.clinicName, + this.complainExists, + this.doctorImageURL, + this.doctorNameObj, + this.doctorRate, + this.doctorSpeciality, + this.doctorTitle, + this.gender, + this.genderDescription, + this.iSAllowOnlineCheckedIN, + this.isActiveDoctor, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isFollowup, + this.isLiveCareAppointment, + this.isMedicalReportRequested, + this.isOnlineCheckedIN, + this.latitude, + this.listHISGetContactLensPerscription, + this.listHISGetGlassPerscription, + this.longitude, + this.nextAction, + this.noOfPatientsRate, + this.originalClinicID, + this.originalProjectID, + this.projectName, + this.qR, + this.remaniningHoursTocanPay, + this.sMSButtonVisable, + this.serviceID}); AppoitmentAllHistoryResultList.fromJson(Map json) { setupID = json['SetupID']; @@ -173,7 +175,9 @@ class AppoitmentAllHistoryResultList { doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; doctorRate = json['DoctorRate']; - doctorSpeciality = json['DoctorSpeciality'] != null ?json['DoctorSpeciality'].cast() : ["null"]; + doctorSpeciality = json['DoctorSpeciality'] != null + ? json['DoctorSpeciality'].cast() + : ["null"]; doctorTitle = json['DoctorTitle']; gender = json['Gender']; genderDescription = json['GenderDescription']; @@ -188,7 +192,7 @@ class AppoitmentAllHistoryResultList { isOnlineCheckedIN = json['IsOnlineCheckedIN']; latitude = json['Latitude']; listHISGetContactLensPerscription = - json['List_HIS_GetContactLensPerscription']; + json['List_HIS_GetContactLensPerscription']; listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription']; longitude = json['Longitude']; nextAction = json['NextAction']; @@ -199,6 +203,7 @@ class AppoitmentAllHistoryResultList { qR = json['QR']; remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; sMSButtonVisable = json['SMSButtonVisable']; + serviceID = json['ServiceID']; } Map toJson() { @@ -269,6 +274,7 @@ class AppoitmentAllHistoryResultList { data['QR'] = this.qR; data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; data['SMSButtonVisable'] = this.sMSButtonVisable; + data['ServiceID'] = this.serviceID; return data; } } @@ -278,7 +284,8 @@ class PatientAppointmentList { List patientDoctorAppointmentList = List(); PatientAppointmentList( - {this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) { + {this.filterName, + AppoitmentAllHistoryResultList patientDoctorAppointment}) { patientDoctorAppointmentList.add(patientDoctorAppointment); } } diff --git a/lib/models/Appointments/InsertAppointmentRequest.dart b/lib/models/Appointments/InsertAppointmentRequest.dart index badbb6a7..383e2eb5 100644 --- a/lib/models/Appointments/InsertAppointmentRequest.dart +++ b/lib/models/Appointments/InsertAppointmentRequest.dart @@ -13,7 +13,6 @@ class InsertAppointmentRequest extends Request { bool IsVirtual; List GeneralProcedureList; String DeviceToken; - String DeviceType; bool IsForLiveCare; String OriginalClinicID; String OriginalProjectID; diff --git a/lib/models/Appointments/PatientShareResposne.dart b/lib/models/Appointments/PatientShareResposne.dart index e3a596d6..2e22ed60 100644 --- a/lib/models/Appointments/PatientShareResposne.dart +++ b/lib/models/Appointments/PatientShareResposne.dart @@ -12,6 +12,7 @@ class PatientShareResponse { int companyShareWithTax; String doctorImageURL; String doctorNameObj; + int doctorID; List doctorSpeciality; dynamic errCode; int groupID; @@ -47,56 +48,59 @@ class PatientShareResponse { dynamic statusDesc; dynamic subPolicyNo; int userID; + int serviceID; PatientShareResponse( {this.advanceNumber, - this.appointmentDate, - this.appointmentNo, - this.cashPrice, - this.cashPriceTax, - this.cashPriceWithTax, - this.clinicID, - this.clinicName, - this.companyId, - this.companyName, - this.companyShareWithTax, - this.doctorImageURL, - this.doctorNameObj, - this.doctorSpeciality, - this.errCode, - this.groupID, - this.iSAllowOnlineCheckedIN, - this.insurancePolicyNo, - this.isExcludedForOnlineCheckin, - this.isFollowup, - this.isLiveCareAppointment, - this.isOnlineCheckedIN, - this.message, - this.nextAction, - this.patientCardID, - this.patientID, - this.patientShare, - this.patientShareWithTax, - this.patientStatusType, - this.patientTaxAmount, - this.patientType, - this.paymentAmount, - this.paymentDate, - this.paymentMethodName, - this.paymentReferenceNumber, - this.policyId, - this.policyName, - this.procedureName, - this.projectID, - this.projectName, - this.setupID, - this.sourceType, - this.startTime, - this.status, - this.statusCode, - this.statusDesc, - this.subPolicyNo, - this.userID}); + this.appointmentDate, + this.appointmentNo, + this.cashPrice, + this.cashPriceTax, + this.cashPriceWithTax, + this.clinicID, + this.clinicName, + this.companyId, + this.companyName, + this.companyShareWithTax, + this.doctorID, + this.doctorImageURL, + this.doctorNameObj, + this.doctorSpeciality, + this.errCode, + this.groupID, + this.iSAllowOnlineCheckedIN, + this.insurancePolicyNo, + this.isExcludedForOnlineCheckin, + this.isFollowup, + this.isLiveCareAppointment, + this.isOnlineCheckedIN, + this.message, + this.nextAction, + this.patientCardID, + this.patientID, + this.patientShare, + this.patientShareWithTax, + this.patientStatusType, + this.patientTaxAmount, + this.patientType, + this.paymentAmount, + this.paymentDate, + this.paymentMethodName, + this.paymentReferenceNumber, + this.policyId, + this.policyName, + this.procedureName, + this.projectID, + this.projectName, + this.setupID, + this.sourceType, + this.startTime, + this.status, + this.statusCode, + this.statusDesc, + this.subPolicyNo, + this.userID, + this.serviceID}); PatientShareResponse.fromJson(Map json) { advanceNumber = json['AdvanceNumber']; @@ -110,6 +114,7 @@ class PatientShareResponse { companyId = json['CompanyId']; companyName = json['CompanyName']; companyShareWithTax = json['CompanyShareWithTax']; + doctorID = json['DoctorID']; doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; doctorSpeciality = json['DoctorSpeciality'].cast(); @@ -147,6 +152,7 @@ class PatientShareResponse { statusDesc = json['StatusDesc']; subPolicyNo = json['SubPolicyNo']; userID = json['UserID']; + serviceID = json['ServiceID']; } Map toJson() { @@ -162,6 +168,7 @@ class PatientShareResponse { data['CompanyId'] = this.companyId; data['CompanyName'] = this.companyName; data['CompanyShareWithTax'] = this.companyShareWithTax; + data['DoctorID'] = this.doctorID; data['DoctorImageURL'] = this.doctorImageURL; data['DoctorNameObj'] = this.doctorNameObj; data['DoctorSpeciality'] = this.doctorSpeciality; @@ -199,6 +206,7 @@ class PatientShareResponse { data['StatusDesc'] = this.statusDesc; data['SubPolicyNo'] = this.subPolicyNo; data['UserID'] = this.userID; + data['ServiceID'] = this.serviceID; return data; } } diff --git a/lib/models/LiveCare/insertVIDARequest.dart b/lib/models/LiveCare/insertVIDARequest.dart new file mode 100644 index 00000000..938ca102 --- /dev/null +++ b/lib/models/LiveCare/insertVIDARequest.dart @@ -0,0 +1,92 @@ +class insertVIDARequest { + int patientID; + int acceptedBy; + int appointmentNo; + String deviceToken; + double latitude; + double longitude; + int serviceID; + int projectID; + int clinicID; + String deviceType; + String voipToken; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + + insertVIDARequest( + {this.patientID, + this.acceptedBy, + this.appointmentNo, + this.deviceToken, + this.latitude, + this.longitude, + this.serviceID, + this.projectID, + this.clinicID, + this.deviceType, + this.voipToken, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID}); + + insertVIDARequest.fromJson(Map json) { + patientID = json['PatientID']; + acceptedBy = json['AcceptedBy']; + appointmentNo = json['AppointmentNo']; + deviceToken = json['DeviceToken']; + latitude = json['Latitude']; + longitude = json['Longitude']; + serviceID = json['ServiceID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + deviceType = json['DeviceType']; + voipToken = json['VoipToken']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientID'] = this.patientID; + data['AcceptedBy'] = this.acceptedBy; + data['AppointmentNo'] = this.appointmentNo; + data['DeviceToken'] = this.deviceToken; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['ServiceID'] = this.serviceID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['DeviceType'] = this.deviceType; + data['VoipToken'] = this.voipToken; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + return data; + } +} diff --git a/lib/models/Request.dart b/lib/models/Request.dart index 03aa7760..a4cef77b 100644 --- a/lib/models/Request.dart +++ b/lib/models/Request.dart @@ -5,6 +5,7 @@ class Request { var ProjectID; var LanguageID; var DeviceTypeID; + var DeviceType; var AppointmentNo; var IPAdress; var VersionID; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 8647b2f0..b0110d2b 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -210,11 +210,13 @@ class _BookConfirmState extends State { "assets/images/new-design/icon_hospital.png"), ), Container( + width: MediaQuery.of(context).size.width * 0.7, margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), child: Text( TranslationBase.of(context).clinic + ": " + widget.doctor.clinicName, + overflow: TextOverflow.clip, style: TextStyle( fontSize: 14.0, color: Colors.grey[700], @@ -340,6 +342,9 @@ class _BookConfirmState extends State { ), ), ), + SizedBox( + height: 120.0, + ), ], ), ), diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 2f7bde88..704618ac 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -287,10 +287,15 @@ class _BookSuccessState extends State { disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), onPressed: () { - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; - appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.appointmentNo = + widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; confirmAppointment(appo); }, child: Text( @@ -336,7 +341,33 @@ class _BookSuccessState extends State { DoctorsListService service = new DoctorsListService(); service .confirmAppointment( - appo.appointmentNo, appo.clinicID, appo.projectID, context) + appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context) + .then((res) { + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + navigateToHome(context); + } + }); + } + + insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.serviceID, appo.doctorID, context) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); @@ -346,7 +377,8 @@ class _BookSuccessState extends State { } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Widget _getPayNowAppo() { diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index b0330282..18740ce7 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -352,19 +352,24 @@ class _AppointmentActionsState extends State { cancelAppointment() { ConfirmDialog.closeAlertDialog(context); DoctorsListService service = new DoctorsListService(); - service.cancelAppointment(widget.appo, context).then((res) { - print(res); - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)).then((value) { - Navigator.of(context).pop(); - }); + service + .cancelAppointment(widget.appo, context) + .then((res) { + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.of(context).pop(); + }); } openAppointmentRadiology() { @@ -469,8 +474,7 @@ class _AppointmentActionsState extends State { } }).catchError((err) { print(err); - AppToast.showErrorToast( - message: err); + AppToast.showErrorToast(message: err); }).showProgressBar( text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } @@ -541,7 +545,7 @@ class _AppointmentActionsState extends State { DoctorsListService service = new DoctorsListService(); service .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, - widget.appo.projectID, context) + widget.appo.projectID, widget.appo.isLiveCareAppointment, context) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index b64bd232..2e5c88b0 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -24,7 +24,7 @@ class _ApointmentCardState extends State { navigateToAppointmentDetails(context, widget.appo); }, child: Card( - margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), + margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index f83a62d5..796794b2 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:rating_bar/rating_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; @@ -37,8 +38,6 @@ class _ToDoState extends State { @override void initState() { -// authUser = authProvider.getAuthenticatedUser(); - print("initState!!!!!"); widget.patientShareResponse = new PatientShareResponse(); WidgetsBinding.instance .addPostFrameCallback((_) => getPatientAppointmentHistory()); @@ -50,205 +49,230 @@ class _ToDoState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, body: SingleChildScrollView( - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: widget.appoList.length, - itemBuilder: (context, index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Row( + child: Column( + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.appoList.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, children: [ - Image.asset( - "assets/images/new-design/time_icon.png", - width: 20.0, - height: 20.0), - Container( - margin: EdgeInsets.only(left: 10.0, right: 30.0), - child: Text( - getDate( - widget.appoList[index].appointmentDate), - style: TextStyle(fontSize: 12.0)), + Row( + children: [ + Image.asset( + "assets/images/new-design/time_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: + EdgeInsets.only(left: 5.0, right: 25.0), + child: Text( + getDate(widget + .appoList[index].appointmentDate), + style: TextStyle(fontSize: 11.0)), + ), + widget.appoList[index].isLiveCareAppointment + ? SvgPicture.asset( + "assets/images/new-design/liveCare_logo_icon.svg", + width: 20.0, + height: 20.0) + : Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0), + Container( + margin: + EdgeInsets.only(left: 5.0, right: 5.0), + child: widget + .appoList[index].isLiveCareAppointment + ? Text( + TranslationBase.of(context) + .liveCareAppo, + style: TextStyle(fontSize: 12.0)) + : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-", + style: TextStyle(fontSize: 12.0)), + ), + ], ), - Image.asset( - "assets/images/new-design/hospital_address_icon.png", - width: 20.0, - height: 20.0), Container( - margin: EdgeInsets.only(left: 10.0, right: 10.0), - child: Text(widget.appoList[index].projectName, - style: TextStyle(fontSize: 12.0)), - ), - ], - ), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Divider( - color: Colors.grey[500], - ), - ), - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 1, - child: Container( - height: - MediaQuery.of(context).size.height * 0.1, - margin: EdgeInsets.only(top: 5.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(100.0), - child: Image.network( - widget.appoList[index].doctorImageURL, - fit: BoxFit.fill), - ), + margin: EdgeInsets.only(top: 5.0), + child: Divider( + color: Colors.grey[500], ), ), - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 20.0, left: 20.0, right: 20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.appoList[index].doctorTitle + - " " + - widget - .appoList[index].doctorNameObj, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.bold, - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only( - top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(widget - .appoList[index] - .doctorSpeciality) - .trim(), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], - letterSpacing: 1.0)), + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + height: MediaQuery.of(context).size.height * + 0.1, + margin: EdgeInsets.only(top: 5.0), + child: ClipRRect( + borderRadius: + BorderRadius.circular(100.0), + child: Image.network( + widget.appoList[index].doctorImageURL, + fit: BoxFit.fill), ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, + ), + ), + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 20.0, left: 20.0, right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - RatingBar.readOnly( - initialRating: widget - .appoList[index].actualDoctorRate - .toDouble(), - size: 20.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + Text( + widget.appoList[index].doctorTitle + + " " + + widget.appoList[index] + .doctorNameObj, + style: TextStyle( + fontSize: 14.0, + color: Colors.black, + fontWeight: FontWeight.bold, + letterSpacing: 1.0)), + Container( + margin: EdgeInsets.only( + top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(widget + .appoList[index] + .doctorSpeciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: widget + .appoList[index] + .actualDoctorRate + .toDouble(), + size: 20.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ], ), ], ), - ], + ), ), - ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => performNextAction( + widget.appoList[index]), + child: Container( + margin: EdgeInsets.only(top: 20.0), + child: Column( + children: [ + Image.asset( + getNextActionImage(widget + .appoList[index].nextAction), + width: 50.0, + height: 50.0), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text( + getNextActionText(widget + .appoList[index] + .nextAction), + textAlign: TextAlign.center, + style: + TextStyle(fontSize: 12.0)), + ) + ], + ), + ), + ), + ) + ], + ), + Divider( + color: Colors.grey[500], ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => - performNextAction(widget.appoList[index]), - child: Container( - margin: EdgeInsets.only(top: 20.0), - child: Column( - children: [ - Image.asset( - getNextActionImage(widget - .appoList[index].nextAction), - width: 50.0, - height: 50.0), - Container( - margin: EdgeInsets.only(top: 5.0), - child: Text( - getNextActionText(widget - .appoList[index].nextAction), - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12.0)), - ) - ], + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 2, + child: Container( + child: Text( + getNextActionDescription( + widget.appoList[index].nextAction), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[700])), ), ), - ), - ) - ], - ), - Divider( - color: Colors.grey[500], - ), - Flex( - direction: Axis.horizontal, - children: [ - Expanded( - flex: 2, - child: Container( - child: Text( - getNextActionDescription( - widget.appoList[index].nextAction), - style: TextStyle( - fontSize: 12.0, - color: Colors.grey[700])), - ), + Expanded( + flex: 1, + child: GestureDetector( + onTap: () { + navigateToAppointmentDetails( + context, widget.appoList[index]); + }, + child: Container( + child: Text( + TranslationBase.of(context) + .upcomingDetails, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 12.0, + color: Colors.red[600], + decoration: + TextDecoration.underline)), + ), + ), + ) + ], ), - Expanded( - flex: 1, - child: GestureDetector( - onTap: () { - navigateToAppointmentDetails( - context, widget.appoList[index]); - }, - child: Container( - child: Text( - TranslationBase.of(context) - .upcomingDetails, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 12.0, - color: Colors.red[600], - decoration: - TextDecoration.underline)), - ), - ), - ) ], ), - ], + ), ), - ), - ), - ); - }, - ), + ); + }, + ), + ), + SizedBox( + height: 120.0, + ), + ], ), ), ); @@ -287,6 +311,10 @@ class _ToDoState extends State { return "assets/images/new-design/confirm_button.png"; break; + case 60: + return "assets/images/new-design/waiting_for_doctor.png"; + break; + default: return ""; } @@ -306,6 +334,8 @@ class _ToDoState extends State { case 50: confirmAppointment(appo); break; + case 60: + break; } } @@ -338,6 +368,10 @@ class _ToDoState extends State { return TranslationBase.of(context).confirmLiveCare; break; + case 60: + return TranslationBase.of(context).waitingForDoctor; + break; + default: return ""; } @@ -372,6 +406,10 @@ class _ToDoState extends State { return TranslationBase.of(context).upcomingLivecare; break; + case 60: + return TranslationBase.of(context).waitingForDoctor; + break; + default: return ""; } @@ -428,7 +466,6 @@ class _ToDoState extends State { getPatientAppointmentHistory() { DoctorsListService service = new DoctorsListService(); service.getPatientAppointmentHistory(true, context).then((res) { - print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { if (res['AppoimentAllHistoryResultList'].length != 0) { @@ -439,6 +476,10 @@ class _ToDoState extends State { }); } else {} }); + widget.appoList.forEach((element) { + print(element.isLiveCareAppointment); + print(element.nextAction); + }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -666,18 +707,49 @@ class _ToDoState extends State { confirmAppointment(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); service - .confirmAppointment( - appo.appointmentNo, appo.clinicID, appo.projectID, context) + .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.isLiveCareAppointment, context) .then((res) { - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - getPatientAppointmentHistory(); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + getPatientAppointmentHistory(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + getPatientAppointmentHistory(); + } + }); + } + + insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { + DoctorsListService service = new DoctorsListService(); + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, + appo.serviceID, appo.doctorID, context) + .then((res) { + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + getPatientAppointmentHistory(); + }); } } diff --git a/lib/pages/ToDoList/widgets/upcomingCard.dart b/lib/pages/ToDoList/widgets/upcomingCard.dart index 1b4a4cc3..c1d1b546 100644 --- a/lib/pages/ToDoList/widgets/upcomingCard.dart +++ b/lib/pages/ToDoList/widgets/upcomingCard.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:rating_bar/rating_bar.dart'; class TodoListCard extends StatefulWidget { @@ -12,7 +13,6 @@ class TodoListCard extends StatefulWidget { var languageID; final VoidCallback onListUpdated; - TodoListCard({@required this.appo, this.onListUpdated}); @override @@ -54,14 +54,22 @@ class _TodoListCardState extends State { child: Text(getDate(widget.appo.appointmentDate), style: TextStyle(fontSize: 12.0)), ), - Image.asset( - "assets/images/new-design/hospital_address_icon.png", - width: 20.0, - height: 20.0), + widget.appo.isLiveCareAppointment + ? SvgPicture.asset( + "assets/images/new-design/liveCare_logo_icon.svg", + width: 20.0, + height: 20.0) + : Image.asset( + "assets/images/new-design/hospital_address_icon.png", + width: 20.0, + height: 20.0), Container( margin: EdgeInsets.only(left: 10.0, right: 10.0), - child: Text(widget.appo.projectName, - style: TextStyle(fontSize: 12.0)), + child: widget.appo.isLiveCareAppointment + ? Text(TranslationBase.of(context).upcomingLivecare, + style: TextStyle(fontSize: 12.0)) + : Text(widget.appo.projectName, + style: TextStyle(fontSize: 12.0)), ), ], ), @@ -105,7 +113,10 @@ class _TodoListCardState extends State { letterSpacing: 1.0)), Container( margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality).trim(), + child: Text( + getDoctorSpeciality( + widget.appo.doctorSpeciality) + .trim(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -323,14 +334,13 @@ class _TodoListCardState extends State { } String getMinute(DateTime dateObj) { - if(dateObj.minute == 0) { + if (dateObj.minute == 0) { return dateObj.minute.toString() + "0"; } else { return dateObj.minute.toString(); } } - String getDoctorSpeciality(List docSpecial) { String docSpeciality = ""; docSpecial.forEach((v) { diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 59c0a167..55a095ed 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -5,16 +5,16 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medic import 'package:diplomaticquarterapp/pages/ContactUs/hmg_service.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -56,20 +56,112 @@ class _HomePageState extends State { child: Stack( children: [ Positioned( - top: 30, - left: 15, - right: 15, + top: 15, + left: 5, + right: 5, child: Container( width: MediaQuery.of(context).size.width * 0.8, child: Row( children: [ + Expanded( + child: Container( + height: 120, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/new-design/covid_bg_transparent.png"), + fit: BoxFit.fill, + ), + color: + Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5))), + child: Container( + margin: EdgeInsets.only(top: 10.0), + child: Column( + children: [ + Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: + FontWeight.bold, + fontSize: 18.0)), + Row( + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 50.0, + height: 50.0), + ), + Container( + margin: EdgeInsets.only( + left: 10.0, top: 10.0), + child: Column( + children: [ + Text("Drive-Thru", + style: TextStyle( + color: Colors + .white, + fontWeight: + FontWeight + .bold, + fontSize: + 16.0)), + ButtonTheme( + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5.0), + ), + minWidth: MediaQuery.of( + context) + .size + .width * + 0.15, + height: 25.0, + child: RaisedButton( + color: Colors.red[800], + textColor: + Colors.white, + disabledTextColor: + Colors.white, + disabledColor: + new Color( + 0xFFbcc2c4), + onPressed: () { +// if (_isButtonDisabled == false) { +// _searchDoctor(context); +// } + }, + child: Text("BOOK NOW", + style: TextStyle( + fontSize: + 12.0)), + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ), Expanded( child: InkWell( onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())), child: Container( - height: 110, + height: 120, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), decoration: BoxDecoration( @@ -77,25 +169,13 @@ class _HomePageState extends State { .withOpacity(0.3), borderRadius: BorderRadius.all( Radius.circular(5))), - child: Image.asset( - 'assets/images/livecare_white_logo.png', + child: SvgPicture.asset( + projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' : + 'assets/images/new-design/liveCare_white_logo.svg', ), ), ), ), - Expanded( - child: Container( - height: 110, - padding: EdgeInsets.all(15), - margin: EdgeInsets.all(5), - decoration: BoxDecoration( - color: - Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all( - Radius.circular(5))), - // child: Image.asset('assets/images/livecare_white_logo.png',), - ), - ), ], ), ), diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index d8978d8e..64114304 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -74,7 +74,7 @@ class _LiveCareTypeSelectState extends State { SvgPicture.asset("assets/images/new-design/check_icon.svg", width: 25), Container( - width: MediaQuery.of(context).size.width * 0.75, + width: MediaQuery.of(context).size.width * 0.72, margin: EdgeInsets.all(10.0), child: Text( "No need to wait, you will get Medical consultation immediately via Video call.", @@ -91,7 +91,7 @@ class _LiveCareTypeSelectState extends State { SvgPicture.asset("assets/images/new-design/check_icon.svg", width: 25), Container( - width: MediaQuery.of(context).size.width * 0.75, + width: MediaQuery.of(context).size.width * 0.72, margin: EdgeInsets.all(10.0), child: Text("The doctor will see your medical file.", overflow: TextOverflow.clip, @@ -107,7 +107,7 @@ class _LiveCareTypeSelectState extends State { SvgPicture.asset("assets/images/new-design/check_icon.svg", width: 25), Container( - width: MediaQuery.of(context).size.width * 0.75, + width: MediaQuery.of(context).size.width * 0.72, margin: EdgeInsets.all(10.0), child: Text("Free Prescription delivery service.", overflow: TextOverflow.clip, @@ -140,7 +140,7 @@ class _LiveCareTypeSelectState extends State { width: 80), ), Container( - width: MediaQuery.of(context).size.width * 0.6, + width: MediaQuery.of(context).size.width * 0.56, margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), child: Column( children: [ @@ -182,7 +182,7 @@ class _LiveCareTypeSelectState extends State { width: 70), ), Container( - width: MediaQuery.of(context).size.width * 0.6, + width: MediaQuery.of(context).size.width * 0.58, margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0), child: Column( children: [ @@ -208,6 +208,9 @@ class _LiveCareTypeSelectState extends State { ], )), ), + SizedBox( + height: 40.0, + ), ], ), ), diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 8d5b62f6..542ea3e2 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/LiveCare/insertVIDARequest.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -21,6 +22,8 @@ class DoctorsListService extends BaseService { double lat; double long; + String deviceToken; + String tokenID; Future getDoctorsList( int clinicID, int projectID, bool isNearest, BuildContext context, @@ -48,7 +51,7 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -106,7 +109,7 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": null, @@ -146,7 +149,7 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": null, @@ -188,7 +191,7 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "SessionID": null, "isDentalAllowedBackend": false, "DeviceTypeID": 1 @@ -224,7 +227,7 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", - "PatientOutSA": 0, + "PatientOutSA": authUser.outSA, "SessionID": null, "isDentalAllowedBackend": false, "DeviceTypeID": 1 @@ -513,7 +516,7 @@ class DoctorsListService extends BaseService { } Future confirmAppointment( - int appoNo, int clinicID, int projectID, BuildContext context) async { + int appoNo, int clinicID, int projectID, bool isLiveCare, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -527,6 +530,7 @@ class DoctorsListService extends BaseService { request = { "AppointmentNumber": appoNo, + "IsLiveCareAppointment": isLiveCare, "ClinicID": clinicID, "ProjectID": projectID, "ConfirmationBy": 102, @@ -556,6 +560,62 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + + Future insertVIDARequest( + int appoNo, int clinicID, int projectID, int serviceID, int docID, BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + deviceToken = await sharedPref.getString(PUSH_TOKEN); + + if (await this.sharedPref.getDouble(USER_LAT) != null && + await this.sharedPref.getDouble(USER_LONG) != null) { + lat = await this.sharedPref.getDouble(USER_LAT); + long = await this.sharedPref.getDouble(USER_LONG); + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + + request = { + "AppointmentNo": appoNo, + "ClinicID": clinicID, + "ProjectID": projectID, + "ServiceID": serviceID, + "AcceptedBy": docID, + "DeviceToken": deviceToken, + "Latitude": lat, + "Longitude": long, + "DeviceType": req.DeviceType, + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(INSERT_VIDA_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future cancelAppointment( AppoitmentAllHistoryResultList appo, BuildContext context) async { Map request; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 272d983f..71927d28 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -97,6 +97,8 @@ class TranslationBase { String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; + String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; + String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; @@ -222,6 +224,9 @@ class TranslationBase { String get upcomingLivecare => localizedValues['upcoming-livecare'][locale.languageCode]; + String get liveCareAppo => + localizedValues['livecareAppo'][locale.languageCode]; + String get upcomingDetails => localizedValues['upcoming-details'][locale.languageCode]; From 929e289a6f1a3cdb6cb6612d6ed2a96abfc8c470 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 30 Sep 2020 18:08:53 +0300 Subject: [PATCH 20/65] started implementing Covid-19 DriveThru Test Module --- assets/images/new-design/calendar.png | Bin 0 -> 5627 bytes .../new-design/covid_bg_transparent.png | Bin 0 -> 11952 bytes .../new-design/hmg_full_logo_hd_white.png | Bin 0 -> 19553 bytes .../images/new-design/waiting_for_doctor.png | Bin 0 -> 2554 bytes lib/config/config.dart | 2 + .../DriveThroughTestingCenterModel.dart | 68 +++++ lib/pages/BookAppointment/BookSuccess.dart | 2 +- .../covid-drivethru-location.dart | 258 ++++++++++++++++++ lib/pages/landing/home_page.dart | 27 +- .../appointment_services/GetDoctorsList.dart | 1 - .../covid-drivethru/covid-drivethru.dart | 52 ++++ lib/widgets/others/arrow_back.dart | 6 +- 12 files changed, 402 insertions(+), 14 deletions(-) create mode 100644 assets/images/new-design/calendar.png create mode 100644 assets/images/new-design/covid_bg_transparent.png create mode 100644 assets/images/new-design/hmg_full_logo_hd_white.png create mode 100644 assets/images/new-design/waiting_for_doctor.png create mode 100644 lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart create mode 100644 lib/pages/Covid-DriveThru/covid-drivethru-location.dart create mode 100644 lib/services/covid-drivethru/covid-drivethru.dart diff --git a/assets/images/new-design/calendar.png b/assets/images/new-design/calendar.png new file mode 100644 index 0000000000000000000000000000000000000000..ac72b030ab799a61619080779577a75455d0dafe GIT binary patch literal 5627 zcmd^Dc{o)4+dnfVjU*!39vWi{G4^aD#=bV1EDwpSjcpj)WTGM2g^+Azo-9Mil08%+ zk)`Zg@<_HpB_p)FM?Jsi*Y&)=_x=05u6M3$&biNhf9~b`J)iG6_xHqMEezQX@E-sG zfX&!Q?+kce2LE(8Gk6T`RmXuRn1_zJ4ggdovwpd-54=XW7@aW(t>OSci2{HfP(@h; zfFL>0*9idBZvg<0Uv877CTO_mW^3$jZVpI+G8}+Gm;okGf&ftP!1Y%)*Mj;VDAc0|AX6}<)_<^as5oExfe_wdyx=G04IZpcQN)2bR+r^!HL-`QcFSe zN4oz7@$b@q#yU;JyMcrM;Vu7{_piEt;&ll=V7h>Sy=?!&|El{Z{)}4y!8>R#yp=CL z@b3cuq5j2dZ`|rwJju=bcRjq1o9~ZI3W_S4sQ+mBr>8E#n?S_*U2t*REANNPFRFi{ zf8??KHILG-d493{<*A9<G2Q*QCGZ-|vw1R7m6KSlcbCv{I&AU`4 zYQ-J1@VxRM(&&i-vyN*DZ)z_BF^Q0)AR*>}|B!HWtO>{A&->w;5M}>acJ2Mb@u~We z9EbO{YjMT&0+EN9R2Ac@;qDYjw7%1uZH@Mo%<$>;AggJu`lhvJM=^07uiUAN9~>G8mEf$I6{UAHzKGTE&=gQ9XH%yp})+pO*E-L3iVZ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Z9(*vDZ4b#qpjqGIltNr)em<`j0 zX@=7ayP8FnS1^m;pqtbwnnI4`OQ^_yz%XueeO~ar1Nz|60LzddQhN{43nQ*!S#t}u ztgaYe+!ZZ~JeT9<2u{`glr@(k5i0qVfch-C6iHk|##F7lhD==i$4pa@N~ZN1zU>0!dqmTR4@m)oL5yc5f?u}&D*SzJ$Ta8BdtjvFThhdaYL-6O!rS^KcHO`;%rB_S+8 z$*LXjL%%_yB;m^P$-qQ9EWk0;7AR0(E>V=@YdtRLDc>$Y`X9BfmYK_6aFFhk#z7Wf zF$GpMg)|mSwOD3*aBZo_skmnII&R7$?FJ|0VTni4`w>d9B;+&X`ST=j#?L82i6p!aUO9B#0(kkf6w)OG_(pVKe=BpedwY?Nl=n7_I@hG7x_cZ*Ka=HVP z2pHyTrBW5VFkWvo>E|I`g$)?kUm*#}2sWjo6O;ZWtMUl3=T{BnW9MgWbt-j1R~j#J z)jMRJm json) { + rowID = json['RowID']; + iD = json['ID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + numberOfTracks = json['NumberOfTracks']; + isActive = json['IsActive']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedON = json['EditedON']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['ID'] = this.iD; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['NumberOfTracks'] = this.numberOfTracks; + data['IsActive'] = this.isActive; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedON'] = this.editedON; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + return data; + } +} diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 704618ac..34dbdc2f 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -782,7 +782,7 @@ class _BookSuccessState extends State { } Future navigateToHome(context) async { - Navigator.of(context).pushNamed(HOME); + Navigator.of(context).popAndPushNamed(HOME); } getAppoQR(context) { diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart new file mode 100644 index 00000000..6b1c5f2b --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -0,0 +1,258 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:maps_launcher/maps_launcher.dart'; + +class CovidDrivethruLocation extends StatefulWidget { + @override + _CovidDrivethruLocationState createState() => _CovidDrivethruLocationState(); +} + +class _CovidDrivethruLocationState extends State { + String projectDropdownValue; + List projectsList = []; + bool isLocationSelected = false; + String projectLat = ""; + String projectLong = ""; + String projectName = ""; + + @override + void initState() { + WidgetsBinding.instance + .addPostFrameCallback((_) => getProjectsList(context)); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + child: Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Text("Get The Result During 8 Hours", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 22.0, + color: Colors.black)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + "We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR​", + style: TextStyle(fontSize: 16.0, color: Colors.black)), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + alignment: Alignment.centerLeft, + child: Text("Select Location", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + letterSpacing: 0.8, + color: Colors.grey[700])), + ), + Container( + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey[400], + width: 1.0, + ), + borderRadius: BorderRadius.circular(10), + ), + padding: EdgeInsets.all(8.0), + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.only(top: 15.0), + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: new Text("Select Address"), + value: projectDropdownValue, + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.iD.toString(), + child: new Text(item.projectName), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + setProjectLocation(newValue); + }); + }, + ), + )), + isLocationSelected + ? Container( + margin: EdgeInsets.only(top: 15.0), + alignment: Alignment.centerLeft, + child: Text("Selected Location", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + letterSpacing: 0.8, + color: Colors.black)), + ) : Container(), + isLocationSelected + ? Container( + margin: EdgeInsets.only(top: 5.0), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey[400], width: 1.0), + ), + child: Image.network( + "https://maps.googleapis.com/maps/api/staticmap?center=" + + this.projectLat + + "," + + this.projectLong + + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + + this.projectLat + + "," + + this.projectLong + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), + ) + : Container(), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.15, + width: double.infinity, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.91, + height: 45.0, + child: RaisedButton( + color: new Color(0xFFc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.red[300], + onPressed: () { + getDirections(); + }, + child: + Text("GET DIRECTIONS", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + back(); + }, + child: Text("BACK", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + next(); + }, + child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ); + } + + getDirections() { + if(isLocationSelected) { + MapsLauncher.launchCoordinates(double.parse(projectLat),double.parse(projectLong), this.projectName); + } else { + Utils.showErrorToast("Please select address from the dropdown menu to get directions"); + } + } + + next() { + + } + + back() { + Navigator.of(context).popAndPushNamed(HOME); + } + + setProjectLocation(newValue) { + print(newValue); + print(projectsList[(int.parse(newValue) - 1)].projectName); + setState(() { + this.projectLat = + projectsList[(int.parse(newValue) - 1)].latitude.toString(); + this.projectLong = + projectsList[(int.parse(newValue) - 1)].longitude.toString(); + this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; + isLocationSelected = true; + }); + } + + getProjectsList(BuildContext context) { + CovidDriveThruService service = new CovidDriveThruService(); + service.getCovidProjectsList(context).then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { + projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); + }); + }); + } else {} + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 55a095ed..d427c2f1 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/hmg_service.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -71,7 +72,8 @@ class _HomePageState extends State { margin: EdgeInsets.all(5), decoration: BoxDecoration( image: DecorationImage( - image: AssetImage("assets/images/new-design/covid_bg_transparent.png"), + image: AssetImage( + "assets/images/new-design/covid_bg_transparent.png"), fit: BoxFit.fill, ), color: @@ -100,7 +102,8 @@ class _HomePageState extends State { ), Container( margin: EdgeInsets.only( - left: 10.0, top: 10.0), + left: 10.0, + top: 10.0), child: Column( children: [ Text("Drive-Thru", @@ -127,7 +130,8 @@ class _HomePageState extends State { 0.15, height: 25.0, child: RaisedButton( - color: Colors.red[800], + color: Colors + .red[800], textColor: Colors.white, disabledTextColor: @@ -136,11 +140,10 @@ class _HomePageState extends State { new Color( 0xFFbcc2c4), onPressed: () { -// if (_isButtonDisabled == false) { -// _searchDoctor(context); -// } + navigateToCovidDriveThru(); }, - child: Text("BOOK NOW", + child: Text( + "BOOK NOW", style: TextStyle( fontSize: 12.0)), @@ -170,8 +173,9 @@ class _HomePageState extends State { borderRadius: BorderRadius.all( Radius.circular(5))), child: SvgPicture.asset( - projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' : - 'assets/images/new-design/liveCare_white_logo.svg', + projectViewModel.isArabic + ? 'assets/images/new-design/livecare_arabic_logo.svg' + : 'assets/images/new-design/liveCare_white_logo.svg', ), ), ), @@ -742,6 +746,11 @@ class _HomePageState extends State { ), ); } + + navigateToCovidDriveThru() { + Navigator.push(context, + MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); + } } class DashboardItem extends StatelessWidget { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 542ea3e2..24d81bdf 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -28,7 +28,6 @@ class DoctorsListService extends BaseService { Future getDoctorsList( int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId}) async { - //Utils.showProgressDialog(context); Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { diff --git a/lib/services/covid-drivethru/covid-drivethru.dart b/lib/services/covid-drivethru/covid-drivethru.dart new file mode 100644 index 00000000..a9ebbecd --- /dev/null +++ b/lib/services/covid-drivethru/covid-drivethru.dart @@ -0,0 +1,52 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/material.dart'; + +class CovidDriveThruService extends BaseService { + AppSharedPreferences sharedPref = AppSharedPreferences(); + AppGlobal appGlobal = new AppGlobal(); + + AuthenticatedUser authUser = new AuthenticatedUser(); + AuthProvider authProvider = new AuthProvider(); + + Future getCovidProjectsList(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_PROJECT_LIST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } +} diff --git a/lib/widgets/others/arrow_back.dart b/lib/widgets/others/arrow_back.dart index 498554fd..619f4f41 100644 --- a/lib/widgets/others/arrow_back.dart +++ b/lib/widgets/others/arrow_back.dart @@ -18,9 +18,9 @@ class ArrowBack extends StatelessWidget { }, context), child: Icon( projectViewModel.isArabic - ? Icons.arrow_back_ios - : Icons.arrow_forward_ios, - color: Theme.of(context).primaryColor), + ? Icons.arrow_forward_ios + : Icons.arrow_back_ios, + color: Colors.white), ); } } From f543126152217317eb318fad4e2ca03487940b47 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 1 Oct 2020 09:26:26 +0300 Subject: [PATCH 21/65] Ambulance Service --- assets/images/covid-car.png | Bin 0 -> 3140 bytes assets/images/covid_bg_transparent.png | Bin 0 -> 11952 bytes assets/images/home_health_care_icon.png | Bin 0 -> 4679 bytes lib/config/config.dart | 4 +- lib/core/model/er/PatientAllPresOrders.dart | 132 ++++++++++++++++++ lib/core/service/er/am_service.dart | 26 +++- .../viewModels/er/am_request_view_model.dart | 45 ++++-- lib/pages/ErService/AmbulanceReq.dart | 15 +- .../ErService/AmbulanceRequestIndex.dart | 59 ++++++++ lib/pages/ErService/BillAmount.dart | 37 +++++ lib/pages/ErService/PickupLocation.dart | 36 +++++ .../ErService/SelectTransportationMethod.dart | 39 ++++++ lib/pages/ErService/Summary.dart | 37 +++++ .../ErService/widgets/StepesWideget.dart | 114 +++++++++++++++ lib/pages/landing/home_page.dart | 77 ++++++++-- 15 files changed, 577 insertions(+), 44 deletions(-) create mode 100644 assets/images/covid-car.png create mode 100644 assets/images/covid_bg_transparent.png create mode 100644 assets/images/home_health_care_icon.png create mode 100644 lib/core/model/er/PatientAllPresOrders.dart create mode 100644 lib/pages/ErService/AmbulanceRequestIndex.dart create mode 100644 lib/pages/ErService/BillAmount.dart create mode 100644 lib/pages/ErService/PickupLocation.dart create mode 100644 lib/pages/ErService/SelectTransportationMethod.dart create mode 100644 lib/pages/ErService/Summary.dart create mode 100644 lib/pages/ErService/widgets/StepesWideget.dart diff --git a/assets/images/covid-car.png b/assets/images/covid-car.png new file mode 100644 index 0000000000000000000000000000000000000000..01090b744bda40c3e6ae3d0b4d9c1f631099bdc3 GIT binary patch literal 3140 zcmV-K47>A*P){hY5kj{0_78lgk?J%;l2XGxVc`cEO39xvr-em^ixVV<7mK#weTJ?rY*o1} zA<59S1-xOqDUfYxzX%^MvJ`B__}uz%tIBMZ#J}%4>xteHFk}|3Uj}k%#w445w_9|Mg%i z%4-El51p|s93?Fo8Cr(j;L{RT8M?Nj*=07BBscW)rQJ;R4Vtwx_96+hXih)W>}E7u zlbqpTUvUiYDCD5vpl$IcZ8CIiUNh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eb8;e&2LFZ{AvtGOkPSXl;%& zH6DC2Y8>VG=|-uA1mwf3$2VO?;!IxXiZxX&uG$`oHBryX$~ttQvUFmjqlog(aEO6{ z!ELI}J9mWyBMHT$&_#jn>D86^(&H?4A4fGfhKv19rxWJh$E&5Gzq}uY&pI zX2cZu@lOWNOqZCj0wM5Vc5hqSQHQ8jXwB*uIfZm9Qs0YR4(ARuWFs$J*mPs2yfPx~ z_}(Yg5<(XcumZ7eR&%J*)%q7HL&MX8vF?`OV{`~44Nqk9`G_dDBSW} zotY&S9rZHwxVRCMUnNNs4L+i>BIR~!he?y`jH2)Uc%4PiP=h+nxqJn}{%A(5QkLh^m$Ng~y@tL)a zjj>tYu0E zmfzA*@k*8C5#KEe#nNM9mWXa6Y)_l>fqlp0S_J}u>QKnS3aCPQtntl0=c~ptt#xz? zI json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = json['CreatedOn']; + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index 181ad37b..016cc2df 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -1,25 +1,39 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import '../base_service.dart'; class AmService extends BaseService { - List AmModelList = List(); - Map body = Map(); + List amModelList = List(); + List patientAllPresOrdersList = List(); Future getAllTransportationOrders() async { hasError = false; - await baseAppClient.post(GET_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) { - AmModelList.clear(); + amModelList.clear(); response['AmModelList'].forEach((vital) { - AmModelList.add( + amModelList.add( PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: body); + }, body: Map()); + } + + Future getPatientAllPresOrdersList() async { + hasError = false; + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, + onSuccess: (dynamic response, int statusCode) { + patientAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((vital) { + patientAllPresOrdersList.add(PatientAllPresOrders.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); } } diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index db1acbf0..6e08d984 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -1,32 +1,49 @@ - import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; +import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../base_view_model.dart'; import '../../../locator.dart'; -class AmRequestViewModel extends BaseViewModel{ +class AmRequestViewModel extends BaseViewModel { + AmService _amService = locator(); + HospitalService _hospitalService = locator(); + List + get amRequestModeList => _amService.amModelList; - AmService _amService = locator(); + List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; - List get AmRequestModeList=> - _amService.AmModelList; - getAmRequestOrders({int id, int projectID}) async { + Future getAmRequestOrders() async { setState(ViewState.Busy); + await _amService.getAllTransportationOrders(); + if (_amService.hasError) { + error = _amService.error; + setState(ViewState.Error); + } else + getHospitals(); + } + Future getHospitals() async { + setState(ViewState.Busy); + await _hospitalService.getHospitals(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else + getPatientAllPresOrdersList(); + } - await _amService.getAllTransportationOrders(); - - if ( _amService.hasError) { - error = _amService.error; + Future getPatientAllPresOrdersList()async{ + setState(ViewState.Busy); + await _amService.getPatientAllPresOrdersList(); + if (_hospitalService.hasError) { + error = _hospitalService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } - - - -} \ No newline at end of file +} diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 9c4dfa29..8e9f54bc 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; @@ -9,6 +10,8 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'AmbulanceRequestIndex.dart'; + class AmbulanceReq extends StatefulWidget { @override _AmbulanceReqState createState() => _AmbulanceReqState(); @@ -30,8 +33,8 @@ class _AmbulanceReqState extends State } @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getPrescriptions(), + return BaseView( + // onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: "Ambulance Request", @@ -106,12 +109,8 @@ class _AmbulanceReqState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PrescriptionsPage( - prescriptionsViewModel: model, - ), - PrescriptionsHistoryPage( - prescriptionsViewModel: model, - ) + AmbulanceRequestIndex(), + Container() ], ), ) diff --git a/lib/pages/ErService/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndex.dart new file mode 100644 index 00000000..863d3b57 --- /dev/null +++ b/lib/pages/ErService/AmbulanceRequestIndex.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/pages/ErService/widgets/StepesWideget.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +import 'BillAmount.dart'; +import 'PickupLocation.dart'; +import 'SelectTransportationMethod.dart'; +import 'Summary.dart'; + +class AmbulanceRequestIndex extends StatefulWidget { + @override + _AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); +} + +class _AmbulanceRequestIndexState extends State { + + int currentIndex = 0; + PageController pageController; + + _changeCurrentTab(int tab) { + setState(() { + currentIndex = tab; + }); + pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + } + + @override + void initState() { + super.initState(); + pageController = new PageController(); + + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + body: Column( + children: [ + SizedBox(height: 80,), + Container( + margin: EdgeInsets.only(left: 12,right: 12), + child: StepesWidget(index: currentIndex,changeCurrentTab: _changeCurrentTab,)), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: pageController, + children: [ + SelectTransportationMethod(changeCurrentTab: _changeCurrentTab,), + PickupLocation(changeCurrentTab: _changeCurrentTab,), + BillAmount(changeCurrentTab: _changeCurrentTab,), + Summary(changeCurrentTab: _changeCurrentTab,), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/BillAmount.dart new file mode 100644 index 00000000..86b0d181 --- /dev/null +++ b/lib/pages/ErService/BillAmount.dart @@ -0,0 +1,37 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class BillAmount extends StatefulWidget { + final Function changeCurrentTab; + + BillAmount({Key key, this.changeCurrentTab}); + + @override + _BillAmountState createState() => _BillAmountState(); +} + +class _BillAmountState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('BillAmount 3'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: ()=> widget.changeCurrentTab(3), + label: 'Next', + + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart new file mode 100644 index 00000000..bdb1ea52 --- /dev/null +++ b/lib/pages/ErService/PickupLocation.dart @@ -0,0 +1,36 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PickupLocation extends StatefulWidget { + final Function changeCurrentTab; + + PickupLocation({Key key, this.changeCurrentTab}); + + @override + _PickupLocationState createState() => _PickupLocationState(); +} + +class _PickupLocationState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('PickupLocation 2'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: ()=> widget.changeCurrentTab(2), + label: 'Next', + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart new file mode 100644 index 00000000..a5fcbb75 --- /dev/null +++ b/lib/pages/ErService/SelectTransportationMethod.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectTransportationMethod extends StatefulWidget { + final Function changeCurrentTab; + + SelectTransportationMethod({Key key, this.changeCurrentTab}); + + @override + _SelectTransportationMethodState createState() => + _SelectTransportationMethodState(); +} + +class _SelectTransportationMethodState + extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('SelectTransportationMethod 1'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: ()=> widget.changeCurrentTab(1), + label: 'Next', + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/Summary.dart new file mode 100644 index 00000000..4f792b68 --- /dev/null +++ b/lib/pages/ErService/Summary.dart @@ -0,0 +1,37 @@ +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class Summary extends StatefulWidget { + final Function changeCurrentTab; + + Summary({Key key, this.changeCurrentTab}); + + @override + _SummaryState createState() => _SummaryState(); +} + +class _SummaryState extends State

{ + @override + Widget build(BuildContext context) { + return Column( + children: [ + Texts('Summary 4'), + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + label: 'Next', + + // onTap: ()=> widget.changeCurrentTab(2), + ), + ) + ], + ); + } +} diff --git a/lib/pages/ErService/widgets/StepesWideget.dart b/lib/pages/ErService/widgets/StepesWideget.dart new file mode 100644 index 00000000..3f6b57a4 --- /dev/null +++ b/lib/pages/ErService/widgets/StepesWideget.dart @@ -0,0 +1,114 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class StepesWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + + StepesWidget({Key key, this.index, this.changeCurrentTab}); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.black, + height: 3, + thickness: 3, + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white:Colors.grey[800] , + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width *0.3, + child: InkWell( + onTap: () => changeCurrentTab(1), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1 ? Colors.white:Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: MediaQuery.of(context).size.width *0.6, + child: InkWell( + onTap: () => changeCurrentTab(2), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 2 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2 ? Colors.white: Colors.grey[800] , + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(3), + child: Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: index == 3 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '4', + color: index == 3 ? Colors.white:Colors.grey[800] , + ), + ), + ), + ), + ), + ], + ); + } +} diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 59c0a167..b811ef8f 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -64,6 +64,68 @@ class _HomePageState extends State { MediaQuery.of(context).size.width * 0.8, child: Row( children: [ + Expanded( + child: Container( + height: 110, + // padding: EdgeInsets.all(15), + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: + Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/covid_bg_transparent.png'), + fit: BoxFit.cover), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: 8,), + Texts('COVID-19 TEST',color: Colors.white,), + SizedBox(height: 15,), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Image.asset( + 'assets/images/covid-car.png',width: 55,height: 55,fit: BoxFit.cover, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts('Drove-Thru',color: Colors.white,fontSize: 14,), + SizedBox(height: 4,), + Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: Hexcolor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5)), + ), + child: Center( + child: Texts('BOOK Now', + color: Colors.white, + fontSize: 12, + ), + ), + ) + ], + ) + ], + ) + ], + ) + ), + ), Expanded( child: InkWell( onTap: () => Navigator.push(context, @@ -83,19 +145,6 @@ class _HomePageState extends State { ), ), ), - Expanded( - child: Container( - height: 110, - padding: EdgeInsets.all(15), - margin: EdgeInsets.all(5), - decoration: BoxDecoration( - color: - Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all( - Radius.circular(5))), - // child: Image.asset('assets/images/livecare_white_logo.png',), - ), - ), ], ), ), @@ -359,7 +408,7 @@ class _HomePageState extends State { child: Column( children: [ Image.asset( - 'assets/images/Dr_Schedule_report.png', + 'assets/images/home_health_care_icon.png', width: 50, height: 50, ), From c7d396875e13240b960309d6f02d8f70d834de4d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 4 Oct 2020 10:06:01 +0300 Subject: [PATCH 22/65] Ambulance Service steps --- lib/core/model/er/PatientER.dart | 200 +++++++++++++ ..._all_transportation_method_list_model.dart | 10 +- lib/core/service/er/am_service.dart | 7 +- .../viewModels/er/am_request_view_model.dart | 2 +- lib/pages/ErService/AmbulanceReq.dart | 5 +- .../ErService/AmbulanceRequestIndex.dart | 49 +++- lib/pages/ErService/BillAmount.dart | 6 +- lib/pages/ErService/PickupLocation.dart | 7 +- .../ErService/SelectTransportationMethod.dart | 272 ++++++++++++++++-- lib/pages/ErService/Summary.dart | 6 +- .../{StepesWideget.dart => StepsWidget.dart} | 55 ++-- 11 files changed, 552 insertions(+), 67 deletions(-) create mode 100644 lib/core/model/er/PatientER.dart rename lib/pages/ErService/widgets/{StepesWideget.dart => StepsWidget.dart} (55%) diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart new file mode 100644 index 00000000..9c2d660e --- /dev/null +++ b/lib/core/model/er/PatientER.dart @@ -0,0 +1,200 @@ +class PatientER { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int orderServiceID; + String patientIdentificationID; + int direction; + bool haveAppointment; + int tripType; + int pickupUrgency; + int pickupSpot; + String pickupDateTime; + int transportationMethodId; + int selectedAmbulate; + String requesterNote; + int requesterFileNo; + String requesterMobileNo; + bool requesterIsOutSA; + int isOutPatient; + String pickupLocationName; + String dropoffLocationName; + int projectID; + int createdBy; + int lineItemNo; + int cost; + double vAT; + double totalPrice; + String pickupLocationLattitude; + String pickupLocationLongitude; + String dropoffLocationLattitude; + String dropoffLocationLongitude; + String latitude; + String longitude; + String appointmentNo; + dynamic appointmentClinicName; + dynamic appointmentDoctorName; + dynamic appointmentBranch; + dynamic appointmentTime; + + PatientER( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.orderServiceID = 4, + this.patientIdentificationID, + this.direction, + this.haveAppointment, + this.tripType, + this.pickupUrgency, + this.pickupSpot, + this.pickupDateTime, + this.transportationMethodId, + this.selectedAmbulate, + this.requesterNote, + this.requesterFileNo, + this.requesterMobileNo, + this.requesterIsOutSA, + this.isOutPatient, + this.pickupLocationName, + this.dropoffLocationName, + this.projectID, + this.createdBy, + this.lineItemNo, + this.cost, + this.vAT, + this.totalPrice, + this.pickupLocationLattitude, + this.pickupLocationLongitude, + this.dropoffLocationLattitude, + this.dropoffLocationLongitude, + this.latitude, + this.longitude, + this.appointmentNo, + this.appointmentClinicName, + this.appointmentDoctorName, + this.appointmentBranch, + this.appointmentTime}); + + PatientER.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + orderServiceID = json['OrderServiceID']; + patientIdentificationID = json['PatientIdentificationID']; + direction = json['Direction']; + haveAppointment = json['HaveAppointment']; + tripType = json['TripType']; + pickupUrgency = json['PickupUrgency']; + pickupSpot = json['PickupSpot']; + pickupDateTime = json['PickupDateTime']; + transportationMethodId = json['TransportationMethodId']; + selectedAmbulate = json['SelectedAmbulate']; + requesterNote = json['RequesterNote']; + requesterFileNo = json['RequesterFileNo']; + requesterMobileNo = json['RequesterMobileNo']; + requesterIsOutSA = json['RequesterIsOutSA']; + isOutPatient = json['IsOutPatient']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + projectID = json['ProjectID']; + createdBy = json['CreatedBy']; + lineItemNo = json['LineItemNo']; + cost = json['Cost']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + pickupLocationLattitude = json['PickupLocationLattitude']; + pickupLocationLongitude = json['PickupLocationLongitude']; + dropoffLocationLattitude = json['DropoffLocationLattitude']; + dropoffLocationLongitude = json['DropoffLocationLongitude']; + latitude = json['Latitude']; + longitude = json['Longitude']; + appointmentNo = json['AppointmentNo']; + appointmentClinicName = json['AppointmentClinicName']; + appointmentDoctorName = json['AppointmentDoctorName']; + appointmentBranch = json['AppointmentBranch']; + appointmentTime = json['AppointmentTime']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['OrderServiceID'] = this.orderServiceID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['Direction'] = this.direction; + data['HaveAppointment'] = this.haveAppointment; + data['TripType'] = this.tripType; + data['PickupUrgency'] = this.pickupUrgency; + data['PickupSpot'] = this.pickupSpot; + data['PickupDateTime'] = this.pickupDateTime; + data['TransportationMethodId'] = this.transportationMethodId; + data['SelectedAmbulate'] = this.selectedAmbulate; + data['RequesterNote'] = this.requesterNote; + data['RequesterFileNo'] = this.requesterFileNo; + data['RequesterMobileNo'] = this.requesterMobileNo; + data['RequesterIsOutSA'] = this.requesterIsOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['ProjectID'] = this.projectID; + data['CreatedBy'] = this.createdBy; + data['LineItemNo'] = this.lineItemNo; + data['Cost'] = this.cost; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + data['PickupLocationLattitude'] = this.pickupLocationLattitude; + data['PickupLocationLongitude'] = this.pickupLocationLongitude; + data['DropoffLocationLattitude'] = this.dropoffLocationLattitude; + data['DropoffLocationLongitude'] = this.dropoffLocationLongitude; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentClinicName'] = this.appointmentClinicName; + data['AppointmentDoctorName'] = this.appointmentDoctorName; + data['AppointmentBranch'] = this.appointmentBranch; + data['AppointmentTime'] = this.appointmentTime; + return data; + } +} diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart index 3402873e..b149e296 100644 --- a/lib/core/model/er/get_all_transportation_method_list_model.dart +++ b/lib/core/model/er/get_all_transportation_method_list_model.dart @@ -1,5 +1,5 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -class PatientER_RRT_GetAllTransportationMethodListModel { +class PatientERTransportationMethod { int id; DateTime createDate; DateTime lastEditDate; @@ -9,15 +9,15 @@ class PatientER_RRT_GetAllTransportationMethodListModel { String title; String titleAR; int price; - Null isDefault; + dynamic isDefault; int visibility; - Null durationId; + dynamic durationId; String description; String descriptionAR; int totalPrice; int vAT; - PatientER_RRT_GetAllTransportationMethodListModel( + PatientERTransportationMethod( { this.id, this.createDate, @@ -36,7 +36,7 @@ class PatientER_RRT_GetAllTransportationMethodListModel { this.totalPrice, this.vAT}); - PatientER_RRT_GetAllTransportationMethodListModel.fromJson( + PatientERTransportationMethod.fromJson( Map json) { id = json['Id']; createDate = DateUtil.convertStringToDate(json['CreateDate']); diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index 016cc2df..6c9704ae 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -5,17 +5,20 @@ import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method import '../base_service.dart'; class AmService extends BaseService { - List amModelList = List(); + List amModelList = List(); List patientAllPresOrdersList = List(); Future getAllTransportationOrders() async { hasError = false; + Map body = Map(); + body['isDentalAllowedBackend']= false; + body['IdentificationNo'] = user.patientIdentificationNo; await baseAppClient.post(GET_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) { amModelList.clear(); response['AmModelList'].forEach((vital) { amModelList.add( - PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital)); + PatientERTransportationMethod.fromJson(vital)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index 6e08d984..9045ee90 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -11,7 +11,7 @@ class AmRequestViewModel extends BaseViewModel { AmService _amService = locator(); HospitalService _hospitalService = locator(); - List + List get amRequestModeList => _amService.amModelList; List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 8e9f54bc..c50093be 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -34,10 +34,11 @@ class _AmbulanceReqState extends State @override Widget build(BuildContext context) { return BaseView( - // onModelReady: (model) => model.getAmRequestOrders(), + onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: "Ambulance Request", + baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -109,7 +110,7 @@ class _AmbulanceReqState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - AmbulanceRequestIndex(), + AmbulanceRequestIndex(amRequestViewModel: model,), Container() ], ), diff --git a/lib/pages/ErService/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndex.dart index 863d3b57..46d803cd 100644 --- a/lib/pages/ErService/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndex.dart @@ -1,4 +1,6 @@ -import 'package:diplomaticquarterapp/pages/ErService/widgets/StepesWideget.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -8,27 +10,31 @@ import 'SelectTransportationMethod.dart'; import 'Summary.dart'; class AmbulanceRequestIndex extends StatefulWidget { + final AmRequestViewModel amRequestViewModel; + + AmbulanceRequestIndex({Key key, this.amRequestViewModel}); + @override _AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); } class _AmbulanceRequestIndexState extends State { - int currentIndex = 0; PageController pageController; + PatientER _patientER = PatientER(); _changeCurrentTab(int tab) { setState(() { currentIndex = tab; }); - pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + pageController.animateToPage(tab, + duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); } @override void initState() { super.initState(); pageController = new PageController(); - } @override @@ -36,19 +42,40 @@ class _AmbulanceRequestIndexState extends State { return AppScaffold( body: Column( children: [ - SizedBox(height: 80,), + SizedBox( + height: 80, + ), Container( - margin: EdgeInsets.only(left: 12,right: 12), - child: StepesWidget(index: currentIndex,changeCurrentTab: _changeCurrentTab,)), + margin: EdgeInsets.only(left: 12, right: 12), + child: StepsWidget( + index: currentIndex, + changeCurrentTab: _changeCurrentTab, + )), Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - SelectTransportationMethod(changeCurrentTab: _changeCurrentTab,), - PickupLocation(changeCurrentTab: _changeCurrentTab,), - BillAmount(changeCurrentTab: _changeCurrentTab,), - Summary(changeCurrentTab: _changeCurrentTab,), + SelectTransportationMethod( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + PickupLocation( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + BillAmount( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + Summary( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), ], ), ), diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/BillAmount.dart index 86b0d181..3dca195f 100644 --- a/lib/pages/ErService/BillAmount.dart +++ b/lib/pages/ErService/BillAmount.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,8 +7,10 @@ import 'package:flutter/material.dart'; class BillAmount extends StatefulWidget { final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; - BillAmount({Key key, this.changeCurrentTab}); + BillAmount({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); @override _BillAmountState createState() => _BillAmountState(); diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart index bdb1ea52..2b44d4cb 100644 --- a/lib/pages/ErService/PickupLocation.dart +++ b/lib/pages/ErService/PickupLocation.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,8 +7,9 @@ import 'package:flutter/material.dart'; class PickupLocation extends StatefulWidget { final Function changeCurrentTab; - - PickupLocation({Key key, this.changeCurrentTab}); + final PatientER patientER; + PickupLocation({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); + final AmRequestViewModel amRequestViewModel; @override _PickupLocationState createState() => _PickupLocationState(); diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart index a5fcbb75..d8148b3c 100644 --- a/lib/pages/ErService/SelectTransportationMethod.dart +++ b/lib/pages/ErService/SelectTransportationMethod.dart @@ -1,13 +1,24 @@ -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +enum Direction { ToHospital, FromHospital } +enum Way { OneWay, TwoWays } + class SelectTransportationMethod extends StatefulWidget { final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; - SelectTransportationMethod({Key key, this.changeCurrentTab}); + SelectTransportationMethod( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); @override _SelectTransportationMethodState createState() => @@ -16,24 +27,251 @@ class SelectTransportationMethod extends StatefulWidget { class _SelectTransportationMethodState extends State { + PatientERTransportationMethod _erTransportationMethod = + PatientERTransportationMethod(); + Direction _direction = Direction.FromHospital; + Way _way = Way.OneWay; + @override Widget build(BuildContext context) { - return Column( - children: [ - Texts('SelectTransportationMethod 1'), - SizedBox(height: 45,), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: ()=> widget.changeCurrentTab(1), - label: 'Next', + return Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts('Select Transportation Method'), + ...List.generate( + widget.amRequestViewModel.amRequestModeList.length, + (index) => InkWell( + onTap: () { + setState(() { + _erTransportationMethod = + widget.amRequestViewModel.amRequestModeList[index]; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + flex: 3, + child: ListTile( + title: Text(widget + .amRequestViewModel.amRequestModeList[index].title), + leading: Radio( + value: widget + .amRequestViewModel.amRequestModeList[index], + groupValue: _erTransportationMethod, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _erTransportationMethod = value; + }); + }, + ), + ), + ), + Expanded( + flex: 1, + child: Texts( + 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), + ) + ], + ), + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.ToHospital; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('To Hospital'), + leading: Radio( + value: Direction.ToHospital, + groupValue: _direction, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.FromHospital; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('To Hospital'), + leading: Radio( + value: Direction.FromHospital, + groupValue: _direction, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + ], + ), + if (_direction == Direction.ToHospital) + Column( + children: [ + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.OneWay; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('One Way'), + leading: Radio( + value: Way.OneWay, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.TwoWays; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('Two Ways'), + leading: Radio( + value: Way.TwoWays, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 15, ), - ) - ], + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 2; + widget.patientER.tripType = _way == Way.TwoWays ? 1 : 2; + widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod)+1); + widget.changeCurrentTab(1); + }); + }, + label: 'Next', + ), + ) + ], + ), ); } } diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/Summary.dart index 4f792b68..13beee8c 100644 --- a/lib/pages/ErService/Summary.dart +++ b/lib/pages/ErService/Summary.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,8 +7,10 @@ import 'package:flutter/material.dart'; class Summary extends StatefulWidget { final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; - Summary({Key key, this.changeCurrentTab}); + Summary({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); @override _SummaryState createState() => _SummaryState(); diff --git a/lib/pages/ErService/widgets/StepesWideget.dart b/lib/pages/ErService/widgets/StepsWidget.dart similarity index 55% rename from lib/pages/ErService/widgets/StepesWideget.dart rename to lib/pages/ErService/widgets/StepsWidget.dart index 3f6b57a4..1e4077cb 100644 --- a/lib/pages/ErService/widgets/StepesWideget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -2,11 +2,11 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class StepesWidget extends StatelessWidget { +class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; - StepesWidget({Key key, this.index, this.changeCurrentTab}); + StepsWidget({Key key, this.index, this.changeCurrentTab}); @override Widget build(BuildContext context) { @@ -18,9 +18,9 @@ class StepesWidget extends StatelessWidget { color: Colors.transparent, child: Center( child: Divider( - color: Colors.black, - height: 3, - thickness: 3, + color: Colors.grey, + height: 0.75, + thickness: 0.75, ), ), ), @@ -30,16 +30,17 @@ class StepesWidget extends StatelessWidget { child: InkWell( onTap: () => changeCurrentTab(0), child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), shape: BoxShape.circle, - color: index == 0 ? Colors.grey[800] : Colors.white, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, ), child: Center( child: Texts( '1', - color: index == 0 ? Colors.white:Colors.grey[800] , + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], ), ), ), @@ -47,20 +48,21 @@ class StepesWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery.of(context).size.width *0.3, + left: MediaQuery.of(context).size.width * 0.3, child: InkWell( - onTap: () => changeCurrentTab(1), + onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), shape: BoxShape.circle, - color: index == 1 ? Colors.grey[800] : Colors.white, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, ), child: Center( child: Texts( '2', - color: index == 1 ? Colors.white:Colors.grey[800], + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], ), ), ), @@ -68,20 +70,21 @@ class StepesWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery.of(context).size.width *0.6, + left: MediaQuery.of(context).size.width * 0.6, child: InkWell( - onTap: () => changeCurrentTab(2), + onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( shape: BoxShape.circle, - color: index == 2 ? Colors.grey[800] : Colors.white, + border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, ), child: Center( child: Texts( '3', - color: index == 2 ? Colors.white: Colors.grey[800] , + color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800], ), ), ), @@ -91,18 +94,20 @@ class StepesWidget extends StatelessWidget { top: 10, right: 0, child: InkWell( - onTap: () => changeCurrentTab(3), + onTap: () => index == 2 ?changeCurrentTab(3):null, child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( + border: Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, color: index == 3 ? Colors.grey[800] : Colors.white, ), child: Center( child: Texts( '4', - color: index == 3 ? Colors.white:Colors.grey[800] , + color: index == 3 ? Colors.white : Colors.grey[800], ), ), ), From 98947d5f6b6525da5815946a22e7c4e06b93e8cf Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 4 Oct 2020 10:06:48 +0300 Subject: [PATCH 23/65] Blood Denote --- .../AlHabibMedicalService/all_habib_medical_service_page.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 8b04bc31..e0f07385 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/Blood/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/family/my-family.dart'; @@ -188,7 +189,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage(page: ChildVaccinesPage()), ), imageLocation: 'assets/images/new-design/children_vaccines_icon.png', From 20ef255ee6bf0834f93ac62b398992c2bd920a6f Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 4 Oct 2020 10:22:12 +0300 Subject: [PATCH 24/65] Blood Denote --- lib/core/viewModels/base_view_model.dart | 2 +- lib/pages/ChildVaccines/child_vaccines_page.dart | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 lib/pages/ChildVaccines/child_vaccines_page.dart diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 3d7122bd..d19905f7 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; -class BaseViewModel extends ChangeNotifier { +class BaseViewModel extends ChangeNotifier { ViewState _state = ViewState.Idle; bool isInternetConnection = true; bool isLogin = false; diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart new file mode 100644 index 00000000..07031ceb --- /dev/null +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -0,0 +1,15 @@ + +import 'package:flutter/cupertino.dart'; + +class ChildVaccinesPage extends StatefulWidget { + @override + _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); +} + +class _ChildVaccinesPageState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} + From 5c859034d610a6b87c69e682bcd9d9ad04640009 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 4 Oct 2020 12:58:43 +0300 Subject: [PATCH 25/65] voice search --- assets/images/CloseIcon.png | Bin 0 -> 1285 bytes assets/images/book.svg | 1 + assets/images/robort_svg.svg | 82 ++++++++++++++++ assets/images/symptom.svg | 30 ++++++ .../all_habib_medical_service_page.dart | 6 +- lib/pages/BookAppointment/DoctorProfile.dart | 20 ++-- lib/pages/BookAppointment/SearchResults.dart | 16 +-- .../components/SearchByClinic.dart | 2 +- lib/pages/landing/landing_page.dart | 21 +++- lib/pages/symptom-checker/symtom-checker.dart | 43 ++++++++ lib/routes.dart | 5 +- lib/widgets/others/app_scaffold_widget.dart | 76 ++++++++------- .../others/floating_button_search.dart | 92 ++++++++++++++++-- lib/widgets/robo-search/search.dart | 24 ++--- pubspec.yaml | 4 +- 15 files changed, 342 insertions(+), 80 deletions(-) create mode 100644 assets/images/CloseIcon.png create mode 100644 assets/images/book.svg create mode 100644 assets/images/robort_svg.svg create mode 100644 assets/images/symptom.svg create mode 100644 lib/pages/symptom-checker/symtom-checker.dart diff --git a/assets/images/CloseIcon.png b/assets/images/CloseIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..b8e68fea9bd77bfc622d9fc0036ea59eb7f2742e GIT binary patch literal 1285 zcm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assets/images/robort_svg.svg b/assets/images/robort_svg.svg new file mode 100644 index 00000000..07d3d4b4 --- /dev/null +++ b/assets/images/robort_svg.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/symptom.svg b/assets/images/symptom.svg new file mode 100644 index 00000000..aa670da1 --- /dev/null +++ b/assets/images/symptom.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 616b5fd8..24df0bf6 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dar import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -199,9 +200,8 @@ class _AllHabibMedicalServiceState extends State { title: TranslationBase.of(context).todoList, ), ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(), + onTap: () => Navigator.of(context).pushNamed( + SYMPTOM_CHECKER, ), imageLocation: 'assets/images/new-design/body_icon.png', title: 'Symptom Checker'), diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index d3b6fc7c..c51ce5a6 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -42,16 +42,16 @@ class _DoctorProfileState extends State vsync: this, initialIndex: widget.isOpenAppt == true ? 1 : 0); - event.controller.stream.listen((p) { - if (p['clinic_id'] != null && - p['doctor_id'] != null && - p['project_id'] != null) { - setState(() { - // need to take the data from here - // dropdownValue = p['clinic_id']; - }); - } - }); + // event.controller.stream.listen((p) { + // if (p['clinic_id'] != null && + // p['doctor_id'] != null && + // p['project_id'] != null) { + // setState(() { + // // need to take the data from here + // // dropdownValue = p['clinic_id']; + // }); + // } + // }); _tabController = new TabController(length: 2, vsync: this); widget.authUser = new AuthenticatedUser(); getPatientData(); diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 2b5fac17..e9767072 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -1,6 +1,6 @@ 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/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'; @@ -18,12 +18,12 @@ class SearchResults extends StatefulWidget { } class _SearchResultsState extends State { - var event = RobotProvider(); + // var event = RobotProvider(); List tempList = []; @override void initState() { - event.controller.stream.listen((p) {}); + // event.controller.stream.listen((p) {}); super.initState(); } @@ -41,9 +41,13 @@ class _SearchResultsState extends State { ...List.generate( widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( - title: widget - .patientDoctorAppointmentListHospital[index].filterName + " - " +widget - .patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, + title: widget.patientDoctorAppointmentListHospital[index] + .filterName + + " - " + + widget.patientDoctorAppointmentListHospital[index] + .distanceInKMs + + " " + + TranslationBase.of(context).km, bodyWidget: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index e844d4d1..9d833db1 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -26,7 +26,7 @@ class _SearchByClinicState extends State { bool nearestAppo = false; String dropdownValue; String projectDropdownValue; - var event = RobotProvider(); + // var event = RobotProvider(); List clinicsList = []; List projectsList = []; bool isMobileAppDentalAllow = false; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index ad8ae6a5..abe89a30 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -19,6 +20,7 @@ import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:permission_handler/permission_handler.dart'; import 'home_page.dart'; @@ -38,7 +40,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { ProjectViewModel projectProvider; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final authService = new AuthProvider(); - + var event = RobotProvider(); bool isPageNavigated = false; _changeCurrentTab(int tab) { @@ -280,6 +282,19 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); }, ), + actions: [ + IconButton( + iconSize: 50, + icon: SvgPicture.asset( + 'assets/images/robort_svg.svg', + height: 100, + width: 100, + ), + onPressed: () { + triggerRobot(); + } //do something, + ) + ], centerTitle: true, ), drawer: SafeArea(child: AppDrawer()), @@ -306,6 +321,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { ); } + triggerRobot() { + // event.setValue({"doctor_id": '40036'}); + } + getText(currentTab) { switch (currentTab) { case 0: diff --git a/lib/pages/symptom-checker/symtom-checker.dart b/lib/pages/symptom-checker/symtom-checker.dart new file mode 100644 index 00000000..f7475abf --- /dev/null +++ b/lib/pages/symptom-checker/symtom-checker.dart @@ -0,0 +1,43 @@ +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class SymptomChecker extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Symptom Checker', + body: Center( + child: SvgPicture.string( + ''' + + + + + + + + + + + + + + + + + + + + + + + + + + +'''))); + } +} diff --git a/lib/routes.dart b/lib/routes.dart index 27161669..8d109983 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/pages/login/login.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/family/add-family_type.dart'; import 'package:diplomaticquarterapp/pages/family/add-family-member.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/symtom-checker.dart'; const String INIT_ROUTE = '/'; const String HOME = '/'; @@ -25,6 +26,7 @@ const String MY_FAMILIY = 'my-family'; const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type'; const String ADD_FAMILY_MEMBER = 'add-family-member'; const String LIVE_CARE = 'live-care'; +const String SYMPTOM_CHECKER = 'symptom-checker'; var routes = { HOME: (_) => LandingPage(), WELCOME_LOGIN: (_) => WelcomeLogin(), @@ -37,5 +39,6 @@ var routes = { MY_FAMILIY: (_) => MyFamily(), ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(), ADD_FAMILY_MEMBER: (_) => AddMember(), - LIVE_CARE: (_) => LiveCareHome() + LIVE_CARE: (_) => LiveCareHome(), + SYMPTOM_CHECKER: (_) => SymptomChecker() }; diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index eda27361..0c9c12ed 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/search.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; @@ -41,44 +42,44 @@ class AppScaffold extends StatelessWidget { AppGlobal.context = context; return Scaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: Theme.of(context).appBarTheme.color, - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(appBarTitle.toUpperCase()), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: isShowAppBar + ? AppBar( + elevation: 0, + backgroundColor: Theme.of(context).appBarTheme.color, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text(appBarTitle.toUpperCase()), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + centerTitle: true, + actions: [ + IconButton( + icon: Icon(FontAwesomeIcons.home), + color: Colors.white, + onPressed: () { + Navigator.of(context).popUntil(ModalRoute.withName('/')); }, ), - centerTitle: true, - actions: [ - IconButton( - icon: Icon(FontAwesomeIcons.home), - color: Colors.white, - onPressed: () { - Navigator.of(context).popUntil(ModalRoute.withName('/')); - }, - ), - ], - ) - : null, - body: baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(), - bottomSheet: bottomSheet, - bottomNavigationBar: - this.isBottomBar == true ? BottomBarSearch() : SizedBox() - //floatingActionButton: FloatingSearchButton(), - ); + ], + ) + : null, + body: baseViewModel != null + ? NetworkBaseView( + child: buildBodyWidget(), + baseViewModel: baseViewModel, + ) + : buildBodyWidget(), + bottomSheet: bottomSheet, + // bottomNavigationBar: + // this.isBottomBar == true ? BottomBarSearch() : SizedBox() + // floatingActionButton: FloatingSearchButton(), + ); } buildAppLoaderWidget(bool isLoading) { @@ -86,6 +87,7 @@ class AppScaffold extends StatelessWidget { } buildBodyWidget() { - return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); + // return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); + return Stack(children: [body, FloatingSearchButton()]); } } diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 34b1240e..37a3e3c0 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -1,17 +1,93 @@ import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/search.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class FloatingSearchButton extends StatefulWidget { + @override + _FloatingSearchButton createState() => _FloatingSearchButton(); +} + +class _FloatingSearchButton extends State + with TickerProviderStateMixin { + Offset position = Offset(30.0, 40.0); + AlignmentDirectional _ironManAlignment = AlignmentDirectional(0.0, 0.7); + + @override + void initState() { + // TODO: implement initState + super.initState(); + } -class FloatingSearchButton extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(bottom: 80), - child: FloatingActionButton( - child: Icon(Icons.mic), - onPressed: () { - SearchBot(); - }, + return Positioned( + left: position.dx, + top: position.dy, + child: Draggable( + feedback: Container(child: getStack()), + child: Container( + child: AnimatedContainer( + duration: Duration(seconds: 2), + alignment: _ironManAlignment, + child: getStack(), + )), + childWhenDragging: Container( + color: Colors.transparent, + ), + onDragEnd: (details) { + setState(() { + position = details.offset; + }); + })); + + // Draggable( + // feedback: getStack(), + // childWhenDragging: Container(), + // child: getStack(), + // onDragEnd: (drag) { + // setState(() { + // top = top + drag.offset.dy < 0 ? 0 : top + drag.offset.dy; + // left = left + drag.offset.dx < 0 ? 0 : left + drag.offset.dx; + // }); + // }); + } + + Widget getStack() { + return Container( + height: 150, + width: 150, + child: Stack( + children: [ + Positioned( + top: 10, + right: 0, + child: GestureDetector( + onTap: () { + print("hi"); + setState(() { + _ironManAlignment = AlignmentDirectional(0.0, -0.20); + }); + }, // handle your image tap here + child: Image.asset( + 'assets/images/CloseIcon.png', + fit: BoxFit.cover, // this is the solution for border + width: 30.0, + height: 30.0, + )), + ), + GestureDetector( + onTap: () { + // animationController.forward(); + }, // handle your image tap here + child: SvgPicture.asset('assets/images/robort_svg.svg')) + // new RawMaterialButton( + // // shape: new CircleBorder(), + // elevation: 1.0, + // child: SvgPicture.asset('assets/images/robort_svg.svg'), + // onPressed: () {}, + // ), + ], )); } diff --git a/lib/widgets/robo-search/search.dart b/lib/widgets/robo-search/search.dart index b6426b6d..c1ce33d1 100644 --- a/lib/widgets/robo-search/search.dart +++ b/lib/widgets/robo-search/search.dart @@ -30,7 +30,7 @@ class SearchBot with ChangeNotifier { } SearchProvider searchProvider = new SearchProvider(); - RobotProvider eventProvider = RobotProvider(); + // RobotProvider eventProvider = RobotProvider(); bool isLoading = false; bool isError = false; final SpeechToText speech = SpeechToText(); @@ -203,19 +203,19 @@ class SearchBot with ChangeNotifier { type: 1, ))); break; - case '103': - eventProvider.setValue({"clinic_id": understand}); - break; - - case '104': - eventProvider.setValue({"project_id": understand}); - break; - case '105': - eventProvider.setValue({"doctor_id": understand}); - break; + // case '103': + // eventProvider.setValue({"clinic_id": understand}); + // break; + + // case '104': + // eventProvider.setValue({"project_id": understand}); + // break; + // case '105': + // eventProvider.setValue({"doctor_id": understand}); + // break; default: { - eventProvider.setValue({"doctor_id": '40036'}); + //eventProvider.setValue({"doctor_id": '40036'}); //eventProvider.setValue(); // if (result['CommandNumber'] == '0') { // searchProvider.setData(understand); diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..75d9b1fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -146,7 +146,9 @@ flutter: - assets/images/login/ - assets/json/ - assets/sounds/ - + - assets/images/symptom.svg + - assets/images/robort_svg.svg + fonts: - family: WorkSans From db19eec35f03ce48574fb3ba2e0788b21087452d Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 4 Oct 2020 13:12:31 +0300 Subject: [PATCH 26/65] Blood Denote --- .../ChildVaccines/child_vaccines_page.dart | 430 +++++++++++++++++- 1 file changed, 429 insertions(+), 1 deletion(-) diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 07031ceb..cec04f12 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,5 +1,13 @@ +import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; class ChildVaccinesPage extends StatefulWidget { @override @@ -7,9 +15,429 @@ class ChildVaccinesPage extends StatefulWidget { } class _ChildVaccinesPageState extends State { + TextEditingController titleController = TextEditingController(); + var checkedValue=false; + String addEmail=""; @override Widget build(BuildContext context) { - return Container(); + + return BaseView( + onModelReady: (model) => model.getCities(),//model.getHospitals(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + height: 20, + ), + + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + child: Texts("Welcome back",fontSize: 20,), + ) , + ), + Divider(color:Colors.black ,), + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), + ) , + ), + + Divider(color:Colors.black ,), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: model.user.emailAddress,//'Title', + controller: titleController, + fontSize: 20, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + onChanged: (text) { + addEmail=text; + model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; + // checkedValue=true; + // print("First text field: $text"); + // print("First text field:"+ model.user.emailAddress); + + }, + validator: (value) { + + if (value == null) + { + return model.user.emailAddress; + + } + else + + { + return model.user.emailAddress;} + }, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "UPDATE EMAIL", + // + onTap: (){ + model.user.emailAddress=model.user.emailAddress+addEmail.toString(); + AppToast.showSuccessToast( + message: "Email updated"); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: Color.fromRGBO(63, 72, 74, 1,), + label: " VIEW LIST OF CHILDREN", + // + onTap: (){ + + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + ), + // Texts( + // // TranslationBase.of(context).advancePaymentLabel, + // model.user.emailAddress, + // textAlign: TextAlign.center, + // ), + SizedBox( + height: 12, + ), + // InkWell( + // onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getHospitalName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + SizedBox( + height: 12, + ), + // InkWell( + // //======Gender======== + // onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // //Texts(getBeneficiaryType()), + // Texts(getGender()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // SizedBox( + // height: 12, + // ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // InkWell( + // onTap: () { + // model.getFamilyFiles().then((value) { + // confirmSelectFamilyDialog(model + // .getAllSharedRecordsByStatusResponse + // .getAllSharedRecordsByStatusList); + // }).showProgressBar( + // text: "Loading", + // backgroundColor: Colors.blue.withOpacity(0.6)); + // }, + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getFamilyMembersName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + SizedBox( + height: 12, + ), + // InkWell( + // //======Gender======== + // onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model), + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // //Texts(getBeneficiaryType()), + // Texts(getBlood()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // SizedBox( + // height: 12, + // ), + // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) + // InkWell( + // onTap: () { + // model.getFamilyFiles().then((value) { + // confirmSelectFamilyDialog(model + // .getAllSharedRecordsByStatusResponse + // .getAllSharedRecordsByStatusList); + // }).showProgressBar( + // text: "Loading", + // backgroundColor: Colors.blue.withOpacity(0.6)); + // }, + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getFamilyMembersName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + SizedBox( + height: 12, + ), + // Row( + // children: [ + // Container( + // child: Text(" To view the terms and conditions "), + // ), + // SizedBox( + // width: MediaQuery.of(context).size.height * 0.10, + // ), + // // InkWell( + // // onTap: () { + // // Navigator.of(context).push(MaterialPageRoute( + // // builder: (BuildContext context) => UserAgreementPage())); + // // }, + // // child: Container( + // // child: Texts(" Click here ",color: Colors.blue,), + // // ), + // // ) + // ], + // ), + SizedBox( + height: 12, + ), + // Row( + // children: [ + // Checkbox( + // onChanged: (bool value) { + // setState(() { + // checkedValue = value; + // }); + // }, + // // tristate: checkedValue==true,//i == 1, + // value: checkedValue, + // activeColor: Colors.red,//Color(0xFF6200EE), + // ), + // SizedBox(height: 10,), + // Row(children: [ + // + // ],), + // SizedBox( + // width: 10, + // ), + // Text( + // 'I agree to the terms and conditions ', + // style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), + // ), + // ], + // ), + // NewTextFields( + // hintText: TranslationBase.of(context).fileNumber, + // controller: _fileTextController, + // ), + // if (beneficiaryType == BeneficiaryType.OtherAccount) + // SizedBox( + // height: 12, + // ), + // if (beneficiaryType == BeneficiaryType.OtherAccount) + // InkWell( + // onTap: () { + // if (_fileTextController.text.isNotEmpty) + // model + // .getPatientInfoByPatientID( + // id: _fileTextController.text) + // .then((value) { + // confirmSelectPatientDialog(model.patientInfoList); + // }).showProgressBar( + // text: "Loading", + // backgroundColor: + // Colors.blue.withOpacity(0.6)); + // else + // AppToast.showErrorToast( + // message: 'Please Enter The File Number'); + // }, + // child: Container( + // padding: EdgeInsets.all(12), + // width: double.infinity, + // height: 65, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(12), + // color: Colors.white), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Texts(getPatientName()), + // Icon(Icons.arrow_drop_down) + // ], + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), + + // NewTextFields( + // hintText: TranslationBase.of(context).amount, + // keyboardType: TextInputType.number, + // onChanged: (value) { + // setState(() { + // amount = value; + // }); + // }, + // ), + // SizedBox( + // height: 12, + // ), + // NewTextFields( + // hintText: TranslationBase.of(context).depositorEmail, + // initialValue: model.user.emailAddress, + // onChanged: (value) { + // email = value; + // }, + // ), + // SizedBox( + // height: 12, + // ), + // NewTextFields( + // hintText: TranslationBase.of(context).notes, + // controller: _notesTextController, + // ), + SizedBox( + height: 10, + ), + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Center( + // child: Container( + // color: Colors.white, + // width: 350, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // builder: (_) => + // AssetGiffyDialog( + // title: Text( + // "", + // style: TextStyle( + // fontSize: 22.0, + // fontWeight: + // FontWeight + // .w600), + // ), + // image: Image.asset( + // 'assets/images/BloodChrt_EN.png'), + // buttonCancelText: + // Text('cancel'), + // buttonCancelColor: + // Colors.grey, + // onlyCancelButton: true, + // )); + // }, + // child: Container( + // width: 250, + // height: 200, + // child:Image.asset( + // 'assets/images/BloodChrt_EN.png')), + // ), + // ), + // ), + // ], + // ), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], + ), + + ), + ), + ); } } From 3d6eafe4731c72a7a24dd0ee32373aa308c8c97b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 4 Oct 2020 15:05:10 +0300 Subject: [PATCH 27/65] Ambulance Service first step --- ..._all_transportation_method_list_model.dart | 14 +- lib/core/service/er/am_service.dart | 7 +- .../ErService/AmbulanceRequestIndex.dart | 1 + lib/pages/ErService/PickupLocation.dart | 277 +++++++++++- .../ErService/SelectTransportationMethod.dart | 408 +++++++++--------- 5 files changed, 484 insertions(+), 223 deletions(-) diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart index b149e296..ebc9caf7 100644 --- a/lib/core/model/er/get_all_transportation_method_list_model.dart +++ b/lib/core/model/er/get_all_transportation_method_list_model.dart @@ -1,21 +1,21 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class PatientERTransportationMethod { - int id; + dynamic id; DateTime createDate; DateTime lastEditDate; - int createdBy; - int lastEditBy; + dynamic createdBy; + dynamic lastEditBy; bool isActive; String title; String titleAR; - int price; + dynamic price; dynamic isDefault; - int visibility; + dynamic visibility; dynamic durationId; String description; String descriptionAR; - int totalPrice; - int vAT; + dynamic totalPrice; + dynamic vAT; PatientERTransportationMethod( { diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index 6c9704ae..b6a91871 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -16,14 +16,13 @@ class AmService extends BaseService { await baseAppClient.post(GET_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) { amModelList.clear(); - response['AmModelList'].forEach((vital) { - amModelList.add( - PatientERTransportationMethod.fromJson(vital)); + response['PatientER_RRT_GetAllTransportationMethodList'].forEach((vital) { + amModelList.add(PatientERTransportationMethod.fromJson(vital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body: body); } Future getPatientAllPresOrdersList() async { diff --git a/lib/pages/ErService/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndex.dart index 46d803cd..16d07b88 100644 --- a/lib/pages/ErService/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndex.dart @@ -56,6 +56,7 @@ class _AmbulanceRequestIndexState extends State { physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ + //Container(), SelectTransportationMethod( changeCurrentTab: _changeCurrentTab, patientER: _patientER, diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart index 2b44d4cb..46a8928b 100644 --- a/lib/pages/ErService/PickupLocation.dart +++ b/lib/pages/ErService/PickupLocation.dart @@ -4,11 +4,20 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +enum HaveAppointment { YES, NO } class PickupLocation extends StatefulWidget { final Function changeCurrentTab; final PatientER patientER; - PickupLocation({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); + + PickupLocation( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); + final AmRequestViewModel amRequestViewModel; @override @@ -16,24 +25,258 @@ class PickupLocation extends StatefulWidget { } class _PickupLocationState extends State { + bool _isInsideHome = false; + HaveAppointment _haveAppointment = HaveAppointment.NO; + @override Widget build(BuildContext context) { - return Column( - children: [ - Texts('PickupLocation 2'), - SizedBox(height: 45,), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: ()=> widget.changeCurrentTab(2), - label: 'Next', - ), - ) - ], + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.patientER.direction == 1) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Pickup Location'), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Select From Map'), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], + ), + ), + SizedBox( + height: 12, + ), + Texts('Pickup Spot'), + SizedBox( + height: 5, + ), + InkWell( + onTap: () { + setState(() { + _isInsideHome = !_isInsideHome; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Texts('Inside Home'), + leading: Checkbox( + activeColor: Colors.red[800], + value: _isInsideHome, + onChanged: (value) { + setState(() { + _isInsideHome = value; + }); + }, + ), + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Do you have an appointment ?'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _haveAppointment = HaveAppointment.YES; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Yes'), + leading: Radio( + value: HaveAppointment.YES, + groupValue: _haveAppointment, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _haveAppointment = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _haveAppointment = HaveAppointment.NO; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('No'), + leading: Radio( + value: HaveAppointment.NO, + groupValue: _haveAppointment, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _haveAppointment = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + SizedBox( + height: 12, + ), + Texts('Drop off Location'), + SizedBox( + height: 8, + ), + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Pickup Location'), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ], + ), + if (widget.patientER.direction == 2) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Pickup Location'), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Pickup Location'), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), + ), + SizedBox( + height: 12, + ), + Texts('Drop off Location'), + SizedBox( + height: 8, + ), + Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Select From Map'), + Icon( + FontAwesomeIcons.mapMarkerAlt, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ], + ), + //TODO show dialog projects + + SizedBox( + height: 45, + ), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () => widget.changeCurrentTab(2), + label: 'Next', + ), + ) + ], + ), + ), ); } } diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart index d8148b3c..38eec5b4 100644 --- a/lib/pages/ErService/SelectTransportationMethod.dart +++ b/lib/pages/ErService/SelectTransportationMethod.dart @@ -32,89 +32,108 @@ class _SelectTransportationMethodState Direction _direction = Direction.FromHospital; Way _way = Way.OneWay; + @override + void initState() { + super.initState(); + if (widget.patientER.direction != null) { + _direction = widget.patientER.direction == 1 + ? Direction.ToHospital + : Direction.FromHospital; + _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; + _erTransportationMethod = widget.amRequestViewModel + .amRequestModeList[(widget.patientER.selectedAmbulate - 1)]; + } + } + @override Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.only(left: 12, right: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Texts('Select Transportation Method'), - ...List.generate( - widget.amRequestViewModel.amRequestModeList.length, - (index) => InkWell( - onTap: () { - setState(() { - _erTransportationMethod = - widget.amRequestViewModel.amRequestModeList[index]; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - children: [ - Expanded( - flex: 3, - child: ListTile( - title: Text(widget - .amRequestViewModel.amRequestModeList[index].title), - leading: Radio( - value: widget - .amRequestViewModel.amRequestModeList[index], - groupValue: _erTransportationMethod, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _erTransportationMethod = value; - }); - }, + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts('Select Transportation Method'), + ...List.generate( + widget.amRequestViewModel.amRequestModeList.length, + (index) => InkWell( + onTap: () { + setState(() { + _erTransportationMethod = + widget.amRequestViewModel.amRequestModeList[index]; + }); + }, + child: Container( + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + flex: 3, + child: ListTile( + title: Text(widget.amRequestViewModel + .amRequestModeList[index].title), + leading: Radio( + value: widget + .amRequestViewModel.amRequestModeList[index], + groupValue: _erTransportationMethod, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _erTransportationMethod = value; + }); + }, + ), ), ), - ), - Expanded( - flex: 1, - child: Texts( - 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), - ) - ], + Expanded( + flex: 1, + child: Texts( + 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), + ) + ], + ), ), ), ), - ), - SizedBox( - height: 12, - ), - Texts('Select Direction'), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _direction = Direction.ToHospital; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - children: [ - ListTile( + SizedBox( + height: 12, + ), + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Container( + width: double.maxFinite, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.ToHospital; + }); + }, + child: Container( + width: double.maxFinite, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( title: Text('To Hospital'), leading: Radio( value: Direction.ToHospital, @@ -127,29 +146,26 @@ class _SelectTransportationMethodState }, ), ), - ], + ), ), ), - ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _direction = Direction.FromHospital; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - children: [ - ListTile( - title: Text('To Hospital'), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.FromHospital; + }); + }, + child: Container( + width: double.maxFinite, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Form Hospital'), leading: Radio( value: Direction.FromHospital, groupValue: _direction, @@ -161,116 +177,118 @@ class _SelectTransportationMethodState }, ), ), - ], + ), ), ), - ), + ], ), - ], - ), - if (_direction == Direction.ToHospital) - Column( - children: [ - Texts('Select Direction'), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _way = Way.OneWay; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - children: [ - ListTile( - title: Text('One Way'), - leading: Radio( - value: Way.OneWay, - groupValue: _way, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _way = value; - }); - }, - ), + ), + if (_direction == Direction.ToHospital) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.OneWay; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('One Way'), + leading: Radio( + value: Way.OneWay, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, ), - ], + ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _way = Way.TwoWays; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - children: [ - ListTile( - title: Text('Two Ways'), - leading: Radio( - value: Way.TwoWays, - groupValue: _way, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - _way = value; - }); - }, - ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.TwoWays; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Two Ways'), + leading: Radio( + value: Way.TwoWays, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, ), - ], + ), ), ), ), - ), - ], - ), - ], - ), - SizedBox( - height: 15, - ), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child: SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 2; - widget.patientER.tripType = _way == Way.TwoWays ? 1 : 2; - widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod)+1); - widget.changeCurrentTab(1); - }); - }, - label: 'Next', + ], + ), + ], + ), + SizedBox( + height: 15, ), - ) - ], + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.direction = + _direction == Direction.ToHospital ? 1 : 2; + widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1; + widget.patientER.selectedAmbulate = (widget + .amRequestViewModel.amRequestModeList + .indexOf(_erTransportationMethod) + + 1); + widget.changeCurrentTab(1); + }); + }, + label: 'Next', + ), + ) + ], + ), ), ); } From 9ab0d6688827fe1c7a67e78b8b4263e94acd7639 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 09:17:38 +0300 Subject: [PATCH 28/65] child Vaccines --- .../childvaccines/child_vaccines_service.dart | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/core/service/childvaccines/child_vaccines_service.dart diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart new file mode 100644 index 00000000..dc317a3e --- /dev/null +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -0,0 +1,29 @@ + +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import '../base_service.dart'; + +class ChildVaccinesService extends BaseService{ + +List BabyInformationModelList = List(); + Map body = Map(); +Future getAllBabyInformationOrders() async { + hasError = false; + body['List_BabyInformationModel'] = false; + + + await baseAppClient.post(GET_BABYINFORMATION_REQUEST, + onSuccess: (dynamic response, int statusCode) { + BabyInformationModelList.clear(); + + response['List_BabyInformationModel'].forEach((vital) { + + BabyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); +} + +} \ No newline at end of file From 0e4ff1f804c5c0b7c9229b43eceecbc48d33055e Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 12:37:24 +0300 Subject: [PATCH 29/65] child Vaccines --- .../childvaccines/child_vaccines_service.dart | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index dc317a3e..d614f9a5 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,29 +1,30 @@ - import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import '../base_service.dart'; -class ChildVaccinesService extends BaseService{ - -List BabyInformationModelList = List(); +class ChildVaccinesService extends BaseService { + List babyInformationModelList = List(); + List userInformationModelList = List(); Map body = Map(); -Future getAllBabyInformationOrders() async { - hasError = false; - body['List_BabyInformationModel'] = false; - - - await baseAppClient.post(GET_BABYINFORMATION_REQUEST, - onSuccess: (dynamic response, int statusCode) { - BabyInformationModelList.clear(); - - response['List_BabyInformationModel'].forEach((vital) { - - BabyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + Future getAllBabyInformationOrders() async { + hasError = false; + body['isDentalAllowedBackend'] = false; + body['IsLogin'] = true; + //body['UserID'] = babyInformationModelList[0].userID; + body['UserID'] = 42843; + + + await baseAppClient.post(GET_BABYINFORMATION_REQUEST, + onSuccess: (dynamic response, int statusCode) { + babyInformationModelList.clear(); + + response['List_BabyInformationModel'].forEach((vital) { + babyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } - -} \ No newline at end of file From 37b817e0c8377156b60314a2e2c0b41d82145386 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 16:02:20 +0300 Subject: [PATCH 30/65] child Vaccines --- lib/pages/ChildVaccines/child_page.dart | 129 ++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 lib/pages/ChildVaccines/child_page.dart diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart new file mode 100644 index 00000000..e5a5058f --- /dev/null +++ b/lib/pages/ChildVaccines/child_page.dart @@ -0,0 +1,129 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ChildPage extends StatefulWidget { +//final List babyInformationModelList; + + // ChildPage({Key key, this.babyInformationModelList}) ; + + @override + _ChildPageState createState() => _ChildPageState(); +} + +class _ChildPageState extends State with SingleTickerProviderStateMixin { + @override + Widget build(BuildContext context) { + var checkedValue= false; + return BaseView( + onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15,right: 15,top: 70), + child: Column( + children: [ + ...List.generate(model.babyInformationModelList.length, (index) => + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + + ), + child: Column( + children: [ + Row(children:[Texts("CHILD NAME"),]), + Row(children:[Texts(model.babyInformationModelList[index].babyName),]), + + Row( + children: [IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model.babyInformationModelList[index].babyName), + IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + )] + ), + Row(children:[Texts("Birthday"),]), + Row(children:[IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model.babyInformationModelList[index].dOB.toString()),]), + Row(children:[IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts("Birthday"),]), + ], + ) + + + ) + + ) + + ], + + + ) + ) + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "ADD NEW CHILD ", + // + onTap: (){ + + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), + ), + ) + ); + } +} From e14d619eddd036065dfb69a6c587861b5f5c8bd6 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Mon, 5 Oct 2020 16:33:07 +0300 Subject: [PATCH 31/65] child Vaccines --- .../images/new-design/calender-secondary.png | Bin 0 -> 16215 bytes assets/images/new-design/female.png | Bin 0 -> 2344 bytes assets/images/new-design/garbage.png | Bin 0 -> 1628 bytes assets/images/new-design/male.png | Bin 0 -> 6152 bytes lib/config/config.dart | 12 +++++ .../List_BabyInformationModel.dart | 45 ++++++++++++++++ .../childvaccines/user_information_model.dart | 48 ++++++++++++++++++ .../childvaccines/child_vaccines_service.dart | 2 +- .../user_information_service.dart | 34 +++++++++++++ .../child_vaccines_view_model.dart | 29 +++++++++++ .../user_information_view_model.dart | 25 +++++++++ lib/locator.dart | 8 +++ lib/pages/Blood/blood_donation.dart | 2 +- lib/pages/ChildVaccines/child_page.dart | 13 +++-- .../ChildVaccines/child_vaccines_page.dart | 29 ++++++++--- 15 files changed, 232 insertions(+), 15 deletions(-) create mode 100644 assets/images/new-design/calender-secondary.png create mode 100644 assets/images/new-design/female.png create mode 100644 assets/images/new-design/garbage.png create mode 100644 assets/images/new-design/male.png create mode 100644 lib/core/model/childvaccines/List_BabyInformationModel.dart create mode 100644 lib/core/model/childvaccines/user_information_model.dart create mode 100644 lib/core/service/childvaccines/user_information_service.dart create mode 100644 lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart create mode 100644 lib/core/viewModels/child_vaccines/user_information_view_model.dart diff --git a/assets/images/new-design/calender-secondary.png b/assets/images/new-design/calender-secondary.png new file mode 100644 index 0000000000000000000000000000000000000000..a790849d3f7979c473f5d489fe5b7d49aec72b3e GIT binary patch literal 16215 zcmV-dKd8WoP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3@DkzBcwh5y5fX9Bb^2Qp$kSo8NgxYd$P&Kt(E zXIhlF0?0ffktnnO_kWK0&wu{oYzWoFRBCQHTmHosoA3Nm?ep*X>1@2;@4p;h&$+LU zoA)O?4+VaP*Bkch^_|Dl#~aG)^=^E9+?4q`PJJE7y&w4g3p%rYf4#204ix`#SjdzhhxAR^oWU8^41KmhV|-30y&Fq4P8F-G$=yh~@Vf3g1I$ zKaZVx|MlD8z5n)Y>}-EM9=;BRvHA6a{B4Y0kGu5k@$h~c|K*C@$CvBfcn&d=`-rV@=Q;4YWTUZ9YPhmq2VjUecj97PUA&(SX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zKy`JP=-{y*S_0U+>O;EF(x9q{A7;y>g?_gSmMksAXT=!7D|6ez*&@jiDaaPMq$M#O TO?@NSz6-#SK(^!9c;EO3rQ_^~ literal 0 HcmV?d00001 diff --git a/assets/images/new-design/male.png b/assets/images/new-design/male.png new file mode 100644 index 0000000000000000000000000000000000000000..e957df707e9201793820bb08943f07b19d212705 GIT binary patch literal 6152 zcmV+j829IiP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+TEF1b{sj9MgOsiUIHe=upGm5PVb;`x_*?ooNt{PXX53_joA_n*9P z@%NY4-Nze|mlBWZ`Lpczc;$8Z{6Nj`>*MR|uFiLz_AV4Y7QX+Io!Oqh$F+B%6rb0_ z`?u@w=QRJ}cHaMSzRSLgfB!pIim` z{1!#RFYf{6TaDh=gM52EeVitKxuWoS<}YvL_<3pHYj@6S z=j`Y1G#4sW+$I6S1Drv6urLuhszo9j#}+g`A^x z&U)s%5tT%`7Q~vff_01z<{hG(@X@=^&i!fMoaDdNxA?zx&ROgJ6P#b_w5&5 zTY42G-3HkdT1|aA5E}>Vrm?AM(m#H5|Ly|+j~3cUKubrcFZ33du6p*-;_S~I!NA$U z@0HWpb%?d+i1RDXMoeV#>Tmbhu-GLKUoy`<4WlqHCs68I#A~VkpbArq;4t=j6 z12WxVjJeXDI}hze7$(PTB6lilXOEu?1p^8FizPiU2?mp~g==c6;ETRI zIBV*4YFf0?StrA&93i1|PraQvk;qVdf?jDbFg=h|95HFZ!UU*E$7}~(%$y*W zz2l^75yU0XYp^?1ZkM#q@VXR(ir9`k8^_-3mSp`4l_tQdRJYH?1)@Q2ZMc=|TN5rG zxt2ZPxmrc$KH!U+%v{bny0;ZO6wL;1r_jf>NkIyu%wF_EN!&;dxdTs9X ziP}VeJR_4&Va8|G^+5+m5JIjoYCqXy19Vf~q$ZXr+>E9vfy6Xbbhh=auhY~*LT7_o+;Z*5x zqQ%{)>1GPh4sW~XIELgN=ly#mD8LUaDaxC8rK9MPggXX0iJ7xnx!Mn9j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`v8O8x=JI6XY)hpE>1ntV;Rva-?~J+>kNz;X)_ zr-SD7^ouWM3I*_{j&fNu^b>b@Se;LJ0FX|n?NlOK2Qcnp4__+F#|3#_ecngPYV zI@cu`Yj2G;4d%RS8zP$_Qmcu#J%Mayd@`9lsfrnjKv@U9Av9{24m_vEirS|-$CjnO1H_s8^iyHUcy)_v< zQfPo@j=#4F#BmM6MRS)g4|oosQk<=|NlLUBN2zo=Z4>-c-((^q$My6~@}3J5GqkQ` zIJ;0J5!j>MR7WOz51?oPIvtZHypcq;_I(gT@Q_<)r7#39oz(tY`o?N6 zWZ_F1s2LPdMljgxVw&`z3sW;$2^JHedGVs#P1B6$08(RZ1d0kUYZzm+do3OW2*G*H zM8_AR=5k+zIo)Nq&v_1@P;{;HK>68=vx}BP1k+q*yVr979l>sw0()NZoLIi04SRuAoOOlT!~s7OG2r})q^-#&<#wRt zw`ge@w9A`|>znQuk#?6te@{nSJXNq5JkSrmbKtT4|l=G$gyS8ZL>-T8yp99F^| zI(S#U^qJ0B?A?N%!*BKwkh4{T5pWI&WTa+6vtVFfO*pb9knR0xGMOBZHCmPxv;(2% z0IqOgXYf)Uc%?cG9q6QC0&%*NZ>+K%>T+=b!r=m3rH0DMB^ zI@fWD{idCHFqurAACdq8pe7ui3mDr4D7&HA0)GRMCh%I&&g=w$-jb5fg8aNexs#OX z0A^f?ub~^XhYp!`@4Q0YL>M%H0I;~Rahjsq0pN25Y9qWQ3X8VHVjmW-6O>1F#N!8H zU?$1m4JtO^0?1XV$#>mXOn7;>z)!@*2Snj{flSLQJmQZ^a^KyONcuI@Dywgt3k|$-0(R{mc(BL*p_2< zeP>(SF?di#`N4H%Wu-Z)ynM2vnniHZH76oUFX+749SZC! json) { + alertBy = json['AlertBy']; + babyID = json['BabyID']; + babyName = json['BabyName']; + dOB = DateUtil.convertStringToDate(json['DOB']); + gender = json['Gender']; + genderDescription = json['GenderDescription']; + patientID = json['PatientID']; + userID = json['UserID']; + } + + Map toJson() { + final Map data = new Map(); + data['AlertBy'] = this.alertBy; + data['BabyID'] = this.babyID; + data['BabyName'] = this.babyName; + data['DOB'] = this.dOB; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['PatientID'] = this.patientID; + data['UserID'] = this.userID; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/childvaccines/user_information_model.dart b/lib/core/model/childvaccines/user_information_model.dart new file mode 100644 index 00000000..9e1687d3 --- /dev/null +++ b/lib/core/model/childvaccines/user_information_model.dart @@ -0,0 +1,48 @@ +class List_UserInformationModel { + int userID; + String mobileNumber; + String nationalID; + String emailAddress; + int patientID; + int patientType; + bool patientOutSA; + int createdBy; + int editedBy; + + List_UserInformationModel( + {this.userID, + this.mobileNumber, + this.nationalID, + this.emailAddress, + this.patientID, + this.patientType, + this.patientOutSA, + this.createdBy, + this.editedBy}); + + List_UserInformationModel.fromJson(Map json) { + userID = json['UserID']; + mobileNumber = json['MobileNumber']; + nationalID = json['NationalID']; + emailAddress = json['EmailAddress']; + patientID = json['PatientID']; + patientType = json['PatientType']; + patientOutSA = json['PatientOutSA']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + } + + Map toJson() { + final Map data = new Map(); + data['UserID'] = this.userID; + data['MobileNumber'] = this.mobileNumber; + data['NationalID'] = this.nationalID; + data['EmailAddress'] = this.emailAddress; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['PatientOutSA'] = this.patientOutSA; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index d614f9a5..097f6bb0 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -11,7 +11,7 @@ class ChildVaccinesService extends BaseService { hasError = false; body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - //body['UserID'] = babyInformationModelList[0].userID; + // body['UserID'] = babyInformationModelList[0].userID; body['UserID'] = 42843; diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart new file mode 100644 index 00000000..9082039f --- /dev/null +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -0,0 +1,34 @@ + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class UserInformationService extends BaseService{ + + List userInformationModelList = List(); + Map body = Map(); + + + + Future getUserInformationOrders() async { + hasError = false; + // body['isDentalAllowedBackend'] = false; + // body['IsLogin'] = true; + // body['UserID'] = 42843; + + + await baseAppClient.post(GET_USERINFORMATION_REQUEST, + onSuccess: (dynamic response, int statusCode) { + userInformationModelList.clear(); + + response['List_UserInformationModel_New'].forEach((vital) { + userInformationModelList.add(List_UserInformationModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart new file mode 100644 index 00000000..e6a8ca60 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -0,0 +1,29 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; + +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + +class ChildVaccinesViewModel extends BaseViewModel{ + + + ChildVaccinesService _childVaccinesService = locator(); + + + + List get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList; + getBabyInformatioRequestOrders() async { + setState(ViewState.Busy); + + await _childVaccinesService.getAllBabyInformationOrders(); + + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/user_information_view_model.dart b/lib/core/viewModels/child_vaccines/user_information_view_model.dart new file mode 100644 index 00000000..c362ef73 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/user_information_view_model.dart @@ -0,0 +1,25 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/user_information_service.dart'; +import '../../../locator.dart'; +import '../base_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; + +class UserInformationViewModel extends BaseViewModel { + UserInformationService _userInformationService = + locator(); + + List get userInformationModelList => + _userInformationService.userInformationModelList; + + getUserInformatioRequestOrders() async { + setState(ViewState.Busy); + + await _userInformationService.getUserInformationOrders(); + + if (_userInformationService.hasError) { + error = _userInformationService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 8a7022c6..b57a63a1 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; @@ -10,6 +11,8 @@ import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/blood/blood_details_servies.dart'; import 'core/service/blood/blood_donation_service.dart'; +import 'core/service/childvaccines/child_vaccines_service.dart'; +import 'core/service/childvaccines/user_information_service.dart'; import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; @@ -37,6 +40,7 @@ import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/blooddonation/blood_details_view_model.dart'; import 'core/viewModels/blooddonation/booddonation_view_model.dart'; +import 'core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'core/viewModels/contactus/findus_view_model.dart'; import 'core/viewModels/contactus/livechat_view_model.dart'; import 'core/viewModels/er/am_request_view_model.dart'; @@ -112,6 +116,8 @@ void setupLocator() { locator.registerLazySingleton(() => BloodDonationService()); locator.registerLazySingleton(() => BloodDetailsService()); + locator.registerLazySingleton(() => ChildVaccinesService()); + locator.registerLazySingleton(() => UserInformationService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -139,6 +145,8 @@ void setupLocator() { locator.registerFactory(() => LiveChatViewModel()); locator.registerFactory(() => BloodDonationViewModel()); locator.registerFactory(() => BloodDeatailsViewModel()); + locator.registerFactory(() => ChildVaccinesViewModel()); + locator.registerFactory(() => UserInformationViewModel()); locator.registerFactory(() => H2OViewModel()); locator.registerFactory(() => BloodSugarViewMode()); diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 6132e38c..99e5242e 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -87,7 +87,7 @@ class _BloodDonationPageState extends State { children: [ Texts( // TranslationBase.of(context).advancePaymentLabel, - "Enter the required information, In order to register for Blood Donation Service", + "Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName, textAlign: TextAlign.center, ), SizedBox( diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index e5a5058f..ea107600 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class ChildPage extends StatefulWidget { //final List babyInformationModelList; @@ -38,14 +39,16 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: Colors.white, ), + width: 150, child: Column( + children: [ Row(children:[Texts("CHILD NAME"),]), Row(children:[Texts(model.babyInformationModelList[index].babyName),]), Row( children: [IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset('assets/images/new-design/female.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -56,7 +59,7 @@ class _ChildPageState extends State with SingleTickerProviderStateMix ), Texts(model.babyInformationModelList[index].babyName), IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: Icon(Icons.remove_red_eye_outlined,color: Colors.red,), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -68,7 +71,7 @@ class _ChildPageState extends State with SingleTickerProviderStateMix ), Row(children:[Texts("Birthday"),]), Row(children:[IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset('assets/images/new-design/calender-secondary.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { @@ -77,9 +80,9 @@ class _ChildPageState extends State with SingleTickerProviderStateMix }); }, ), - Texts(model.babyInformationModelList[index].dOB.toString()),]), + Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), Row(children:[IconButton( - icon: Icon(Icons.phone,color: Colors.red,), + icon: new Image.asset('assets/images/new-design/garbage.png'), tooltip: 'Increase volume by 10', onPressed: () { setState(() { diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index cec04f12..269c9259 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,28 +1,35 @@ +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + + class ChildVaccinesPage extends StatefulWidget { @override _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); } -class _ChildVaccinesPageState extends State { +class _ChildVaccinesPageState extends State + with SingleTickerProviderStateMixin{ TextEditingController titleController = TextEditingController(); var checkedValue=false; String addEmail=""; @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) => model.getCities(),//model.getHospitals(), + return BaseView( + onModelReady: (model) => model.getUserInformatioRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, @@ -98,7 +105,7 @@ class _ChildVaccinesPageState extends State { label: "UPDATE EMAIL", // onTap: (){ - model.user.emailAddress=model.user.emailAddress+addEmail.toString(); + model.user.emailAddress=addEmail.toString(); AppToast.showSuccessToast( message: "Email updated"); // bloodDetails.city=_selectedHospital.toString(); @@ -119,12 +126,18 @@ class _ChildVaccinesPageState extends State { color: Color.fromRGBO(63, 72, 74, 1,), label: " VIEW LIST OF CHILDREN", // - onTap: (){ + onTap: () => Navigator.push( + context, + FadePage( + page: ChildPage(), - // bloodDetails.city=_selectedHospital.toString(); + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) - // bloodDetails. - }, + ), + ), ), From 227731f8f8c3ac9f9f39aee709acf5a80a0a35a7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 6 Oct 2020 12:16:51 +0300 Subject: [PATCH 32/65] Merge --- lib/config/config.dart | 125 ++-- lib/pages/landing/landing_page.dart | 11 +- lib/pages/login/confirm-login.dart | 69 +- lib/pages/login/login.dart | 37 +- lib/pages/login/welcome.dart | 2 +- .../medical/ask_doctor/doctor_response.dart | 4 +- lib/uitl/LocalNotification.dart | 62 +- lib/widgets/mobile-no/mobile_no.dart | 2 + .../others/floating_button_search.dart | 671 ++++++++++++++++-- lib/widgets/otp/sms-popup.dart | 24 +- lib/widgets/robo-search/robosearch.dart | 44 +- pubspec.yaml | 2 +- 12 files changed, 821 insertions(+), 232 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 02b58b34..e6e40d80 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; @@ -29,8 +29,10 @@ const GET_PRESCRIPTION_REPORT_ENH = ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_RESULT = + '/Services/Patients.svc/REST/GetPatientLabResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; @@ -43,8 +45,7 @@ const SEND_RAD_REPORT_EMAIL = ///Feedback const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; -const GET_PATIENT_AppointmentHistory = - 'Services' +const GET_PATIENT_AppointmentHistory = 'Services' '/Doctors.svc/REST/PateintHasAppoimentHistory'; ///VITAL SIGN @@ -52,31 +53,26 @@ const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; ///Er Nearest -const GET_NEAREST_HOSPITAL= +const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///Er Nearest -const GET_AMBULANCE_REQUEST= +const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; - ///FindUs -const GET_FINDUS_REQUEST= - 'Services/Lists.svc/REST/Get_HMG_Locations'; - +const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; ///LiveChat -const GET_LIVECHAT_REQUEST= - 'Services/Patients.svc/REST/GetPatientICProjects'; +const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; + ///BloodDenote -const GET_CITIES_REQUEST= - 'Services/Lists.svc/REST/GetAllCities'; +const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; ///BloodDetails -const GET_BLOOD_REQUEST= +const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; - ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = @@ -104,7 +100,8 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; //URL to dental doctors list -const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +const GET_DENTAL_DOCTORS_LIST_URL = + "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; //URL to get doctor free slots const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; @@ -175,16 +172,16 @@ const CANCEL_LIVECARE_REQUEST = const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; - -const GET_USER_TERMS ='/Services/Patients.svc/REST/GetUserTermsAndConditions'; -const UPDATE_HEALTH_TERMS ='/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions'; +const UPDATE_HEALTH_TERMS = + '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; const VERSION_ID = 5.6; -const SETUP_ID = '91877'; +const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; @@ -212,54 +209,66 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; -const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; -const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; -const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; -const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; -const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; +const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = + 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +const GET_PATIENT_INFO_BY_ID = + 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = + 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; +const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = + 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = + 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; ///My Trackers -const GET_DIABETIC_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; -const GET_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_GetDiabtecResults'; -const ADD_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_AddDiabtecResult'; - - -const GET_BLOOD_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; -const GET_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetBloodPressureResult'; -const ADD_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddBloodPressureResult'; - -const GET_WEIGHT_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; -const GET_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; -const ADD_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; - - -const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID='Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; - -const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; -const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +const GET_DIABETIC_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +const GET_DIABTEC_RESULT = + 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; +const ADD_DIABTEC_RESULT = + 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; + +const GET_BLOOD_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +const GET_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +const ADD_BLOOD_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +const GET_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +const ADD_WEIGHT_PRESSURE_RESULT = + 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; + +const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = + 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; + +const GET_CALL_INFO_HOURS_RESULT = + 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +const GET_CALL_REQUEST_TYPE_LOV = + 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; - - - - // H2O -const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; -const H2O_INSERT_USER_ACTIVITY="Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; - - - - +const H2O_GET_USER_PROGRESS = + "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +const H2O_INSERT_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; //E_Referral Services -const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; -const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; -const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; +const GET_ALL_RELATIONSHIP_TYPES = + "Services/Patients.svc/REST/GetAllRelationshipTypes"; +const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = + 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; +const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = + 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0fdb57ff..23d1645c 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -347,12 +347,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { ), actions: [ IconButton( - iconSize: 50, - icon: SvgPicture.asset( - 'assets/images/robort_svg.svg', - height: 100, - width: 100, - ), + iconSize: 70, + icon: SvgPicture.asset('assets/images/robort_svg.svg', + height: 100, width: 100, fit: BoxFit.cover), onPressed: () { triggerRobot(); } //do something, @@ -385,7 +382,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } triggerRobot() { - // event.setValue({"doctor_id": '40036'}); + event.setValue({"isRobot": 'true'}); } getText(currentTab) { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index ac36c7d6..cc3ed1e8 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -21,7 +21,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; - +import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmLogin extends StatefulWidget { @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -74,8 +74,7 @@ class _ConfirmLogin extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, - body: isLoading == false - ? SingleChildScrollView( + body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(20), height: SizeConfig.realScreenHeight * .9, @@ -101,11 +100,11 @@ class _ConfirmLogin extends State { .welcomeBack + ' ' + user.name, - fontSize: SizeConfig.textMultiplier * 4, + fontSize: SizeConfig.textMultiplier * 3.5, ), AppText( TranslationBase.of(context).accountInfo, - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2.5, ), Card( color: Colors.grey[300], @@ -250,7 +249,7 @@ class _ConfirmLogin extends State { )) ], ))) - : AppCircularProgressIndicator()); + ); } Future _getAvailableBiometrics() async { @@ -328,18 +327,25 @@ class _ConfirmLogin extends State { { if (value['IsAuthenticated']) {this.checkActivationCode()} } - }); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } sendActivationCode(type) { var request = this.getCommonRequest(); - loading(true); + // loading(true); this.authService.sendActivationCode(request).then((result) => { if (result != null && result['isSMSSent'] == true) {loading(false), this.startSMSService(type)} else {loading(false)} - }); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + // SMSOTP.showLoadingDialog(context, false), } startSMSService(type) { @@ -405,7 +411,10 @@ class _ConfirmLogin extends State { // // this.cs.presentAlert(result.ErrorEndUserMessage); // } } - }); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));; } setUser() async {} @@ -512,7 +521,10 @@ class _ConfirmLogin extends State { AppToast.showErrorToast(message: result); }), } - }); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));; } checkIfUserAgreedBefore(CheckActivationCode result) { @@ -525,42 +537,15 @@ class _ConfirmLogin extends State { } insertIMEI() { - authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}); + authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { + print(err); + }); } goToHome() { // authService.insertDeviceImei().then((value) => print(value)); Navigator.of(context).pushNamed(HOME); - // const request = new LoginRequest(); - // if (this.loginType === AuthenticationService.IDENTIFCIATION_LOGIN_TYPE) { - // request.PatientID = 0; - // } else { - // request.PatientID = Number(this.id); - // } - // this.newRating(request); - // } - // public newRating(request: any) { - // this.authService - // .checkIfRated( - // request, - // () => { - // this.gotoHome(); - // }, - // this.ts.trPK("general", "retry") - // ) - // .subscribe((result: CheckUserRatingResponse) => { - // if (this.cs.validResponse(result)) { - // this.cs.sharedService.setSharedData(result, AuthenticationService.SURVEY_DATA); - // if (result.IsLastAppoitmentRatedList.length === 0) { - // this.cs.openHome(); - // } else { - // this.ProjectID = result.IsLastAppoitmentRatedList[0].ProjectID; - // this.AppointmentNo = result.IsLastAppoitmentRatedList[0].AppointmentNo; - // this.cs.sharedService.setSharedData(true, "ratePage"); - // this.showRateModal(); - // } - // } - // }); + } loading(flag) { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 146d47bc..1fa0f042 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -21,7 +21,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - +import 'package:smart_progress_bar/smart_progress_bar.dart'; class Login extends StatefulWidget { @override _Login createState() => _Login(); @@ -57,9 +57,7 @@ class _Login extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, - body: isLoading == true - ? AppCircularProgressIndicator() - : SingleChildScrollView( + body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), @@ -84,6 +82,7 @@ class _Login extends State { onCountryChange: (value) => countryCode = value), Container( child: TextFields( + fontWeight: FontWeight.normal, controller: nationalIDorFile, onChanged: (value) => {validateForm()}, prefixIcon: Icon( @@ -146,7 +145,7 @@ class _Login extends State { } checkUserAuthentication() { - showLoader(true); + // showLoader(true); var request = CheckPatientAuthenticationReq(); request.isRegister = false; request.patientMobileNumber = int.parse(mobileNo); @@ -162,7 +161,7 @@ class _Login extends State { } sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); authService.checkPatientAuthentication(request).then((value) => { - showLoader(false), + //showLoader(false), if (value['isSMSSent']) { sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), @@ -173,7 +172,11 @@ class _Login extends State { { if (value['IsAuthenticated']) {this.checkActivationCode()} } - }); + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + // SMSOTP.showLoadingDialog(context, false), } checkActivationCode({code}) async { @@ -181,7 +184,8 @@ class _Login extends State { // request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); // request.activationCode = code ?? "0000"; // request.isSilentLogin = code != null ? false : true; - if (code == null) showLoader(true); + if (code == null) + //showLoader(true); request['PatientMobileNumber'] = int.parse(mobileNo); request['ZipCode'] = countryCode; request['SearchType'] = loginType; @@ -203,7 +207,7 @@ class _Login extends State { Navigator.of(context).pushNamed( HOME, ), - showLoader(false), + //showLoader(false), appointmentRateViewModel .getIsLastAppointmentRatedList() .then((value) => { @@ -225,14 +229,17 @@ class _Login extends State { ), ) } - }) + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) // SMSOTP.showLoadingDialog(context, false), }); } - showLoader(bool isTrue) { - setState(() { - isLoading = isTrue; - }); - } + // showLoader(bool isTrue) { + // setState(() { + // isLoading = isTrue; + // }); + // } } diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index b4b05900..8fe6ece1 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -60,7 +60,7 @@ class _WelcomeLogin extends State { textAlign: TextAlign.left, ), SizedBox( - height: SizeConfig.realScreenHeight * .2, + height: SizeConfig.realScreenHeight * .15, ) ]), ), diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index b6071a4c..846c9a05 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -30,7 +30,7 @@ class DoctorResponse extends StatelessWidget { height: 65, ), AppExpandableNotifier( - header: Padding( + headerWidget: Padding( padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -110,7 +110,7 @@ class DoctorResponse extends StatelessWidget { ), ), AppExpandableNotifier( - header: Padding( + headerWidget: Padding( padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index ac4f5860..5b826f00 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -4,16 +4,14 @@ import 'dart:ui'; import 'package:flutter/cupertino.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); +final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = + FlutterLocalNotificationsPlugin(); class LocalNotification { - - static Future scheduleNotification( {@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { - ///vibrationPattern var vibrationPattern = Int64List(4); vibrationPattern[0] = 0; @@ -26,8 +24,10 @@ class LocalNotification { 'ActivePrescriptions', 'ActivePrescriptionsDescription', // icon: 'secondary_icon', - sound: RawResourceAndroidNotificationSound('slow_spring_board'),///change it to be as ionic - // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic + sound: RawResourceAndroidNotificationSound('slow_spring_board'), + + ///change it to be as ionic + // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic vibrationPattern: vibrationPattern, enableLights: true, color: const Color.fromARGB(255, 255, 0, 0), @@ -35,15 +35,13 @@ class LocalNotification { ledOnMs: 1000, ledOffMs: 500); var iOSPlatformChannelSpecifics = - IOSNotificationDetails(sound: 'slow_spring_board.aiff');///change it to be as ionic - var platformChannelSpecifics = NotificationDetails( - androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.schedule( - 0, - title, - description, - scheduledNotificationDateTime, - platformChannelSpecifics); + IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + + ///change it to be as ionic + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.schedule(0, title, description, + // scheduledNotificationDateTime, platformChannelSpecifics); } ///Repeat notification every day at approximately 10:00:00 am @@ -54,14 +52,14 @@ class LocalNotification { 'repeatDailyAtTime channel name', 'repeatDailyAtTime description'); var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - var platformChannelSpecifics = NotificationDetails( - androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.showDailyAtTime( - 0, - 'show daily title', - 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', - time, - platformChannelSpecifics); + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.showDailyAtTime( + // 0, + // 'show daily title', + // 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + // time, + // platformChannelSpecifics); } ///Repeat notification weekly on Monday at approximately 10:00:00 am @@ -72,15 +70,15 @@ class LocalNotification { 'show weekly channel name', 'show weekly description'); var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - var platformChannelSpecifics = NotificationDetails( - androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( - 0, - 'show weekly title', - 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', - Day.Monday, - time, - platformChannelSpecifics); + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( + // 0, + // 'show weekly title', + // 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + // Day.Monday, + // time, + // platformChannelSpecifics); } static String _toTwoDigitString(int value) { diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index d916f570..399e346d 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -74,6 +74,7 @@ class _MobileNo extends State { Container( padding: EdgeInsets.all(5), decoration: BoxDecoration( + color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), child: Row(children: [ @@ -88,6 +89,7 @@ class _MobileNo extends State { child: Text( countryCode, overflow: TextOverflow.clip, + )), Expanded( flex: 4, diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 37a3e3c0..2d5b6071 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -1,7 +1,43 @@ +import 'dart:collection'; +import 'dart:math'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/ErService/NearestEr.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; +import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; +import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; -import 'package:diplomaticquarterapp/widgets/robo-search/search.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:flutter_tts/flutter_tts.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_recognition_result.dart'; +import 'package:speech_to_text/speech_to_text.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:flutter/cupertino.dart'; + +import 'package:smart_progress_bar/smart_progress_bar.dart'; class FloatingSearchButton extends StatefulWidget { @override @@ -10,36 +46,77 @@ class FloatingSearchButton extends StatefulWidget { class _FloatingSearchButton extends State with TickerProviderStateMixin { - Offset position = Offset(30.0, 40.0); - AlignmentDirectional _ironManAlignment = AlignmentDirectional(0.0, 0.7); + Offset position = Offset(250, 400); + bool activeAnimation = false; + bool isShow = true; + SearchProvider searchProvider = new SearchProvider(); + RobotProvider eventProvider = RobotProvider(); + bool isLoading = false; + bool isError = false; + final SpeechToText speech = SpeechToText(); + String error = ''; + String _currentLocaleId = ""; + String lastError; + double level = 0.0; + var searchText; + double minSoundLevel = 50000; + double maxSoundLevel = -50000; + String reconizedWord = ''; + FlutterTts flutterTts = FlutterTts(); + var selectedLang; + bool isSearching = false; + Map results = {}; + String lastStatus; + + bool _isInit = true; + var event = RobotProvider(); + bool _hasSpeech = false; @override void initState() { - // TODO: implement initState super.initState(); + event.controller.stream.listen((p) { + if (p['isRobot'] == 'true') { + setState(() { + position = Offset(250, 400); + activeAnimation = false; + }); + } + }); + requestPermissions(); + // Future.delayed(const Duration(seconds: 10), () { + initSpeechState().then((value) => {}); + // }); } @override Widget build(BuildContext context) { - return Positioned( - left: position.dx, - top: position.dy, - child: Draggable( - feedback: Container(child: getStack()), - child: Container( - child: AnimatedContainer( - duration: Duration(seconds: 2), - alignment: _ironManAlignment, - child: getStack(), - )), - childWhenDragging: Container( - color: Colors.transparent, - ), - onDragEnd: (details) { - setState(() { - position = details.offset; - }); - })); + return AnimatedPositioned( + onEnd: () { + // setState(() { + // this.isShow = false; + // position = Offset(250, 400); + // }); + }, + left: activeAnimation ? 300 : position.dx, + top: activeAnimation ? -150 : position.dy, + duration: activeAnimation + ? const Duration(seconds: 1) + : const Duration(seconds: 0), + // curve: Curves.bounceOut, + child: isShow + ? Draggable( + feedback: Container(child: getStack()), + child: getStack(), + childWhenDragging: Container( + color: Colors.transparent, + ), + onDragEnd: (details) { + setState(() { + position = details.offset; + }); + }) + : Container()); // Draggable( // feedback: getStack(), @@ -57,42 +134,518 @@ class _FloatingSearchButton extends State return Container( height: 150, width: 150, - child: Stack( - children: [ - Positioned( - top: 10, - right: 0, - child: GestureDetector( - onTap: () { - print("hi"); - setState(() { - _ironManAlignment = AlignmentDirectional(0.0, -0.20); - }); - }, // handle your image tap here - child: Image.asset( - 'assets/images/CloseIcon.png', - fit: BoxFit.cover, // this is the solution for border - width: 30.0, - height: 30.0, - )), + child: Stack(children: [ + // Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: [ + GestureDetector( + child: Container( + child: SvgPicture.asset('assets/images/robort_svg.svg'), + ), + onTap: () { + new RoboSearch(context: context).showAlertDialog(context); + startVoiceSearch(); + }, + ), + // ], + // ), + Positioned( + right: 0.0, + top: 10, + child: GestureDetector( + onTap: () { + setState(() { + activeAnimation = true; + }); + }, + child: Align( + alignment: Alignment.topRight, + child: CircleAvatar( + radius: 14.0, + backgroundColor: Colors.red, + child: Icon(Icons.close, color: Colors.white), + ), + ), ), - GestureDetector( - onTap: () { - // animationController.forward(); - }, // handle your image tap here - child: SvgPicture.asset('assets/images/robort_svg.svg')) - // new RawMaterialButton( - // // shape: new CircleBorder(), - // elevation: 1.0, - // child: SvgPicture.asset('assets/images/robort_svg.svg'), - // onPressed: () {}, - // ), - ], - )); - } - - roboSearch(context) { - var dialog = RoboSearch(context: context); - dialog.showAlertDialog(context); + ), + ]) + + // Stack( + // fit: StackFit.loose, + // overflow: Overflow.visible, + // children: [ + // Container(), + // Positioned( + // child: GestureDetector( + // behavior: HitTestBehavior.translucent, + // onTapDown: (TapDownDetails details) => { + // setState(() { + // activeAnimation = true; + // }) + // }, // handle your image tap here + // child: Image.asset( + // 'assets/images/CloseIcon.png', + // fit: BoxFit.cover, // this is the solution for border + // width: 30.0, + // height: 30.0, + // ), + // )), + // Positioned( + // child: GestureDetector( + // onTap: () { + // this.roboSearch(context); + // }, // handle your image tap here + // child: SvgPicture.asset('assets/images/robort_svg.svg'))) + + // // new RawMaterialButton( + // // // shape: new CircleBorder(), + // // elevation: 1.0, + // // child: SvgPicture.asset('assets/images/robort_svg.svg'), + // // onPressed: () {}, + // // ), + // ], + // ) + + ); + } + + startVoiceSearch() async { + _currentLocaleId = + TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' + ? 'en-US' + : 'ar-SA'; + speech.listen( + onResult: resultListener, + listenFor: Duration(seconds: 10), + localeId: _currentLocaleId, + onSoundLevelChange: soundLevelListener, + cancelOnError: true, + partialResults: true, + onDevice: true, + listenMode: ListenMode.deviceDefault); + } + + void resultListener(SpeechRecognitionResult result) { + // lastWords = "${result.recognizedWords} - ${result.finalResult}"; + + if (result.finalResult == true) { + // setState(() { + + + reconizedWord = result.recognizedWords; + event.setValue({"searchText": reconizedWord}); + setState(() { + searchText = reconizedWord; + }); + Future.delayed(const Duration(seconds: 1), () { + _speak(reconizedWord); + }); + } + //}); + } + + Future _speak(reconizedWord) async { + //await flutterTts.speak(reconizedWord); + RoboSearch.closeAlertDialog(context); + getPages(reconizedWord); + } + + void soundLevelListener(double level) { + minSoundLevel = min(minSoundLevel, level); + maxSoundLevel = max(maxSoundLevel, level); + // print("sound level $level: $minSoundLevel - $maxSoundLevel "); + //setState(() { + this.level = level; + // }); + } + + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + if (hasSpeech) { + _currentLocaleId = + TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' + ? 'en-US' + : 'ar-SA'; // systemLocale.localeId; + + } + if (!mounted) return; + + setState(() { + _hasSpeech = hasSpeech; + }); + } + + void errorListener(SpeechRecognitionError error) { + //setState(() { + // reconizedWord = "${error.errorMsg} - ${error.permanent}"; + //}); + } + + void statusListener(String status) { + //setState(() { + reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + + //}); + } + + getPages(text) { + var request = { + 'VoiceMessage': text, + 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' + ? 'En' + : 'Ar' + }; + + searchProvider + .getBotPages(request) + .then((value) => {getCommands(value['Understand'])}); + } + + getCommands(result) async { + print(result); + results = result; + + switch (result["CommandNumber"]) { + case '100': + { + List clnicID = unique(result['ClinicId']); + if (result['ProjectId'] != 0 && + clnicID.length > 0 && + result['DoctorId'].length > 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + doctorId: result['DoctorId'], + doctorName: null, + ); + } else { + goToClinic(clnicID); + } + } else if (result['ProjectId'] != 0 && + clnicID.length > 0 && + result['DoctorId'].length == 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + ); + } else { + goToClinic(clnicID); + } + } else if (result['ProjectId'] == 0 && + clnicID.length > 0 && + result['DoctorId'].length == 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + ); + } else { + goToClinic(clnicID); + } + } else if (result['ProjectId'] == 0 && + clnicID.length > 0 && + result['DoctorId'].length > 0) { + if (clnicID.length == 1) { + getDoctorsList( + result['ProjectId'], + clnicID[0], + context, + doctorId: result['DoctorId'], + doctorName: null, + ); + } else { + goToClinic(clnicID); + } + } else { + goToClinic(clnicID); + } + // speak(); + } + break; + case '102': + { + getDoctorsList( + 0, + 0, + context, + doctorId: result['DoctorId'], + doctorName: null, + ); + } + break; + case '103': + { + List clnicID = unique(result['ClinicId']); + if (clnicID.length == 1) { + getDoctorsList( + 0, + clnicID[0], + context, + doctorId: null, + doctorName: null, + ); + } else { + goToClinic(clnicID); + } + } + break; + case '4': + { + Navigator.push(context, FadePage(page: LabsHomePage())); + } + break; + case '6': + { + Navigator.push(context, FadePage(page: RadiologyHomePage())); + } + break; + case '7': + { + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); + } + break; + case '8': + { + Navigator.push( + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); + } + break; + case '9': + { + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); + } + break; + case '10': + { + Navigator.push( + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ); + } + break; + case '11': + { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + } + break; + case '12': + { + Navigator.push(context, FadePage(page: InsuranceApproval())); + } + break; + case '13': + { + Navigator.push(context, FadePage(page: MyVaccines())); + } + break; + case '14': + { + Navigator.push(context, FadePage(page: HomeReportPage())); + } + break; + case '5': + { + Navigator.push(context, FadePage(page: NearestEr())); + } + break; + case '15': + { + Navigator.push(context, FadePage(page: PatientSickLeavePage())); + } + break; + case '16': + { + Navigator.push(context, FadePage(page: LiveCareHome())); + } + break; + + case '200': + { + Navigator.push(context, FadePage(page: FeedbackHomePage())); + } + break; + + default: + Navigator.of(context).pushNamed(HOME); + speak(); + break; + } + + //searchProvider.setLisener(result); + } + + getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { + List docProfileList = []; + DoctorsListService service = new DoctorsListService(); + + service + .getDoctorsProfile(doctorId, clinicId, projectId, context) + .then((res) { + if (res['MessageStatus'] == 1) { + if (res['DoctorProfileList'].length != 0) { + res['DoctorProfileList'].forEach((v) { + docProfileList.add(new DoctorProfileList.fromJson(v)); + }); + } + + navigateToDoctorProfile(context, doctorData[0], docProfileList[0], + isAppo: true); + //speak(); + } + }).catchError((err) { + print(err); + }); + } + + getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { + List doctorsList = []; + List arr = []; + List arrDistance = []; + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsList(clinicId, projectId, false, context, + doctorId: doctorId, doctorName: doctorName) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && + res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { + doctorsList.clear(); + res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { + v1['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); + }); + if (doctorsList.length == 1) { + getDoctorProfile( + projectId, clinicId, doctorId[0], context, doctorsList); + + //speak(); + } else { + navigateToSearchResults(context, doctorsList, arr, arrDistance); + } + } else if (res['DoctorList'].length != 0) { + doctorsList.clear(); + + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + arr.add(new DoctorList.fromJson(v).projectName); + arrDistance.add(new DoctorList.fromJson(v) + .projectDistanceInKiloMeters + .toString()); + }); + + if (doctorsList.length == 1) { + getDoctorProfile( + projectId, clinicId, doctorId[0], context, doctorsList); + + //speak(); + } else { + navigateToSearchResults(context, doctorsList, arr, arrDistance); + } + } + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + Future navigateToDoctorProfile(context, docObject, docProfile, + {isAppo}) async { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DoctorProfile( + doctor: docObject, + docProfileList: docProfile, + isOpenAppt: isAppo, + ))); + } + + Future navigateToSearchResults(context, docList, arr, arrDistance) async { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => SearchResults(doctorsList: docList))); + var result = LinkedHashSet.from(arr).toList(); + var numAll = result.length; + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BranchView( + doctorsList: docList, + result: result, + num: numAll, + resultDistance: arrDistance), + ), + ); + } + + speak() async { + if (_currentLocaleId == 'en-US' && results['ReturnMessage'] != null) { + await flutterTts.setVoice("en-us-x-sfg#male_2-local"); + await flutterTts.setLanguage(_currentLocaleId); + await flutterTts.speak(results['ReturnMessage']); + } else if (results['ReturnMessage_Ar'] != null) { + await flutterTts.setLanguage(_currentLocaleId); + + await flutterTts.setVoice("ar-sa-x-sfg#male_1-local"); + await flutterTts.speak(results['ReturnMessage_Ar']); + } + // Future.delayed(const Duration(seconds: 10), () { + // initSpeechState().then((value) => startVoiceSearch()); + // }); + } + + goToClinic(List ids) { + Navigator.push( + AppGlobal.context, + MaterialPageRoute( + builder: (context) => Search( + type: 0, + clnicIds: ids, + ))); + speak(); + } + + List unique(List list) { + return list.toSet().toList(); } } diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 376c2a4f..1a67ae8f 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -30,10 +30,10 @@ class SMSOTP { ); Map verifyAccountFormValue = { - 'digit1': null, - 'digit2': null, - 'digit3': null, - 'digit4': null, + 'digit1': '', + 'digit2': '', + 'digit3': '', + 'digit4': '', }; final focusD1 = FocusNode(); final focusD2 = FocusNode(); @@ -106,7 +106,7 @@ class SMSOTP { onChanged: (val) { if (val.length == 1) { FocusScope.of(context).requestFocus(focusD2); - verifyAccountFormValue['digit1'] = val; + verifyAccountFormValue['digit1'] = val.trim(); checkValue(); } }, @@ -130,7 +130,7 @@ class SMSOTP { if (val.length == 1) { FocusScope.of(context) .requestFocus(focusD3); - verifyAccountFormValue['digit2'] = val; + verifyAccountFormValue['digit2'] = val.trim(); checkValue(); } }, @@ -155,7 +155,7 @@ class SMSOTP { if (val.length == 1) { FocusScope.of(context) .requestFocus(focusD4); - verifyAccountFormValue['digit3'] = val; + verifyAccountFormValue['digit3'] = val.trim(); checkValue(); } }, @@ -175,7 +175,7 @@ class SMSOTP { }, onChanged: (val) { if (val.length == 1) { - verifyAccountFormValue['digit4'] = val; + verifyAccountFormValue['digit4'] = val.trim(); checkValue(); } }, @@ -241,10 +241,10 @@ class SMSOTP { checkValue() { //print(verifyAccountFormValue); - if (verifyAccountFormValue['digit1'] != null && - verifyAccountFormValue['digit2'] != null && - verifyAccountFormValue['digit3'] != null && - verifyAccountFormValue['digit4'] != null) { + if (verifyAccountFormValue['digit1'] != ''&& + verifyAccountFormValue['digit2'] != '' && + verifyAccountFormValue['digit3'] != '' && + verifyAccountFormValue['digit4'] != '') { onSuccess(verifyAccountFormValue['digit1'] + verifyAccountFormValue['digit2'] + verifyAccountFormValue['digit3'] + diff --git a/lib/widgets/robo-search/robosearch.dart b/lib/widgets/robo-search/robosearch.dart index ca28193b..35c2ec67 100644 --- a/lib/widgets/robo-search/robosearch.dart +++ b/lib/widgets/robo-search/robosearch.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/search.dart'; import 'package:flutter/cupertino.dart'; @@ -6,7 +7,8 @@ import 'package:flutter/material.dart'; class RoboSearch { final BuildContext context; - + var event = RobotProvider(); + var searchText = null; RoboSearch({ @required this.context, }); @@ -16,14 +18,50 @@ class RoboSearch { // set up the AlertDialog AlertDialog alert = AlertDialog( - title: Center(child: Text(TranslationBase.of(context).search)), content: StatefulBuilder( builder: (BuildContext context, StateSetter setState) { + setState((){ + event.controller.stream.listen((p) { + if (p['searchText']!=null) { + setState(() { + searchText = p['searchText']; + }); + } + }); + }); return Container( color: Colors.white, height: SizeConfig.realScreenHeight * 0.5, width: SizeConfig.realScreenWidth * 0.8, - child: Container()); + child: Container( + child: Column(children: [ + Expanded( + flex: 1, + child: Center( + child: Image.asset( + 'assets/images/habib-logo.png', + height: 75, + width: 75, + ))), + Expanded( + flex: 3, + child: Center( + child: Container( + margin: EdgeInsets.all(20), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(100), + border: Border.all(width: 2, color: Colors.red)), + child: Icon( + Icons.mic, + color: Colors.blue, + size: 48, + ), + ))), + Expanded( + flex: 1, child: Center(child: Text( searchText != null ? searchText : 'Try saying something' ))) + ]), + )); }), ); diff --git a/pubspec.yaml b/pubspec.yaml index 0106908a..4277dcd7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -117,7 +117,7 @@ dependencies: #local_notifications - flutter_local_notifications: ^1.4.4+4 + flutter_local_notifications: ^1.5.0 #rxdart rxdart: ^0.24.1 From 4009aed0009b0fdd19bb46596dedaa696a092deb Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 13:05:18 +0300 Subject: [PATCH 33/65] child Vaccines --- .../ChildVaccines/add_newchild_page.dart | 235 +++++++++++++++++ lib/pages/ChildVaccines/child_page.dart | 22 +- lib/pages/ChildVaccines/new_text_Field.dart | 239 ++++++++++++++++++ .../medical/balance/advance_payment_page.dart | 1 + 4 files changed, 491 insertions(+), 6 deletions(-) create mode 100644 lib/pages/ChildVaccines/add_newchild_page.dart create mode 100644 lib/pages/ChildVaccines/new_text_Field.dart diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart new file mode 100644 index 00000000..0d87cda3 --- /dev/null +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -0,0 +1,235 @@ +import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; + +import 'new_text_Field.dart'; + +enum Gender { Male, Female, NON } +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + +class AddNewChildPage extends StatefulWidget { + @override + _AddNewChildPageState createState() => _AddNewChildPageState(); +} + +class _AddNewChildPageState extends State { + int tappedIndex; + int checkedValue; + + @override + void initState() { + super.initState(); + tappedIndex = -1; + } + + TextEditingController _firstTextController = TextEditingController(); + TextEditingController _secondTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; + Gender gender = Gender.Male; + ChildVaccinesViewModel AddvancedModel = ChildVaccinesViewModel(); + + @override + Widget build(BuildContext context) { + + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Vaccintion", + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 50, + ), + Texts( + "Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName, + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "First Name", + controller: _firstTextController, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Second Name", + controller: _secondTextController, + ), + SizedBox( + height: 12, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Gender:", + textAlign: TextAlign.end, + + ), + ],), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.center, + + + children: [ + + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 170, + child: SecondaryButton( + + textColor:checkedValue == 1 + ? Colors.white + : Colors.black, + color: checkedValue == 1 + ? Colors.red + : Colors.white, + + label: "Male", + // + onTap: () { + // bloodDetails.city=_selectedHospital.toString(); + setState(() { + checkedValue=1; + print("checkedValue="+checkedValue.toString()); + }); + + // bloodDetails. + }, + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 170, + child: SecondaryButton( + textColor:checkedValue == 2 + ? Colors.white + : Colors.black, + color: checkedValue == 2 + ? Colors.red + : Colors.white, + label: "Female", + // + onTap: () { + setState(() { + checkedValue=2; + print("checkedValue="+checkedValue.toString()); + }); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + ), + ) + ],) , + ), + //========== + SizedBox( + height: 6, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Date Of Birth::", + textAlign: TextAlign.end, + + ), + ],), + InkWell( + onTap: () { + DatePicker.showDatePicker(context, + showTitleActions: true, + minTime: DateTime( + DateTime.now().year, DateTime.now().month - 1, 1), + maxTime: DateTime.now(), onConfirm: (date) { + setState(() { + // widget.startDay = date; + }); + }, + // currentTime: widget.startDay, + // locale: projectViewModel.localeType + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts( DateUtil.yearMonthDay(DateTime.now()) + //getStartDay() + ), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + //========= + + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "Add", + // + onTap: () { + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + ), + + ), + ); + } +} diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index ea107600..54e2b60d 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -20,10 +22,12 @@ class ChildPage extends StatefulWidget { class _ChildPageState extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { - var checkedValue= false; + var checkedValue= true; return BaseView( onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination", baseViewModel: model, body: SingleChildScrollView( child: Container( @@ -83,7 +87,7 @@ class _ChildPageState extends State with SingleTickerProviderStateMix Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), Row(children:[IconButton( icon: new Image.asset('assets/images/new-design/garbage.png'), - tooltip: 'Increase volume by 10', + tooltip: '', onPressed: () { setState(() { // _volume += 10; @@ -116,12 +120,18 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), label: "ADD NEW CHILD ", // - onTap: (){ + onTap: () => Navigator.push( + context, + FadePage( + page: AddNewChildPage(), - // bloodDetails.city=_selectedHospital.toString(); + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) - // bloodDetails. - }, + ), + ), ), diff --git a/lib/pages/ChildVaccines/new_text_Field.dart b/lib/pages/ChildVaccines/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/pages/ChildVaccines/new_text_Field.dart @@ -0,0 +1,239 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor,this.isEnabled=true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + + style: Theme.of(context) + .textTheme + .body2 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 5cef835f..02d08682 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -29,6 +29,7 @@ import 'new_text_Field.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + class AdvancePaymentPage extends StatefulWidget { @override _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); From 42554ffa675a0119c943ff1f0e5baa6721faec89 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 15:45:58 +0300 Subject: [PATCH 34/65] child Vaccines --- .../ChildVaccines/add_newchild_page.dart | 109 ++++++++++++++++-- 1 file changed, 97 insertions(+), 12 deletions(-) diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 0d87cda3..b28c1986 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -1,7 +1,10 @@ +import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -10,9 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; + import 'new_text_Field.dart'; @@ -20,6 +21,35 @@ enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } class AddNewChildPage extends StatefulWidget { + final int frequency; + final int days; + final String itemDescription; + + List _scheduleList = List(); + List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday + ]; + + DateTime startDay; + DateTime endDay; + + //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); + AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { + startDay = DateTime.now(); + endDay = DateTime.now();//endDay = DateTime.now().add(Duration(days: days)); + int hour = 24;//(24 / frequency).round(); + int durations = 24 ~/ hour; + for (int count = 0; count < durations; count++) { + _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day, (hour * count))); + } + } @override _AddNewChildPageState createState() => _AddNewChildPageState(); } @@ -39,7 +69,8 @@ class _AddNewChildPageState extends State { TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; Gender gender = Gender.Male; - ChildVaccinesViewModel AddvancedModel = ChildVaccinesViewModel(); + //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); + List_BabyInformationModel addvancedModel = List_BabyInformationModel(); @override Widget build(BuildContext context) { @@ -165,14 +196,17 @@ class _AddNewChildPageState extends State { onTap: () { DatePicker.showDatePicker(context, showTitleActions: true, - minTime: DateTime( - DateTime.now().year, DateTime.now().month - 1, 1), - maxTime: DateTime.now(), onConfirm: (date) { + // minTime: DateTime( + // DateTime.now().year, DateTime.now().month - 1, 1), + minTime: DateTime( + 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { setState(() { - // widget.startDay = date; + widget.startDay = date; }); }, - // currentTime: widget.startDay, + currentTime: widget.startDay, // locale: projectViewModel.localeType ); }, @@ -186,8 +220,9 @@ class _AddNewChildPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( DateUtil.yearMonthDay(DateTime.now()) - //getStartDay() + Texts( //getStartDay() + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay() ), Icon( Icons.calendar_today, @@ -223,7 +258,23 @@ class _AddNewChildPageState extends State { label: "Add", // onTap: () { - // bloodDetails.city=_selectedHospital.toString(); + + addvancedModel.babyName=_firstTextController.text + " "+_secondTextController.text; + addvancedModel.gender=checkedValue; + addvancedModel.dOB=DateUtil.convertStringToDate(getStartDay()) ; + addvancedModel.alertBy=2; + addvancedModel.alertBy=addvancedModel.babyID; + addvancedModel.genderDescription=checkedValue==1?"Male":"Female"; + addvancedModel.patientID=addvancedModel.patientID; + addvancedModel.userID=addvancedModel.userID; + // // advanceModel.fileNumber = _fileTextController.text; + // // advanceModel.hospitalsModel = _selectedHospital; + // // advanceModel.note = _notesTextController.text; + // // advanceModel.email = email ?? model.user.emailAddress; + // // advanceModel.amount = amount; + // // bloodDetails.city=_selectedHospital.toString(); + AppToast.showSuccessToast( + message: "Email updated"); // bloodDetails. }, @@ -232,4 +283,38 @@ class _AddNewChildPageState extends State { ), ); } + String getStartDay() { + return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + } + + String getEndDay() { + return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + } + + String getDateTime(DateTime dateTime) { + return '${dateTime.hour}:${dateTime.minute}'; + } + + String getDays() { + String days = ""; + widget.daysOfWeek.forEach((element) { + days += "${DateUtil.getDay(element)},"; + }); + return days; + } + + void confirmSelectDayDialog() { + showDialog( + context: context, + child: DayCheckBoxDialog( + title: 'Select Day', + selectedDaysOfWeek: widget.daysOfWeek, + onValueSelected: (value) { + setState(() { + widget.daysOfWeek = value; + }); + }, + ), + ); + } } From 8a6511404f849bdd3b00a575f2f72380515231b8 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 17:03:42 +0300 Subject: [PATCH 35/65] child Vaccines --- .../ChildVaccines/add_newchild_page.dart | 399 +++++++++--------- 1 file changed, 211 insertions(+), 188 deletions(-) diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index b28c1986..f4f2db94 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -1,7 +1,11 @@ import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -14,7 +18,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; - import 'new_text_Field.dart'; enum Gender { Male, Female, NON } @@ -24,6 +27,7 @@ class AddNewChildPage extends StatefulWidget { final int frequency; final int days; final String itemDescription; + String dateAdd; List _scheduleList = List(); List daysOfWeek = [ @@ -41,9 +45,10 @@ class AddNewChildPage extends StatefulWidget { //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { - startDay = DateTime.now(); - endDay = DateTime.now();//endDay = DateTime.now().add(Duration(days: days)); - int hour = 24;//(24 / frequency).round(); + startDay = DateTime.now(); + endDay = + DateTime.now(); //endDay = DateTime.now().add(Duration(days: days)); + int hour = 24; //(24 / frequency).round(); int durations = 24 ~/ hour; for (int count = 0; count < durations; count++) { _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, @@ -71,218 +76,236 @@ class _AddNewChildPageState extends State { Gender gender = Gender.Male; //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); List_BabyInformationModel addvancedModel = List_BabyInformationModel(); + CreateNewBaby newChild=CreateNewBaby(); + List_UserInformationModel informationModel =List_UserInformationModel(); @override Widget build(BuildContext context) { - - return AppScaffold( - isShowAppBar: true, - appBarTitle: "Vaccintion", - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 50, - ), - Texts( - "Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName, - textAlign: TextAlign.center, - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: "First Name", - controller: _firstTextController, - ), - SizedBox( - height: 12, - ), - NewTextFields( - hintText: "Second Name", - controller: _secondTextController, - ), - SizedBox( - height: 12, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Gender:", - textAlign: TextAlign.end, - + return BaseView( + builder: (_,model,w)=> AppScaffold( + isShowAppBar: true, + appBarTitle: "Vaccintion", + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 50, ), - ],), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(12), - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - mainAxisAlignment: MainAxisAlignment.center, - - + Texts( + "Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName, + textAlign: TextAlign.center, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "First Name", + controller: _firstTextController, + ), + SizedBox( + height: 12, + ), + NewTextFields( + hintText: "Second Name", + controller: _secondTextController, + ), + SizedBox( + height: 12, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 170, - child: SecondaryButton( - - textColor:checkedValue == 1 - ? Colors.white - : Colors.black, - color: checkedValue == 1 - ? Colors.red - : Colors.white, - - label: "Male", - // - onTap: () { - // bloodDetails.city=_selectedHospital.toString(); - setState(() { - checkedValue=1; - print("checkedValue="+checkedValue.toString()); - }); - - // bloodDetails. - }, - ), + Text( + "Gender:", + textAlign: TextAlign.end, ), - Container( - height: MediaQuery.of(context).size.height * 0.12, - width: 170, - child: SecondaryButton( - textColor:checkedValue == 2 - ? Colors.white - : Colors.black, - color: checkedValue == 2 - ? Colors.red - : Colors.white, - label: "Female", - // - onTap: () { - setState(() { - checkedValue=2; - print("checkedValue="+checkedValue.toString()); - }); - // bloodDetails.city=_selectedHospital.toString(); + ], + ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 170, + child: SecondaryButton( + textColor: + checkedValue == 1 ? Colors.white : Colors.black, + color: checkedValue == 1 ? Colors.red : Colors.white, + + label: "Male", + // + onTap: () { + // bloodDetails.city=_selectedHospital.toString(); + setState(() { + checkedValue = 1; + print("checkedValue=" + checkedValue.toString()); + }); - // bloodDetails. - }, + // bloodDetails. + }, + ), ), - ) - ],) , - ), - //========== - SizedBox( - height: 6, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Date Of Birth::", - textAlign: TextAlign.end, + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 170, + child: SecondaryButton( + textColor: + checkedValue == 2 ? Colors.white : Colors.black, + color: checkedValue == 2 ? Colors.red : Colors.white, + label: "Female", + // + onTap: () { + setState(() { + checkedValue = 2; + print("checkedValue=" + checkedValue.toString()); + }); + // bloodDetails.city=_selectedHospital.toString(); + // bloodDetails. + }, + ), + ) + ], ), - ],), - InkWell( - onTap: () { - DatePicker.showDatePicker(context, + ), + //========== + SizedBox( + height: 6, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Date Of Birth::", + textAlign: TextAlign.end, + ), + ], + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, showTitleActions: true, // minTime: DateTime( // DateTime.now().year, DateTime.now().month - 1, 1), - minTime: DateTime( - 1, 1, 1), + minTime: DateTime(1, 1, 1), maxTime: DateTime.now(), - onConfirm: (date) { + onConfirm: (date) { setState(() { - widget.startDay = date; + widget.startDay = date; }); }, currentTime: widget.startDay, - // locale: projectViewModel.localeType - ); - }, - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( //getStartDay() - // DateUtil.yearMonthDay(DateTime.now()) - getStartDay() - ), - Icon( - Icons.calendar_today, - color: Colors.black, - ) - ], + // locale: projectViewModel.localeType + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(//getStartDay() + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay() + ), + Icon( + Icons.calendar_today, + color: Colors.black, + ) + ], + ), ), ), - ), - SizedBox( - height: 12, - ), - //========= - - ], + SizedBox( + height: 12, + ), + //========= + ], + ), ), ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "Add", - // - onTap: () { + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "Add", + // + onTap: () { - addvancedModel.babyName=_firstTextController.text + " "+_secondTextController.text; - addvancedModel.gender=checkedValue; - addvancedModel.dOB=DateUtil.convertStringToDate(getStartDay()) ; - addvancedModel.alertBy=2; - addvancedModel.alertBy=addvancedModel.babyID; - addvancedModel.genderDescription=checkedValue==1?"Male":"Female"; - addvancedModel.patientID=addvancedModel.patientID; - addvancedModel.userID=addvancedModel.userID; - // // advanceModel.fileNumber = _fileTextController.text; - // // advanceModel.hospitalsModel = _selectedHospital; - // // advanceModel.note = _notesTextController.text; - // // advanceModel.email = email ?? model.user.emailAddress; - // // advanceModel.amount = amount; - // // bloodDetails.city=_selectedHospital.toString(); - AppToast.showSuccessToast( - message: "Email updated"); + newChild.babyName = + _firstTextController.text + " " + _secondTextController.text; + newChild.gender = checkedValue.toString(); + newChild.strDOB=getStartDay() ; + newChild.createdBy=informationModel.createdBy ; + newChild.editedBy=informationModel.createdBy; + newChild.tempValue=true; + newChild.userID=addvancedModel.userID; + newChild.isLogin=true; + newChild.alertBy=addvancedModel.alertBy; + + model.getNewBabyOrders(newChild: newChild); - // bloodDetails. - }, - ), + //DateTime.now();//DateUtil.convertStringToDate(getStartDay()); + // addvancedModel.alertBy = 2; + // addvancedModel.alertBy = addvancedModel.babyID; + // addvancedModel.genderDescription = + // checkedValue == 1 ? "Male" : "Female"; + // addvancedModel.patientID = addvancedModel.patientID; + // addvancedModel.userID = addvancedModel.userID; + // // advanceModel.fileNumber = _fileTextController.text; + // // advanceModel.hospitalsModel = _selectedHospital; + // // advanceModel.note = _notesTextController.text; + // // advanceModel.email = email ?? model.user.emailAddress; + // // advanceModel.amount = amount; + // // bloodDetails.city=_selectedHospital.toString(); + AppToast.showSuccessToast(message: "Record Added"); + //============ + Navigator.push( + context, + FadePage( + page: ChildPage(), + + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) + ), + ); + //============== + + // bloodDetails. + }, + ), + ), ), ); } + String getStartDay() { return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; } From 6830996f9c838f2a213bb29af38ce971402086db Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 18:01:32 +0300 Subject: [PATCH 36/65] child Vaccines --- .../add_new_child_view_model.dart | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/core/viewModels/child_vaccines/add_new_child_view_model.dart diff --git a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart new file mode 100644 index 00000000..26355bd7 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -0,0 +1,28 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + + +class AddNewChildViewModel extends BaseViewModel{ + + CreteNewBabyService _creteNewBabyService = locator(); + + + + List get creteNewBabyModelList=> _creteNewBabyService.createNewBabyModelList; + getNewBabyOrders({ CreateNewBaby newChild}) async { + setState(ViewState.Busy); + + await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild); + + if ( _creteNewBabyService.hasError) { + error = _creteNewBabyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} From 1ce55e687f8ee2b0a175a788ecaff529d04d2ffc Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 6 Oct 2020 18:02:35 +0300 Subject: [PATCH 37/65] Ambulance Service second step --- android/app/build.gradle | 4 +- android/app/src/main/AndroidManifest.xml | 6 + android/gradle.properties | 2 +- lib/core/enum/Ambulate.dart | 27 ++ lib/core/model/er/PatientER.dart | 11 +- lib/core/service/medical/medical_service.dart | 9 +- .../viewModels/er/am_request_view_model.dart | 17 + .../ErService/AvailableAppointmentsPage.dart | 45 +++ lib/pages/ErService/BillAmount.dart | 327 +++++++++++++++++- lib/pages/ErService/PickupLocation.dart | 163 +++++++-- .../ErService/SelectTransportationMethod.dart | 6 + lib/pages/ErService/Summary.dart | 98 +++++- .../ErService/widgets/AppointmentCard.dart | 47 +++ lib/pages/ErService/widgets/StepsWidget.dart | 109 +++++- lib/uitl/ProgressDialog.dart | 12 + pubspec.yaml | 6 +- 16 files changed, 819 insertions(+), 70 deletions(-) create mode 100644 lib/core/enum/Ambulate.dart create mode 100644 lib/pages/ErService/AvailableAppointmentsPage.dart create mode 100644 lib/pages/ErService/widgets/AppointmentCard.dart create mode 100644 lib/uitl/ProgressDialog.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index 1f71421f..9640ea61 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 28 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -41,7 +41,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cloud.diplomaticquarterapp" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f1a5a3f8..8c32edfd 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -17,6 +17,9 @@ + + + + + diff --git a/android/gradle.properties b/android/gradle.properties index 3f45ee5b..9c0729c9 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,4 +2,4 @@ android.enableR8=true android.useAndroidX=true android.enableJetifier=true -org.gradle.jvmargs=-Xmx4608m \ No newline at end of file +org.gradle.jvmargs=-Xmx4608m diff --git a/lib/core/enum/Ambulate.dart b/lib/core/enum/Ambulate.dart new file mode 100644 index 00000000..059a281c --- /dev/null +++ b/lib/core/enum/Ambulate.dart @@ -0,0 +1,27 @@ +import 'package:flutter/cupertino.dart'; + +enum Ambulate { Wheelchair, Walker, Stretcher, None } + +extension SelectedAmbulate on Ambulate { + String getAmbulateTitle(BuildContext context) { + switch (this) { + case Ambulate.Wheelchair: + // TODO: Handle this case. + return 'Wheelchair'; + break; + case Ambulate.Walker: + // TODO: Handle this case. + return 'Walker'; + break; + case Ambulate.Stretcher: + // TODO: Handle this case. + return 'Stretcher'; + break; + case Ambulate.None: + // TODO: Handle this case. + return 'None'; + break; + } + return 'None'; + } +} diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart index 9c2d660e..d0827311 100644 --- a/lib/core/model/er/PatientER.dart +++ b/lib/core/model/er/PatientER.dart @@ -1,3 +1,7 @@ +import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; + +import 'get_all_transportation_method_list_model.dart'; + class PatientER { double versionID; int channel; @@ -46,7 +50,8 @@ class PatientER { dynamic appointmentDoctorName; dynamic appointmentBranch; dynamic appointmentTime; - + PatientERTransportationMethod patientERTransportationMethod; + Ambulate ambulate; PatientER( {this.versionID, this.channel, @@ -94,7 +99,9 @@ class PatientER { this.appointmentClinicName, this.appointmentDoctorName, this.appointmentBranch, - this.appointmentTime}); + this.appointmentTime, + this.patientERTransportationMethod, + this.ambulate}); PatientER.fromJson(Map json) { versionID = json['VersionID']; diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart index 90230f6d..572e5096 100644 --- a/lib/core/service/medical/medical_service.dart +++ b/lib/core/service/medical/medical_service.dart @@ -5,9 +5,14 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu class MedicalService extends BaseService { List appoitmentAllHistoryResultList = List(); - getAppointmentHistory() async { + getAppointmentHistory({bool isActiveAppointment = false}) async { hasError = false; super.error = ""; + Map body = Map(); + if(isActiveAppointment) { + body['IsActiveAppointment'] = true; + body['isDentalAllowedBackend'] = false; + } await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { @@ -19,6 +24,6 @@ class MedicalService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body: body); } } diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index 9045ee90..a5261456 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -3,19 +3,36 @@ import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; +import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import '../base_view_model.dart'; import '../../../locator.dart'; class AmRequestViewModel extends BaseViewModel { AmService _amService = locator(); HospitalService _hospitalService = locator(); + MedicalService _medicalService = locator(); List get amRequestModeList => _amService.amModelList; List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; + List get appoitmentAllHistoryResultList => + _medicalService.appoitmentAllHistoryResultList; + + Future getAppointmentHistory() async { + setState(ViewState.BusyLocal); + await _medicalService.getAppointmentHistory(isActiveAppointment: true); + if (_medicalService.hasError) { + error = _medicalService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getAmRequestOrders() async { setState(ViewState.Busy); diff --git a/lib/pages/ErService/AvailableAppointmentsPage.dart b/lib/pages/ErService/AvailableAppointmentsPage.dart new file mode 100644 index 00000000..7180d5dd --- /dev/null +++ b/lib/pages/ErService/AvailableAppointmentsPage.dart @@ -0,0 +1,45 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AvailableAppointmentsPage extends StatelessWidget { + final List appointmentsAllHistoryList; + + const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Available Appointments', + body: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts('Available Appointments'), + SizedBox( + height: 12, + ), + ...List.generate( + appointmentsAllHistoryList.length, + (index) => InkWell( + onTap: (){ + Navigator.pop(context, appointmentsAllHistoryList[index]); + }, + child: AppointmentCard(appointment: appointmentsAllHistoryList[index],), + ), + ) + ], + ), + ), + ), + ); + } +} + + diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/BillAmount.dart index 3dca195f..44e17c3a 100644 --- a/lib/pages/ErService/BillAmount.dart +++ b/lib/pages/ErService/BillAmount.dart @@ -1,41 +1,334 @@ +import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + class BillAmount extends StatefulWidget { final Function changeCurrentTab; final PatientER patientER; final AmRequestViewModel amRequestViewModel; - BillAmount({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); + BillAmount( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); @override _BillAmountState createState() => _BillAmountState(); } class _BillAmountState extends State { + Ambulate _ambulate = Ambulate.None; + String note =""; @override Widget build(BuildContext context) { - return Column( - children: [ - Texts('BillAmount 3'), - SizedBox(height: 45,), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: ()=> widget.changeCurrentTab(3), - label: 'Next', + return SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Bill Amount '), + SizedBox( + height: 10, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 1.0, color: Colors.grey[300]), + outside: BorderSide(width: 1.0, color: Colors.grey[300])), + children: [ + TableRow( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Amount before tax: ', + textAlign: TextAlign.start, + color: Colors.black, + fontSize: 15, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'SR ${widget.patientER.patientERTransportationMethod.price}', + color: Colors.black, + textAlign: TextAlign.start, + fontSize: 15, + ), + ), + ), + ], + ), + TableRow( + children: [ + Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.09, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Tax amount :', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.09, + color: Colors.white, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'SR ${widget.patientER.patientERTransportationMethod.vAT}', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), + ), + ), + ], + ), + TableRow( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Total amount payable', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + bold: true, + ), + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.09, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10.0), + ), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'SR ${widget.patientER.patientERTransportationMethod.totalPrice}', + color: Colors.black, + fontSize: 15, + textAlign: TextAlign.start, + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Texts('Select Ambulate',bold: true,), + SizedBox(height: 5,), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Wheelchair; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Wheelchair'), + leading: Radio( + value: Ambulate.Wheelchair, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Walker; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Walker'), + leading: Radio( + value: Ambulate.Walker, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + SizedBox(height: 5,), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.Stretcher; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Stretcher'), + leading: Radio( + value: Ambulate.Stretcher, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _ambulate = Ambulate.None; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: Text('Walker'), + leading: Radio( + value: Ambulate.None, + groupValue: _ambulate, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _ambulate = value; + }); + }, + ), + ), + ), + ), + ), + ], + ), + SizedBox(height: 12,), + NewTextFields( + hintText: 'Note', + initialValue: note, + onChanged: (value){ + setState(() { + note = value; + }); + }, + ), - ), - ) - ], + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.ambulate = _ambulate; + widget.patientER.requesterNote = note; + widget.changeCurrentTab(3); + }); + }, + label: 'Next', + ), + ) + ], + ), + ), ); } } diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart index 46a8928b..4b32c9bb 100644 --- a/lib/pages/ErService/PickupLocation.dart +++ b/lib/pages/ErService/PickupLocation.dart @@ -1,16 +1,29 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; +import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; + +import 'AmbulanceReq.dart'; +import 'AvailableAppointmentsPage.dart'; enum HaveAppointment { YES, NO } class PickupLocation extends StatefulWidget { final Function changeCurrentTab; final PatientER patientER; + final AmRequestViewModel amRequestViewModel; PickupLocation( {Key key, @@ -18,8 +31,6 @@ class PickupLocation extends StatefulWidget { this.patientER, this.amRequestViewModel}); - final AmRequestViewModel amRequestViewModel; - @override _PickupLocationState createState() => _PickupLocationState(); } @@ -27,6 +38,26 @@ class PickupLocation extends StatefulWidget { class _PickupLocationState extends State { bool _isInsideHome = false; HaveAppointment _haveAppointment = HaveAppointment.NO; + double _latitude; + double _longitude; + AppoitmentAllHistoryResultList myAppointment; + + @override + void initState() { + super.initState(); + _getCurrentLocation(); + } + + _getCurrentLocation() async { + await getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + // currentLocation = LatLng(position.latitude, position.longitude); + } @override Widget build(BuildContext context) { @@ -111,9 +142,12 @@ class _PickupLocationState extends State { Expanded( child: InkWell( onTap: () { - setState(() { - _haveAppointment = HaveAppointment.YES; - }); + if(myAppointment == null) { + getAppointment(); + setState(() { + _haveAppointment = HaveAppointment.YES; + }); + } }, child: Container( decoration: BoxDecoration( @@ -130,9 +164,13 @@ class _PickupLocationState extends State { groupValue: _haveAppointment, activeColor: Colors.red[800], onChanged: (value) { - setState(() { - _haveAppointment = value; - }); + if(myAppointment == null) { + getAppointment(); + setState(() { + _haveAppointment = value; + }); + } + }, ), ), @@ -144,6 +182,7 @@ class _PickupLocationState extends State { onTap: () { setState(() { _haveAppointment = HaveAppointment.NO; + myAppointment = null; }); }, child: Container( @@ -163,6 +202,7 @@ class _PickupLocationState extends State { onChanged: (value) { setState(() { _haveAppointment = value; + myAppointment = null; }); }, ), @@ -172,6 +212,18 @@ class _PickupLocationState extends State { ), ], ), + + if(myAppointment!=null) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + AppointmentCard(appointment: myAppointment,) + ], + ), + SizedBox( height: 12, ), @@ -209,24 +261,43 @@ class _PickupLocationState extends State { SizedBox( height: 15, ), - Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Pickup Location'), - Icon( - Icons.arrow_drop_down, - size: 24, - color: Colors.black, - ) - ], + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PlacePicker( + apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM​', + // Put YOUR OWN KEY here. + onPlacePicked: (PickResult result) { + print(result.adrAddress); + Navigator.of(context).pop(); + }, + initialPosition: LatLng(_latitude, _longitude), + useCurrentLocation: true, + ), + ), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Pickup Location'), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), ), ), SizedBox( @@ -270,7 +341,12 @@ class _PickupLocationState extends State { child: SecondaryButton( color: Colors.grey[800], textColor: Colors.white, - onTap: () => widget.changeCurrentTab(2), + onTap: () { + setState(() { + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + widget.changeCurrentTab(2); + }); + }, label: 'Next', ), ) @@ -279,4 +355,37 @@ class _PickupLocationState extends State { ), ); } + + getAppointment() { + widget.amRequestViewModel.getAppointmentHistory().then((value) { + if (widget.amRequestViewModel.state == ViewState.Error || + widget.amRequestViewModel.state == ViewState.ErrorLocal) { + AppToast.showErrorToast(message: widget.amRequestViewModel.error); + } else if (widget.amRequestViewModel.appoitmentAllHistoryResultList.length > 0) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AvailableAppointmentsPage( + appointmentsAllHistoryList: + widget.amRequestViewModel.appoitmentAllHistoryResultList, + ), + ), + ).then((value) { + if (value != null) + setState(() { + myAppointment = value; + }); + else + setState(() { + _haveAppointment = HaveAppointment.NO; + }); + }); + } else { + setState(() { + _haveAppointment = HaveAppointment.NO; + }); + AppToast.showErrorToast(message: 'You don\'t have any appointment'); + } + }); + } } diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart index 38eec5b4..261b9f83 100644 --- a/lib/pages/ErService/SelectTransportationMethod.dart +++ b/lib/pages/ErService/SelectTransportationMethod.dart @@ -42,6 +42,10 @@ class _SelectTransportationMethodState _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; _erTransportationMethod = widget.amRequestViewModel .amRequestModeList[(widget.patientER.selectedAmbulate - 1)]; + } else { + if (widget.amRequestViewModel.amRequestModeList.length != 0) + _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[ + widget.amRequestViewModel.amRequestModeList.length - 1]; } } @@ -281,6 +285,8 @@ class _SelectTransportationMethodState .amRequestViewModel.amRequestModeList .indexOf(_erTransportationMethod) + 1); + widget.patientER.patientERTransportationMethod = + _erTransportationMethod; widget.changeCurrentTab(1); }); }, diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/Summary.dart index 13beee8c..4c189707 100644 --- a/lib/pages/ErService/Summary.dart +++ b/lib/pages/ErService/Summary.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; class Summary extends StatefulWidget { final Function changeCurrentTab; @@ -19,23 +20,86 @@ class Summary extends StatefulWidget { class _SummaryState extends State { @override Widget build(BuildContext context) { - return Column( - children: [ - Texts('Summary 4'), - SizedBox(height: 45,), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - label: 'Next', - - // onTap: ()=> widget.changeCurrentTab(2), - ), - ) - ], + return SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Summary'), + SizedBox(height: 5,), + Container( + width: double.infinity, + + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Transportation Method',color: Colors.grey,), + Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), + SizedBox(height: 8,), + + Texts('Direction',color: Colors.grey,), + Texts('From Hospital',bold: true,), + SizedBox(height: 8,), + + Texts('Pickup Location',color: Colors.grey,), + Texts('SZR Medical Center',bold: true,), + SizedBox(height: 8,), + + Texts('Drop off location',color: Colors.grey,), + Texts('6199, Al Ameen wlfn nif',bold: true,), + SizedBox(height: 8,), + + Texts('Select Ambulate',color: Colors.grey,), + Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), + SizedBox(height: 8,), + + Texts('Note',color: Colors.grey,), + Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), + SizedBox(height: 8,), + ], + ), + ), + SizedBox(height: 20,), + Texts('Bill Amount',textAlign: TextAlign.start,), + SizedBox(height: 5,), + Container( + height: 55, + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Total amount payable:'), + Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}') + ], + ), + ), + + SizedBox(height: 45,), + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child:SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + label: 'Next', + + // onTap: ()=> widget.changeCurrentTab(2), + ), + ) + ], + ), + ), ); } } diff --git a/lib/pages/ErService/widgets/AppointmentCard.dart b/lib/pages/ErService/widgets/AppointmentCard.dart new file mode 100644 index 00000000..0437c32f --- /dev/null +++ b/lib/pages/ErService/widgets/AppointmentCard.dart @@ -0,0 +1,47 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class AppointmentCard extends StatelessWidget { + final AppoitmentAllHistoryResultList appointment; + + const AppointmentCard({Key key, this.appointment}) : super(key: key); + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + margin: EdgeInsets.all(8), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Row( + children: [ + LargeAvatar( + url: appointment.doctorImageURL, + name: appointment.doctorNameObj, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(appointment.doctorNameObj,bold: true,), + SizedBox(height: 4,), + Texts(appointment.projectName), + Texts(appointment.clinicName), + Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))), + ], + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart index 1e4077cb..c5864710 100644 --- a/lib/pages/ErService/widgets/StepsWidget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class StepsWidget extends StatelessWidget { final int index; @@ -10,7 +12,8 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Stack( + ProjectViewModel projectViewModel = Provider.of(context); + return projectViewModel.isArabic? Stack( children: [ Container( height: 50, @@ -114,6 +117,110 @@ class StepsWidget extends StatelessWidget { ), ), ], + ):Stack( + children: [ + Container( + height: 50, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: 10, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '1', + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: MediaQuery.of(context).size.width * 0.3, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '2', + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + right: MediaQuery.of(context).size.width * 0.6, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(2) : null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, + ), + child: Center( + child: Texts( + '3', + color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800], + ), + ), + ), + ), + ), + Positioned( + top: 10, + left: 0, + child: InkWell( + onTap: () => index == 2 ?changeCurrentTab(3):null, + child: Container( + width: 35, + height: 35, + decoration: BoxDecoration( + border: Border.all(color: Colors.black,width: 0.75), + + shape: BoxShape.circle, + color: index == 3 ? Colors.grey[800] : Colors.white, + ), + child: Center( + child: Texts( + '4', + color: index == 3 ? Colors.white : Colors.grey[800], + ), + ), + ), + ), + ), + ], ); } } diff --git a/lib/uitl/ProgressDialog.dart b/lib/uitl/ProgressDialog.dart new file mode 100644 index 00000000..728b27dd --- /dev/null +++ b/lib/uitl/ProgressDialog.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class ProgressDialogUtil{ + + static AlertDialog alert = AlertDialog( + content: new Row( + children: [ + CircularProgressIndicator(), + Container(margin: EdgeInsets.only(left: 7),child:Text("Loading..." )), + ],), + ); +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 8bc2c52a..6e9349ab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: A new Flutter application. version: 1.0.0+1 environment: - sdk: ">=2.2.2 <3.0.0" + sdk: ">=2.6.0 <3.0.0" dependencies: flutter: @@ -128,6 +128,10 @@ dependencies: #Handle Geolocation geolocator: ^6.0.0+1 + + #google maps places + google_maps_place_picker: ^0.10.0 + #Dependencies for video call implementation native_device_orientation: ^0.3.0 enum_to_string: ^1.0.9 From fe17c20bdf19c746989824ccfe114f7af1911fd7 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Tue, 6 Oct 2020 18:04:14 +0300 Subject: [PATCH 38/65] child Vaccines --- lib/config/config.dart | 5 + .../childvaccines/add_newchild_model.dart | 100 ++++++++++++++++++ .../childvaccines/add_new_child_service.dart | 26 +++++ lib/locator.dart | 7 ++ 4 files changed, 138 insertions(+) create mode 100644 lib/core/model/childvaccines/add_newchild_model.dart create mode 100644 lib/core/service/childvaccines/add_new_child_service.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 204148b6..65f1553e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -78,6 +78,11 @@ const GET_USERINFORMATION_REQUEST= 'Services/Community.svc/REST/GetUserInformation_New'; +///addNewChild +const GET_NEWCHILD_REQUEST= + 'Services/Community.svc/REST/CreateNewBaby'; + + ///BloodDenote diff --git a/lib/core/model/childvaccines/add_newchild_model.dart b/lib/core/model/childvaccines/add_newchild_model.dart new file mode 100644 index 00000000..9bbfe6ad --- /dev/null +++ b/lib/core/model/childvaccines/add_newchild_model.dart @@ -0,0 +1,100 @@ +class CreateNewBaby { + String babyName; + String gender; + String strDOB; + int editedBy; + int createdBy; + bool tempValue; + int userID; + bool isLogin; + int alertBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + CreateNewBaby( + {this.babyName, + this.gender, + this.strDOB, + this.editedBy, + this.createdBy, + this.tempValue, + this.userID, + this.isLogin, + this.alertBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + CreateNewBaby.fromJson(Map json) { + babyName = json['BabyName']; + gender = json['Gender']; + strDOB = json['StrDOB']; + editedBy = json['EditedBy']; + createdBy = json['CreatedBy']; + tempValue = json['TempValue']; + userID = json['UserID']; + isLogin = json['IsLogin']; + alertBy = json['AlertBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['BabyName'] = this.babyName; + data['Gender'] = this.gender; + data['StrDOB'] = this.strDOB; + data['EditedBy'] = this.editedBy; + data['CreatedBy'] = this.createdBy; + data['TempValue'] = this.tempValue; + data['UserID'] = this.userID; + data['IsLogin'] = this.isLogin; + data['AlertBy'] = this.alertBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/add_new_child_service.dart b/lib/core/service/childvaccines/add_new_child_service.dart new file mode 100644 index 00000000..22a081a3 --- /dev/null +++ b/lib/core/service/childvaccines/add_new_child_service.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class CreteNewBabyService extends BaseService { + List createNewBabyModelList = List(); + + + Future getCreateNewBabyOrders({ CreateNewBaby newChild}) async { + hasError = false; + await baseAppClient.post(GET_NEWCHILD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + createNewBabyModelList.clear(); + + response['List_UserInformationModel_New'].forEach((vital) { + createNewBabyModelList.add( + CreateNewBaby.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: newChild.toJson()); + } + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index b57a63a1..dee65ccc 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,6 +11,7 @@ import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/blood/blood_details_servies.dart'; import 'core/service/blood/blood_donation_service.dart'; +import 'core/service/childvaccines/add_new_child_service.dart'; import 'core/service/childvaccines/child_vaccines_service.dart'; import 'core/service/childvaccines/user_information_service.dart'; import 'core/service/contactus/finadus_service.dart'; @@ -40,6 +41,7 @@ import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/blooddonation/blood_details_view_model.dart'; import 'core/viewModels/blooddonation/booddonation_view_model.dart'; +import 'core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'core/viewModels/contactus/findus_view_model.dart'; import 'core/viewModels/contactus/livechat_view_model.dart'; @@ -118,6 +120,8 @@ void setupLocator() { locator.registerLazySingleton(() => BloodDetailsService()); locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); + locator.registerLazySingleton(() => CreteNewBabyService()); + /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -147,6 +151,9 @@ void setupLocator() { locator.registerFactory(() => BloodDeatailsViewModel()); locator.registerFactory(() => ChildVaccinesViewModel()); locator.registerFactory(() => UserInformationViewModel()); + locator.registerFactory(() => UserInformationViewModel()); + + locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); locator.registerFactory(() => BloodSugarViewMode()); From 1d29aa36a2f3f48a18ba0cff506e1b41ee0abc5b Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 10:39:42 +0300 Subject: [PATCH 39/65] child Vaccines --- lib/config/config.dart | 4 + .../create_vaccination_table.dart | 25 ++ .../childvaccines/child_vaccines_service.dart | 9 +- .../user_information_service.dart | 13 +- .../vaccination_table_service.dart | 39 +++ .../vaccination_table_view_model.dart | 30 +++ lib/locator.dart | 7 +- .../ChildVaccines/add_newchild_page.dart | 10 +- lib/pages/ChildVaccines/child_page.dart | 34 ++- .../ChildVaccines/child_vaccines_page.dart | 1 + .../dialogs/SelectGenderDialog.dart | 146 +++++++++++ lib/pages/ChildVaccines/new_text_Field.dart | 239 ------------------ .../ChildVaccines/vaccinationtable_page.dart | 136 ++++++++++ 13 files changed, 435 insertions(+), 258 deletions(-) create mode 100644 lib/core/model/childvaccines/create_vaccination_table.dart create mode 100644 lib/core/service/childvaccines/vaccination_table_service.dart create mode 100644 lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart create mode 100644 lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart delete mode 100644 lib/pages/ChildVaccines/new_text_Field.dart create mode 100644 lib/pages/ChildVaccines/vaccinationtable_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 65f1553e..2f497de2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -83,6 +83,10 @@ const GET_NEWCHILD_REQUEST= 'Services/Community.svc/REST/CreateNewBaby'; +///addNewTABLE +const GET_TABLE_REQUEST= + 'Services/Community.svc/REST/CreateVaccinationTable'; + ///BloodDenote diff --git a/lib/core/model/childvaccines/create_vaccination_table.dart b/lib/core/model/childvaccines/create_vaccination_table.dart new file mode 100644 index 00000000..d39f2a64 --- /dev/null +++ b/lib/core/model/childvaccines/create_vaccination_table.dart @@ -0,0 +1,25 @@ +class CreateVaccinationTable { + String givenAt; + String status; + String vaccinesDescription; + String visit; + + CreateVaccinationTable( + {this.givenAt, this.status, this.vaccinesDescription, this.visit}); + + CreateVaccinationTable.fromJson(Map json) { + givenAt = json['GivenAt']; + status = json['Status']; + vaccinesDescription = json['VaccinesDescription']; + visit = json['Visit']; + } + + Map toJson() { + final Map data = new Map(); + data['GivenAt'] = this.givenAt; + data['Status'] = this.status; + data['VaccinesDescription'] = this.vaccinesDescription; + data['Visit'] = this.visit; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index 097f6bb0..75a07338 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; @@ -6,13 +8,16 @@ import '../base_service.dart'; class ChildVaccinesService extends BaseService { List babyInformationModelList = List(); List userInformationModelList = List(); + Map body = Map(); Future getAllBabyInformationOrders() async { hasError = false; + body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - // body['UserID'] = babyInformationModelList[0].userID; - body['UserID'] = 42843; + + //body['UserID'] = userInformationModelList[0].userID;//AuthenticatedUser.fromJson(json['List'][0] //babyInformationModelList[0].userID; + body['UserID'] = 46013;//42843; await baseAppClient.post(GET_BABYINFORMATION_REQUEST, diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart index 9082039f..7651ef0f 100644 --- a/lib/core/service/childvaccines/user_information_service.dart +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -12,9 +12,16 @@ class UserInformationService extends BaseService{ Future getUserInformationOrders() async { hasError = false; - // body['isDentalAllowedBackend'] = false; - // body['IsLogin'] = true; - // body['UserID'] = 42843; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] =true; + body['LogInTokenID'] = 'ZBGoQFUG50eQJd6Y7u1ykA=='; + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_USERINFORMATION_REQUEST, diff --git a/lib/core/service/childvaccines/vaccination_table_service.dart b/lib/core/service/childvaccines/vaccination_table_service.dart new file mode 100644 index 00000000..7f987b76 --- /dev/null +++ b/lib/core/service/childvaccines/vaccination_table_service.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + +class VaccinationTableService extends BaseService { + List createVaccinationTableModelList = List(); + Map body = Map(); + + + + Future getCreateVaccinationTableOrders() async { + hasError = false; + await getUser(); + body['BabyName']="fffffffffff eeeeeeeeeeeeee"; + body['DOB'] = "/Date(1585774800000+0300)/"; + body['EmailAddress'] = user.emailAddress; + body['isDentalAllowedBackend'] = false; + body['SendEmail'] = false; + body['IsLogin'] =true; + + + + + await baseAppClient.post(GET_TABLE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + createVaccinationTableModelList.clear(); + response['List_CreateVaccinationTableModel'].forEach((vital) { + createVaccinationTableModelList.add( + CreateVaccinationTable.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart new file mode 100644 index 00000000..3b72dd50 --- /dev/null +++ b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart @@ -0,0 +1,30 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart'; + +import '../../../locator.dart'; +import '../base_view_model.dart'; + + +class VaccinationTableViewModel extends BaseViewModel{ + + VaccinationTableService _creteVaccinationTableService = locator(); + + // String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; + //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent; + List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList; + getCreateVaccinationTable() async { + setState(ViewState.Busy); + + await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); + + if ( _creteVaccinationTableService.hasError) { + error = _creteVaccinationTableService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} diff --git a/lib/locator.dart b/lib/locator.dart index dee65ccc..46b97fce 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,6 +14,7 @@ import 'core/service/blood/blood_donation_service.dart'; import 'core/service/childvaccines/add_new_child_service.dart'; import 'core/service/childvaccines/child_vaccines_service.dart'; import 'core/service/childvaccines/user_information_service.dart'; +import 'core/service/childvaccines/vaccination_table_service.dart'; import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; @@ -43,6 +44,7 @@ import 'core/viewModels/blooddonation/blood_details_view_model.dart'; import 'core/viewModels/blooddonation/booddonation_view_model.dart'; import 'core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'core/viewModels/child_vaccines/vaccination_table_view_model.dart'; import 'core/viewModels/contactus/findus_view_model.dart'; import 'core/viewModels/contactus/livechat_view_model.dart'; import 'core/viewModels/er/am_request_view_model.dart'; @@ -121,6 +123,7 @@ void setupLocator() { locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => VaccinationTableService()); /// View Model @@ -151,7 +154,9 @@ void setupLocator() { locator.registerFactory(() => BloodDeatailsViewModel()); locator.registerFactory(() => ChildVaccinesViewModel()); locator.registerFactory(() => UserInformationViewModel()); - locator.registerFactory(() => UserInformationViewModel()); + locator.registerFactory(() => VaccinationTableViewModel()); + + locator.registerFactory(() => AddNewChildViewModel()); locator.registerFactory(() => H2OViewModel()); diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index f4f2db94..a24fa5a4 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -18,7 +19,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'new_text_Field.dart'; + enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } @@ -260,12 +261,15 @@ class _AddNewChildPageState extends State { _firstTextController.text + " " + _secondTextController.text; newChild.gender = checkedValue.toString(); newChild.strDOB=getStartDay() ; + newChild.alertBy=addvancedModel.alertBy; newChild.createdBy=informationModel.createdBy ; newChild.editedBy=informationModel.createdBy; newChild.tempValue=true; - newChild.userID=addvancedModel.userID; + // newChild.userID=46013;//informationModel.userID; newChild.isLogin=true; - newChild.alertBy=addvancedModel.alertBy; + //newChild.tokenID='qMgbP94U23RkXtWWT0Sw=='; + //'ZBGoQFUG50eQJd6Y7u1ykA=='; + model.getNewBabyOrders(newChild: newChild); diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 54e2b60d..c657b3ca 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; +import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -43,17 +44,18 @@ class _ChildPageState extends State with SingleTickerProviderStateMix color: Colors.white, ), - width: 150, + padding: EdgeInsets.all(12), + width: double.infinity, child: Column( children: [ Row(children:[Texts("CHILD NAME"),]), - Row(children:[Texts(model.babyInformationModelList[index].babyName),]), + Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), Row( children: [IconButton( - icon: new Image.asset('assets/images/new-design/female.png'), - tooltip: 'Increase volume by 10', + icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'), + tooltip: '', onPressed: () { setState(() { // _volume += 10; @@ -61,15 +63,27 @@ class _ChildPageState extends State with SingleTickerProviderStateMix }); }, ), - Texts(model.babyInformationModelList[index].babyName), + Texts(model.babyInformationModelList[index].genderDescription), IconButton( - icon: Icon(Icons.remove_red_eye_outlined,color: Colors.red,), + icon: Icon(Icons.remove_red_eye,color: Colors.red,), tooltip: 'Increase volume by 10', onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); + Navigator.push( + context, + FadePage( + page: VaccinationTablePage(), + + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) + + ), + ); + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); }, )] ), diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 269c9259..ba4589a9 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -32,6 +32,7 @@ class _ChildVaccinesPageState extends State onModelReady: (model) => model.getUserInformatioRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, + baseViewModel: model, appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart new file mode 100644 index 00000000..295c6dcd --- /dev/null +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SelectGenderDialog extends StatefulWidget { + final Gender beneficiaryType; + final Function(Gender) onValueSelected; + + SelectGenderDialog({Key key, this.beneficiaryType, this.onValueSelected}); + + @override + _SelectGenderDialogState createState() => + _SelectGenderDialogState(this.beneficiaryType); +} + +class _SelectGenderDialogState extends State { + _SelectGenderDialogState(this.beneficiaryType); + Gender beneficiaryType; + + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Male"), + leading: Radio( + value: Gender.Male, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (Gender value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + beneficiaryType = Gender.Female; + }); + }, + child: ListTile( + title: Text("Female"), + leading: Radio( + value: Gender.Female, + groupValue: beneficiaryType, + activeColor: Colors.red[800], + onChanged: (Gender value) { + setState(() { + beneficiaryType = value; + }); + }, + ), + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/ChildVaccines/new_text_Field.dart b/lib/pages/ChildVaccines/new_text_Field.dart deleted file mode 100644 index ad9eb580..00000000 --- a/lib/pages/ChildVaccines/new_text_Field.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -class NumberTextInputFormatter extends TextInputFormatter { - @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { - final int newTextLength = newValue.text.length; - int selectionIndex = newValue.selection.end; - int usedSubstringIndex = 0; - final StringBuffer newText = StringBuffer(); - if (newTextLength >= 1) { - newText.write('('); - if (newValue.selection.end >= 1) selectionIndex++; - } - if (newTextLength >= 4) { - newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); - if (newValue.selection.end >= 3) selectionIndex += 2; - } - if (newTextLength >= 7) { - newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); - if (newValue.selection.end >= 6) selectionIndex++; - } - if (newTextLength >= 11) { - newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); - if (newValue.selection.end >= 10) selectionIndex++; - } - // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); - return TextEditingValue( - text: newText.toString(), - selection: TextSelection.collapsed(offset: selectionIndex), - ); - } -} - -final _mobileFormatter = NumberTextInputFormatter(); - -class NewTextFields extends StatefulWidget { - NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.hintColor,this.isEnabled=true}) - : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; - @override - _NewTextFieldsState createState() => _NewTextFieldsState(); -} - -class _NewTextFieldsState extends State { - final FocusNode _focusNode = FocusNode(); - bool focus = false; - bool view = false; - - @override - void initState() { - super.initState(); - _focusNode.addListener(() { - setState(() { - focus = _focusNode.hasFocus; - }); - }); - } - - @override - void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - _focusNode.dispose(); - super.dispose(); - } - - - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { - _focusNode.unfocus(); - return true; - } else { - return false; - } - } - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration:BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Container( - margin: EdgeInsets.only(top: 8), - - child: TextFormField( - enabled: widget.isEnabled, - initialValue: widget.initialValue, - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) - : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type == "password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - - style: Theme.of(context) - .textTheme - .body2 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), - inputFormatters: widget.keyboardType == TextInputType.phone - ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] - : widget.inputFormatters, - decoration: InputDecoration( - labelText: widget.hintText, - labelStyle: TextStyle(color: Colors.black), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(8.0)), - focusedBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - enabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ); - } -} diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart new file mode 100644 index 00000000..8039765e --- /dev/null +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -0,0 +1,136 @@ +import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; + +class VaccinationTablePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + var checkedValue; + return BaseView( + onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: "Vaccination", + body: SingleChildScrollView( + child:Container( + margin: EdgeInsets.only(left: 15,right: 15,top: 70), + child: Column( + children: [//babyInformationModelList.length + ...List.generate(model.creteVaccinationTableModelList.length, (index) => + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + + ), + padding: EdgeInsets.all(12), + width: double.infinity, + child: Column( + + children: [ + Html( + data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + , + ), + // Row(children:[Texts("CHILD NAME"),]), + // Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), + + // Row( + // children: [IconButton( + // icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'), + // tooltip: '', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts(model.babyInformationModelList[index].genderDescription), + // IconButton( + // icon: Icon(Icons.remove_red_eye,color: Colors.red,), + // tooltip: 'Increase volume by 10', + // onPressed: () { + // Navigator.push( + // context, + // FadePage( + // page: VaccinationTablePage(), + // + // //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // // HospitalsPage( + // // findusHospitalModelList: model.FindusHospitalModelList, + // // ) + // + // ), + // ); + // // setState(() { + // // // _volume += 10; + // // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // // }); + // }, + // )] + // ), + // Row(children:[Texts("Birthday"),]), + // Row(children:[IconButton( + // icon: new Image.asset('assets/images/new-design/calender-secondary.png'), + // tooltip: 'Increase volume by 10', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), + // Row(children:[IconButton( + // icon: new Image.asset('assets/images/new-design/garbage.png'), + // tooltip: '', + // onPressed: () { + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + // }, + // ), + // Texts("Birthday"),]), + ], + ) + + + ) + + ) + ], + ), + + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: " ", + // + onTap: () {} + + + ), + ), + ), + ); + } +} From dcb93bf5cc58071887b871670cded223780bfc64 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 12:12:15 +0300 Subject: [PATCH 40/65] child Vaccines --- .../ChildVaccines/vaccinationtable_page.dart | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 8039765e..952cfb0c 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -38,10 +38,27 @@ class VaccinationTablePage extends StatelessWidget { child: Column( children: [ - Html( - data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription - , - ), + Row(children: [ + Text(model.creteVaccinationTableModelList[index].visit), + SizedBox(width: 10,), + + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Html( + // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + data:model.creteVaccinationTableModelList[index].vaccinesDescription, + + ), + ],), + ), + Text(model.creteVaccinationTableModelList[index].givenAt), + + + ],), + Divider(color:Colors.black ,), // Row(children:[Texts("CHILD NAME"),]), // Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), @@ -123,7 +140,7 @@ class VaccinationTablePage extends StatelessWidget { child: SecondaryButton( textColor: Colors.white, color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: " ", + label: "Send Email ", // onTap: () {} From dbda69baa15f9b45cf198ca8273e4844de4e7b0e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Oct 2020 12:44:17 +0300 Subject: [PATCH 41/65] health Calculator'General Health' --- assets/images/medical/BMR_calculator.png | Bin 0 -> 3177 bytes .../images/medical/bmi_health_calculator.png | Bin 0 -> 2209 bytes assets/images/medical/body_fat.png | Bin 0 -> 4309 bytes assets/images/medical/body_weight.png | Bin 0 -> 2775 bytes assets/images/medical/calories-calculator.png | Bin 0 -> 3309 bytes assets/images/medical/carb_protein.png | Bin 0 -> 3732 bytes assets/images/medical/delivery_date_icon.png | Bin 0 -> 8713 bytes .../images/medical/ovulation_period_icon.png | Bin 0 -> 2506 bytes .../all_habib_medical_service_page.dart | 5 +- .../bmi_calculator/bmi_calculator.dart | 521 +++++++++ .../bmi_calculator/result_page.dart | 101 ++ .../bmr_calculator/bmr_calculator.dart | 721 ++++++++++++ .../bmr_calculator/bmr_result_page.dart | 65 ++ .../health_calculator/body_fat/body_fat.dart | 1003 +++++++++++++++++ .../body_fat/body_fat_result_page.dart | 77 ++ .../calorie_calculator.dart | 676 +++++++++++ .../calorie_result_page.dart | 59 + .../health_calculator/carbs/carbs.dart | 367 ++++++ .../carbs/carbs_result_page.dart | 175 +++ .../ideal_body/ideal_body.dart | 550 +++++++++ .../ideal_body/ideal_body_result_page.dart | 170 +++ .../health_converter/blood_cholesterol.dart | 2 +- .../​ health_calculators.dart | 279 +++++ pubspec.yaml | 3 + 24 files changed, 4772 insertions(+), 2 deletions(-) create mode 100644 assets/images/medical/BMR_calculator.png create mode 100644 assets/images/medical/bmi_health_calculator.png create mode 100644 assets/images/medical/body_fat.png create mode 100644 assets/images/medical/body_weight.png create mode 100644 assets/images/medical/calories-calculator.png create mode 100644 assets/images/medical/carb_protein.png create mode 100644 assets/images/medical/delivery_date_icon.png create mode 100644 assets/images/medical/ovulation_period_icon.png create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/​ health_calculators.dart diff --git a/assets/images/medical/BMR_calculator.png b/assets/images/medical/BMR_calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..2c32b80da9aa28ade902c8324a2f3d28babeee59 GIT binary patch literal 3177 zcmV-v43_hWP)b6jsoye06zlovPGy3waz>j@p&br z=^-?B1n{h?dt7a^&Q07Z1hkEUv*9~RnD^E?<6Ok40Cou>tpw2CLg%?kn7cW(@o)$O z0K94$7yk(09VGLu0Is&w`J@-5d-z=eEp{^%B>nr`T4$V#I7$iWDFAz7OjTyrI^$eI z4*;V8oB`lYi)Q@4fITA6i%N}Tq!I3smRq)qI`>!kEisYa=g-S$;wv@>3PsVy99JtA<5vig{L5vY`zdc zxi;F*sF&>p&TTy`=wQ(-Kb!!g%vd*$t1e0421VnQwIrcx0KOL2)-M?s1a202!Xh$xk=oi1x zf_|JbA&mEN%yFLUG5Zhep~6ZW)4Yfuq5X?1_=7Lh~q<5ZyLH}SV*9!iQ_d1_5WGn zPW7DA9jDjWvImOu&EmMPs=GC;ktl(70&tQze=wr1i`YctLV&T3)BA4q6|NS?x_4P0 z)<~2z_Qs*ngv2?jHZmuteHBv~R66;DLGhaxW2Rgo9I#C>( zp5+yBK1v)17CS4V1S(@jjIH(gWa!Qma?CgXb&#WU_M|gFfJNfijIAe&^T(nZiV~%24;6#nb2nG~KS|Wssg6jf@-!aHcrk zN2h>Ll;Vk3$!K+u_OWV=yk7K%^~x4t1id$^u_%Gc^f8s1aYWPIloK6MxI$cO;YwD3 zk0=L%Tg!RSg~HTyAjIL>b$m>jE?o-_)+<9dsq6PE*VwKh?Zm=V^)Nk+sRYbaZYiA{ zqPaV#Cjou0D@)O_ivQO|v=s}ZRD+Y!{eP+87KaV=3krBwELPXcwncYRj#u-_Z7>H& zC$zg9qU#eDXFJ)Qj#1a|N$SDNM5C)?)OQJk6;q1w+D{WBIj@(r$vjIP$m`%*EA70A zK&OzgIa9le84l_IL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26 z-rcB}ZNBQ$N?wr$vgmSk!iqH+<=-7F7VWj)sx&QbS6&+dPN0bsl{7ueY7CW_o{^S( z2|ecvVOdDL$?7CCcx45@+EQik0#26w4N#F0a9Idc zZ^nLo2G7(8%WDgIs6UwlO{pM@F82ioQsk^v=f&=Y=Gxw)p~ym@CerL&Cg;xsCROTJ z)pO?*k#^vrG@`%KLRMqwFPX%6M8oC4=ehU*ESiHjT2S8$9>Fa@MFcelsBie~sG})F4{94cApFW2V_TVm5bsvY`X_l#v@8n08K1 zdMqEo1WC1?@1WRnw<pMc&^;-p4{Q)0Xwzp>Shz??_ERYxTu!PP>sjUmy2|QnvZ1 z=bk4MxC2oh=EF*W`MOpB__i9BjG|-qa0%N9(bP4&M44&cZ!DI!Z~*u>RGKyPIvF6I P00000NkvXXu0mjfWD5>` literal 0 HcmV?d00001 diff --git a/assets/images/medical/bmi_health_calculator.png b/assets/images/medical/bmi_health_calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..2eb494408ac68ae525b49b1bfa56bde5aafb376b GIT binary patch literal 2209 zcmV;S2wwMzP)7000PRNkl zX>3(R6vzLRDwG1Ph_WeEL5YF}P_Z9Six`o(A!^hRMfsv8H6X?iBjCaZjSDs!_aG*a zh=c@jiAW+s+&~3E0^$lNQZ{8(inM*^;JIWv%-nnC&b^Pm_WqJdU+;46%y~0sX3m_s zuMLi+9e_aq`U2<-puORmmcTv$n*n?V;E=66T>#Vo*b5-niV`X3F|G_vI0L|MtxOqu z`W!$fQc4?6UjV2CPzPWlfQ9_Ir9-A+47ZRI04(7DF-+0e9i)_A$^oktZsFvV;teTkrAi2+EK`bsVgMzM_gqNE2taoLZS#`Lc+>-^ z1@H-gRW1^WO@kH-JpjxGFygosGd>>yxD&uOi3Dl$=?dV>0#yhxl6#mgl8dEEc?Liq z0Mh}Ss0{iFAyG?s8bCh)Pf4}-jxuneiJ(pychxzrF@;Ds&Oeo-qapuQiVikOYRUkv z9bn^Chy>#=D#v+I`7ag}@KnJyG?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iy?2tiQ1I>QuF&AE zW76=l?GfQ!Rmz(7W>-Ud(6cFl3%J=+Mx%$nHxd`6jNnP2w5zM`i;UQ>K=Dz^8jpJe=EyD!WpdIl zEYF&c0jW}UdORbDz&_ydF8%|`XK~<-fv|U39!07Y3OWBUMkX4R*OJk!`S}+H1xr4y846x>DvN`Y2I;v4z4hrO}Tqh2HGd%ds9x0^h_? z4x1tc)p7eP)K@pVP|Uvr(2o7jRUGDel))bE!a`5$RC}s>u}E{|+_{P^d`talEP`4D j`DUo2A!pbBEd#)RN<(b-`aAnp00000NkvXXu0mjfec~A1 literal 0 HcmV?d00001 diff --git a/assets/images/medical/body_fat.png b/assets/images/medical/body_fat.png new file mode 100644 index 0000000000000000000000000000000000000000..3dd3615078a66ed8457e11edda369a7b682b952f GIT binary patch literal 4309 zcmV;`5GwD9P)d(cru)2p-T!s>UAv45 z58oxCBZz1pBHD$Bwj`p>iKvl?{!2u2h-f?!jU}QF9KCNxL_>+FKN0mNq6Q+WBcc^V zw3LYE646^k^fJR?o_R144IrXDiKr7eRuj<|L^KZ^&lAz~0vyLy!QMpl6cIHOQBGN2 zC8A+O6#e*m5z)OwwA_Q^bt3vH5tW0ZI}zPUL|=Juyh}u<5K-mEJ_$AWQp{uwB%+;& zs5YUV`LZ7O7@(wLzPwRHv@Qk53?jOXh}NXwn1>Z&qk;Lg?@L6tqw}s8Gt1i@n9M;$ zv?S$(6--OHp~y=IUJ|WF}cHhxw)cD~}U4k%&4gJ8dT9u>_9y z@Fi$ag_CTY<6|P)UCCj7MArtqtC0gAfC3<|xLMgD^XoeY+K75+6ZRmY^Re6|wV4V{ zh7ZhujU=K;_%+``MC}6x;6x(&Cp0B@K?~!Ht5W<}&GOqL9}{Ot*9s5+2+NLyWfNfRg5LzYnVvh%V6-#esC!IYXsYuu-~Rd1r*}D z;LtEGu)p8I%5@15Z70;71G#vu??WnK_;dXtLiVzq9SUaiMQ;|s7hxw1WSsXwn2JKt z12(fb@BJ{AhQPe%t%@&hL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(H$`Mwh5gfmSo4`z%ZrVce*$lsuX98cWSWyFKDAy0^ z1h{GhVLL(NtS!EIrivX>y4%!o?FT4a$}}Y;FGn$=s}P#&dkS^pxC|yvbL~j6qb`;U zGO1*GY3`tyOPOz3k%L2(MpNR21|c{=DpLbH)ee4$ zS0flix@|BCn?c`qH6l|&6w>vMfqw(CZ4zfMWH937yr`U&&^|L5Y5gf>N8;s0&%0xG zgBIQ9dCgNa=!VR0HpfiGMSC_HAU<&Kwh9`Tu`s19_86DRDf~0NPzV3{+o9BaPubB~ ziW`|TOOSw6THb~x{BW`?Uu2*fOpT{JzPb^x{%!#cOFu+W zN*Wn^X*vgcMje*0-q4XwS8_~8(&yf2zXh}>r{k;6*JR~zz$=IxEn5qId!_RKvK+~( z3kE|K$k{Rq3L<>2 ze+)$r_-}-yt+la0a&S@L!;~RZ1pmYlRw!^SJji-NZ`cMC`56KTCkEam@~xv1-my}s zZ&H~6qhUD&IOQ-*K4d8&Sn*TFk0ooSTfSX!=uFAfo>Po6|s>E?^_b00000NkvXXu0mjf Do~aw3 literal 0 HcmV?d00001 diff --git a/assets/images/medical/body_weight.png b/assets/images/medical/body_weight.png new file mode 100644 index 0000000000000000000000000000000000000000..d1f0b324620bff4bbefccdd4589626e1f2414cc0 GIT binary patch literal 2775 zcmd6p`yfc#=du+IrP!sJTrxRWWhc~Og+wmNL8B#? z$u+CfWiBI^IgDy@StK#HMDyLB@%`cbe*f_N@_v4KUQddrJ4Q`KR|Nn7HLR0^m;6S^ zCv20Fe6O`(@&Q1l0PA4qL(lu3ulCgEt>*iU=3B|z!#{$3_jd9B@lxG(S%q|fkI8!c zca;LifOB-9Hg#bCQZa|>dO6qFT$lXZnR4N`GZBHKR`?=(pOc;oZ|wHG6jYkR1ge`( zYHAjtCeH1e{P<#KxFsg$^P$#pI8E{?9~C2uInk9fURpeBw64%8xtb>rVOGJVkcieei;8}tAi6wb>kw5SBp!MtKoE_W$Y7!1o| z*#n)Ra3rJHp8x?>Z{|@&x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j%mndYjoC|iV03=ovHB5qDDan1qEZX@Dj_@PM3YrV%Bk5H{$NIAZOxx47V4Z#gl#PvHFB5k+DB2c0!qX(=? z_&w^bDgc!;7X&DhN54jyuyQ^^_aq-RD@cHaVx^@Gl3g%Et%y$bxw(llPPI*5VG&!R zVEedsTIEO_;oBY{Y;K6cIPuAtwp`l!j1YC^0)txw6>Z<5$&>8JhPrUW3|PvqwBzbfzTNh=iHW;TBGsGG_hgtiZeCFG2KAu13 rUK5~|7>eeu!Pa-{800000NkvXXu0mjf#~?xR literal 0 HcmV?d00001 diff --git a/assets/images/medical/carb_protein.png b/assets/images/medical/carb_protein.png new file mode 100644 index 0000000000000000000000000000000000000000..eb6c664047e682238647df697e0d995fd5294135 GIT binary patch literal 3732 zcmV;F4r}p=P)7%9zh#91rX=F-ZZEBQQS|A#U zrG|zfN|Axd1D2N{4MJeKE-Wnf?K$xNdi*>y|CyOH^Pm6nKF>V6Gyj~+%s1yd-}!E* z1^h;50EYuO7(fGn$O^ z(7N1ToX_|ufHxx$RX_d-;K*`+fj*);fb{`HYXtCD08apT0l>C^`~C-@Q@OuLpHK_n z4FjS60pJV(Ek$1s0B`|-*9~P}0E-!~4*=L9 z2s1uHU)54=iYVVu5vKOR)jC$yb0UBf0PJsBrayqQwDUy(dIQ)QpLpzl(6TS}Kn z*w~34JVzW1P59g|B#;kMLlrB&1Hdr}8%e@S3yG$LZTIm}F{0+!HUQQNp+S9xj{?{p zQugb@bk<9(AKL*K0iYw#{{vtGfX$*FHPVLzILN{C$<7xj>Gm5IeNn4~(~9ZAZ01-g?cEMwCRy(U z?fMr0tf2o;^D5tq!vhT$z zGwg*8D-OaQ61FHT92QVovti!%(h^As3$oo4$&wo~>$O`bb?R*ZPNo}dNx+3sc_ZCZ zMg!9-XbiRZzkki7;Ob*&7>7%(|#XA`8e>s59g#-aNF;~PShw(vape>!lWp>px znZaY|<{KRai^;VJmgmUHCT$eHkGUhMr6#B#HV2 zLsaF`F%j~GQOXRZ!wrp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XP9&b%6;7y3~wmWBy(j8UTu1RBa{BSc<8iWbqAo*V%F22>dZ U=VTw@!vFvP07*qoM6N<$g4U|Q?*IS* literal 0 HcmV?d00001 diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 6854cb27..b3387b34 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; @@ -216,7 +217,9 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage( + page: (HealthCalculators()), + ), ), imageLocation: 'assets/images/new-design/health_calculator_icon.png', diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart new file mode 100644 index 00000000..62729222 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -0,0 +1,521 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'dart:math'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BMICalculator extends StatefulWidget { + @override + _BMICalculatorState createState() => _BMICalculatorState(); +} + +class _BMICalculatorState extends State { + TextEditingController textController = new TextEditingController(); + String textResult; + String msg; + double bmiResult; + int height = 150; + int weight = 40; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + Color lbCard = inactiveCardColor; + Color kgCard = activeCardColor; + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + double convertToCm(double number) { + return number * 30.48; + } + + double convertToKg(double number) { + return number / 2.205; + } + + double calculateBMI() { + if (ftCard == activeCardColor) { + convertToCm(height.toDouble()); + } + bmiResult = weight / pow(height / 100, 2); + + return bmiResult; + } + + void showTextResult() { + if (bmiResult >= 30) { + textResult = 'Obese'; + } else if (bmiResult < 30 && bmiResult >= 25) { + textResult = 'OverWeight'; + } else if (bmiResult < 25 && bmiResult >= 18.5) { + textResult = 'Healthy'; + } else if (bmiResult < 18.5) { + textResult = 'UnderWeight'; + } + } + + void showMsg() { + if (bmiResult >= 30) { + msg = + 'A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.'; + } else if (bmiResult < 30 && bmiResult >= 25) { + msg = + 'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get '; + } else if (bmiResult < 25 && bmiResult >= 18.5) { + msg = + 'A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.'; + } else if (bmiResult < 18.5) { + msg = + 'A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.'; + } + } + + @override + void initState() { + super.initState(); + textController.text = '0'; // Setting the initial value for the field. + } + + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'BMI Calculator', + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Container( + width: 350.0, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Text( + 'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding', + style: TextStyle(fontSize: 18.0), + ), + ), + ), + ), + Container( + height: 200.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Height'), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 120) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Slider( + value: height.toDouble(), + min: 120, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Select Unit'), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('FT')), + ), + ), + ), + ], + ), + ], + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 200.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Weight'), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 40) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Slider( + value: weight.toDouble(), + min: 40, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Select Unit'), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + ], + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBMI(); + showTextResult(); + showMsg(); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ResultPage( + finalResult: bmiResult, + textResult: textResult, + msg: msg, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart new file mode 100644 index 00000000..bfbd10b7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -0,0 +1,101 @@ +import 'dart:ffi'; + +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/percent_indicator.dart'; + +class ResultPage extends StatelessWidget { + final double finalResult; + final String textResult; + final String msg; + + ResultPage({this.finalResult, this.textResult, this.msg}); + Color inductorColor; + double percent; + + Color colorInductor() { + if (finalResult >= 30) { + inductorColor = Color(0xffC70D00); + } else if (finalResult < 30 && finalResult >= 25) { + inductorColor = Color(0xffC25400); + } else if (finalResult < 25 && finalResult >= 18.5) { + inductorColor = Color(0xff36D600); + } else if (finalResult < 18.5) { + inductorColor = Color(0xff1BE0EE); + } + return inductorColor; + } + + double percentInductor() { + if (finalResult >= 30) { + percent = 1.0; + } else if (finalResult < 30 && finalResult >= 25) { + percent = 0.73; + } else if (finalResult < 25 && finalResult >= 18.5) { + percent = 0.5; + } else if (finalResult < 18.5) { + percent = 0.25; + } + return percent; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "BMI Calculator", + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + // height: 40.0, + ), + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: percentInductor(), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + finalResult.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + textResult, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + progressColor: colorInductor(), + backgroundColor: Colors.white, + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts(msg), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart new file mode 100644 index 00000000..05d3d07a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -0,0 +1,721 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BmrCalculator extends StatefulWidget { + @override + _BmrCalculatorState createState() => _BmrCalculatorState(); +} + +class _BmrCalculatorState extends State { + bool isMale = false; + bool isHeightCm = true; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + int weight = 0; + double bmrResult = 0; + String dropdownValue = 'Lighty Active (1-3) days per week'; + double calories = 0; + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void calculateBmr() { + if (isMale == true) { + bmrResult = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age); + } else if (isMale == false) { + bmrResult = + 655.0955 + (9.5634 * weight) + (1.850 * height) - (4.676 * age); + } + + bmrResult = bmrResult.roundToDouble(); + } + + void calculateCalories() { + if (dropdownValue == "Almost Inactive(Little or no exercises)") { + calories = bmrResult * 1.2; + } else if (dropdownValue == "Lighty Active (1-3) days per week") { + calories = bmrResult * 1.375; + } else if (dropdownValue == "very Active(6-7) days per week") { + calories = bmrResult * 1.55; + } else if (dropdownValue == "Super Active(very hard exercises)") { + calories = bmrResult * 1.725; + } else if (dropdownValue == "") { + calories = bmrResult * 10.725; + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Bmr Calculator', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 850, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: Texts( + 'Calculates the amount of energy that the person’s body expends in a day'), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + SizedBox( + height: 5.0, + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Texts( + 'The Age ( 11 - 120 ) yrs', + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(age.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (age < 120) age++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (age > 0) age--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: age.toDouble(), + min: 0, + max: 120, + onChanged: (double newValue) { + setState(() { + age = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Weight', + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Texts('Activity level'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Almost Inactive(Little or no exercises)', + 'Lighty Active (1-3) days per week', + 'very Active(6-7) days per week', + 'Super Active(very hard exercises)' + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 30.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBmr(); + calculateCalories(); + + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BmrResultPage( + bmrResult: bmrResult, + calories: calories, + )), + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart new file mode 100644 index 00000000..a3fdb5f7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class BmrResultPage extends StatelessWidget { + final double bmrResult; + final double calories; + BmrResultPage({this.bmrResult, this.calories}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'BMR Calculator', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + bmrResult.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + 'Calories/Day', + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + progressColor: Color(0xff3C3939), + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts( + 'This means the body will burn ( ${bmrResult.toStringAsFixed(1)} ) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is ( ${calories.toStringAsFixed(1)} ) calories, to maintain the current weight.'), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart new file mode 100644 index 00000000..4a939b3f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -0,0 +1,1003 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BodyFat extends StatefulWidget { + @override + _BodyFatState createState() => _BodyFatState(); +} + +class _BodyFatState extends State { + bool isMale = false; + bool isHeightCm = true; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color neckCmCard = activeCardColor; + Color neckFtCard = inactiveCardColor; + Color waistCmCard = activeCardColor; + Color waistFtCard = inactiveCardColor; + Color hipCmCard = activeCardColor; + Color hipFtCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int neck = 10; + int heightCm = 0; + int heightFt = 0; + int hip = 5; + double heightInches; + double minRange; + double maxRange; + double overWeightBy; + int waist = 5; + double bodyFat = 0; + double fat = 0; + String dropdownValue; + double calories = 0; + String textResult = ''; + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorNeck(int type) { + //MG/DLT card + if (type == 1) { + if (neckCmCard == inactiveCardColor) { + neckCmCard = activeCardColor; + neckFtCard = inactiveCardColor; + } else { + neckCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (neckFtCard == inactiveCardColor) { + neckFtCard = activeCardColor; + neckCmCard = inactiveCardColor; + } else { + neckFtCard = inactiveCardColor; + } + } + } + + void updateColorWaist(int type) { + //MG/DLT card + if (type == 1) { + if (waistCmCard == inactiveCardColor) { + waistCmCard = activeCardColor; + waistFtCard = inactiveCardColor; + } else { + waistCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (waistFtCard == inactiveCardColor) { + waistFtCard = activeCardColor; + waistCmCard = inactiveCardColor; + } else { + waistFtCard = inactiveCardColor; + } + } + } + + void updateColorHip(int type) { + //MG/DLT card + if (type == 1) { + if (hipCmCard == inactiveCardColor) { + hipCmCard = activeCardColor; + hipFtCard = inactiveCardColor; + } else { + hipCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (hipFtCard == inactiveCardColor) { + hipFtCard = activeCardColor; + hipCmCard = inactiveCardColor; + } else { + hipFtCard = inactiveCardColor; + } + } + } + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void calculateBodyFat() { + if (isMale == true) { + bodyFat = 495 / + (1.0324 - + 0.19077 * (log(waist - neck) / ln10) + + 0.15456 * (log(heightCm) / ln10)) - + 450; + fat = (bodyFat * 10) / 10.round(); + } else if (isMale == false) { + bodyFat = 495 / + (1.29579 - + 0.35004 * (log(waist + hip - neck) / ln10) + + 0.22100 * (log(heightCm) / ln10)) - + 450; + fat = (bodyFat * 10) / 10.round(); + } + if (fat <= 0) { + fat = 0; + } + } + + void showTextResult() { + if (isMale == false) { + if (bodyFat > 9 && bodyFat <= 13) { + textResult = 'The category falls under essential'; + } else if (bodyFat > 13 && bodyFat <= 20) { + textResult = 'The category falls under athlete'; + } else if (bodyFat > 20 && bodyFat <= 24) { + textResult = 'The category falls under fitness'; + } else if (bodyFat > 24 && bodyFat <= 31) { + textResult = 'The category falls under acceptable'; + } else if (bodyFat > 31 && bodyFat <= 60) { + textResult = 'The category falls under obese'; + } else if (bodyFat > 60) { + textResult = + 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + } else if (bodyFat <= 9) { + textResult = + 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + } + } else { + if (bodyFat > 5 && fat <= 13) { + textResult = 'The category falls under essential'; + } else if (bodyFat > 13 && bodyFat <= 17) { + textResult = 'The category falls under athlete'; + } else if (bodyFat > 17 && bodyFat <= 24) { + textResult = 'The category falls under fitness'; + } else if (bodyFat > 24 && bodyFat <= 45) { + textResult = 'The category falls under obese'; + } else if (bodyFat > 45) { + textResult = + 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + } else if (bodyFat <= 5) { + textResult = + 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + } + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Body Fat', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 1000.0, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: + Texts('Estimates the total body fat based on\n the size'), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + SizedBox( + height: 5.0, + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(heightCm.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (heightCm < 250) + heightCm++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (heightCm > 0) + heightCm--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: heightCm.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + heightCm = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Neck', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(neck.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (neck < 60) neck++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (neck > 5) neck--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: neck.toDouble(), + min: 5, + max: 60, + onChanged: (double newValue) { + setState(() { + neck = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorNeck(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: neckCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorNeck(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: neckFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Waist', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(waist.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (waist < 200) waist++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (waist > 5) waist--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: waist.toDouble(), + min: 5, + max: 200, + onChanged: (double newValue) { + setState(() { + waist = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWaist(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: waistCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWaist(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: waistFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Hip', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(hip.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (hip < 140) hip++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (hip > 5) hip--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: hip.toDouble(), + min: 5, + max: 140, + onChanged: (double newValue) { + setState(() { + hip = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHip(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: hipCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHip(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: hipFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 35.0, + ), + ], + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBodyFat(); + showTextResult(); + + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FatResult( + bodyFat: bodyFat, + fat: fat, + textResult: textResult, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart new file mode 100644 index 00000000..c8c5476e --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart @@ -0,0 +1,77 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class FatResult extends StatelessWidget { + final double bodyFat; + final double fat; + final String textResult; + + FatResult({this.bodyFat, this.fat, this.textResult = ''}); + Color inductorColor; + Color colorInductor() { + if (bodyFat >= 17) { + inductorColor = Color(0xffC70D00); + } else if (bodyFat < 20 && bodyFat >= 24) { + inductorColor = Color(0xffC25400); + } else if (bodyFat < 24 && bodyFat >= 31) { + inductorColor = Color(0xff36D600); + } else if (bodyFat > 45) { + inductorColor = Color(0xff1BE0EE); + } + return inductorColor; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Body Fat', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + // height: 40.0, + ), + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((fat > 70) ? 100 : fat / 100), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + fat.toStringAsFixed(1) + '%', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + ], + ), + progressColor: inductorColor, + backgroundColor: Colors.white, + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts(textResult), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart new file mode 100644 index 00000000..ac1aacc3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -0,0 +1,676 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class CalorieCalculator extends StatefulWidget { + @override + _CalorieCalculatorState createState() => _CalorieCalculatorState(); +} + +class _CalorieCalculatorState extends State { + bool isMale = false; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + int weight = 0; + double calories; + String dropdownValue; + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void calculateCalories() { + if (isMale == true) { + calories = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age); + } else if (isMale == false) { + calories = + 655.0955 + (9.5634 * weight) + (1.850 * height) - (4.676 * age); + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Calorie Calculator', + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 890.0, + child: Column( + //mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Texts( + 'Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity rate', + ), + ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 10.0, vertical: 15.0), + child: Texts('Gender'), + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + SizedBox( + height: 15.0, + ), + Texts( + 'The Age ( 11 - 120 ) yrs', + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(age.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (age < 120) age++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (age > 0) age--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: age.toDouble(), + min: 0, + max: 120, + onChanged: (double newValue) { + setState(() { + age = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Weight', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts('Activity level'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Almost Inactive(Little or no exercises)', + 'Lighty Active (1-3) days per week', + 'very Active(6-7) days per week', + 'Super Active(very hard exercises)' + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateCalories(); + print(calories); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CalorieResultPage( + calorie: calories, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart new file mode 100644 index 00000000..5c52ecb0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class CalorieResultPage extends StatelessWidget { + final double calorie; + + CalorieResultPage({this.calorie}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'Calorie Calculator', + isShowAppBar: true, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + calorie.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Texts('Calories'), + ], + ), + progressColor: Color(0xff3C3939), + backgroundColor: Colors.white, + ), + ), + Container( + child: + Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart new file mode 100644 index 00000000..32ec9262 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -0,0 +1,367 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'package:flutter/services.dart'; + +class Carbs extends StatefulWidget { + @override + _CarbsState createState() => _CarbsState(); +} + +class _CarbsState extends State { + TextEditingController textController = new TextEditingController(); + int calories; + String dropdownValue; + bool _visible = false; + int meals; + int protein; + int carbs; + + int fat; + double pCal; + double cCal; + double fCal; + double pCalGram; + double cCalGram; + double fCalGram; + double pCalMeal; + double cCalMeal; + double fCalMeal; + + void calculateDietRatios() { + if (dropdownValue == 'Very Low Carb') { + meals = 3; + protein = 45; + carbs = 10; + fat = 45; + } else if (dropdownValue == 'Low Carb') { + meals = 3; + protein = 40; + carbs = 30; + fat = 30; + } else if (dropdownValue == 'Moderate Carb') { + meals = 3; + protein = 25; + carbs = 50; + fat = 25; + } else if (dropdownValue == 'USDA Gudilines') { + meals = 3; + protein = 15; + carbs = 55; + fat = 30; + } else if (dropdownValue == 'Zone Diet') { + meals = 3; + protein = 30; + carbs = 40; + fat = 30; + } + } + + void calculate() { + pCal = (protein / 100.0) * int.parse(textController.text).ceil(); + cCal = (carbs / 100.0) * int.parse(textController.text); + ; + fCal = (fat / 100) * int.parse(textController.text); + ; + pCalGram = pCal / 4.0; + cCalGram = cCal / 4.0; + fCalGram = fCal / 9.0; + pCalMeal = pCalGram / meals.ceil(); + cCalMeal = cCalGram / meals.ceil(); + fCalMeal = fCalGram / meals.ceil(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Carb Protein Fat', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Calculates carbohydrate protein and fat\n ratio in calories and grams according to a\n pre-set ratio', + ), + SizedBox( + height: 15.0, + ), + Column( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 300.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: TextFormField( + controller: textController, + inputFormatters: [ + FilteringTextInputFormatter + .digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: " The Calories per day ", + labelStyle: TextStyle( + color: Colors.black87, + ), + ), + ), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + int currentValue = int.parse( + textController.text); + currentValue++; + textController.text = + (currentValue).toString(); + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + int currentValue = int.parse( + textController.text); + currentValue--; + textController.text = + (currentValue).toString(); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + SizedBox( + height: 20.0, + ), + Button( + backgroundColor: Color(0xffC5272D), + label: 'NOT SURE? CLICK HERE ', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CalorieCalculator()), + ); + } + }); + }, + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Select Diet Type'), + Container( + width: 400, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + calculateDietRatios(); + + dropdownValue == null + ? _visible = false + : _visible = true; + }); + }, + items: [ + 'Very Low Carb', + 'Low Carb', + 'Moderate Carb', + 'USDA Gudilines', + 'Zone Diet', + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + Visibility( + visible: _visible, + child: Container( + height: 170.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'Ratios are divided according to the selected diet'), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan(text: 'Meals Per Day '), + TextSpan( + text: '$meals', + style: TextStyle(color: Color(0xffC5272D)), + ), + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Protein ', + ), + TextSpan( + text: '$protein%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Carbohydrate ', + ), + TextSpan( + text: '$carbs%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Fat ', + ), + TextSpan( + text: '$fat%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + ], + ), + ), + ) + ], + ), + SizedBox( + height: 55.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + calculate(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CarbsResult( + cCal: cCal, + pCal: pCal, + fCal: fCal, + pCalGram: pCalGram, + pCalMeal: pCalMeal, + fCalGram: fCalGram, + fCalMeal: fCalMeal, + cCalGram: cCalGram, + cCalMeal: cCalMeal, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart new file mode 100644 index 00000000..f8d0815a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart @@ -0,0 +1,175 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'package:flutter/painting.dart'; + +class CarbsResult extends StatelessWidget { + double pCal; + double cCal; + double fCal; + double pCalGram; + double cCalGram; + double fCalGram; + double pCalMeal; + double cCalMeal; + double fCalMeal; + + CarbsResult( + {this.pCal, + this.cCal, + this.fCal, + this.pCalGram, + this.cCalGram, + this.fCalGram, + this.fCalMeal, + this.cCalMeal, + this.pCalMeal}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Carb Protein Fat', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0), + child: Table( + border: TableBorder( + verticalInside: BorderSide(width: 1, color: Colors.black54), + bottom: BorderSide(width: 1, color: Colors.black54), + left: BorderSide(width: 1, color: Colors.black54), + right: BorderSide(width: 1, color: Colors.black54), + top: BorderSide(width: 1, color: Colors.black54), + ), + children: [ + TableRow( + decoration: BoxDecoration( + color: Colors.white, + ), + children: [ + TableCell( + child: Center( + child: Texts('Description'), + ), + ), + TableCell( + child: Center( + child: Texts('Protein'), + ), + ), + TableCell( + child: Center( + child: Texts( + 'Carbohydrate', + ), + ), + ), + TableCell( + child: Center( + child: Texts('Fat'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Calories\n Per Day'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCal.ceil().toString() + ' Cals'), + ), + ), + TableCell( + child: Center( + child: Texts(cCal.ceil().toString() + ' Cals'), + ), + ), + TableCell( + child: Center( + child: Texts(fCal.ceil().toString() + ' Cals'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Grams Per\n Day'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCalGram.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(cCalGram.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(fCalGram.ceil().toString() + ' gr'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Grams Per\n Meal'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCalMeal.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(cCalMeal.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(fCalMeal.ceil().toString() + ' gr'), + ), + ), + ]), + ], + ), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + + // Texts(pCal.ceil().toString()), + // Texts(cCal.ceil().toString()), + // Texts(fCal.ceil().toString()), + // Texts(pCalGram.ceil().toString()), + // Texts(cCalGram.ceil().toString()), + // Texts(fCalGram.ceil().toString()), + // Texts(pCalMeal.ceil().toString()), + // Texts(cCalMeal.ceil().toString()), + // Texts(fCalMeal.ceil().toString()), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart new file mode 100644 index 00000000..f534416f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -0,0 +1,550 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class IdealBody extends StatefulWidget { + @override + _IdealBodyState createState() => _IdealBodyState(); +} + +class _IdealBodyState extends State { + bool isMale = false; + bool isHeightCm = true; + + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + double heightInches; + double minRange; + double maxRange; + double overWeightBy; + int weight = 0; + double idealWeight = 0; + String dropdownValue; + double calories = 0; + String textResult = ''; + double maxIdealWeight; + double heightFeet; + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void calculateIdealWeight() { + heightInches = height * .39370078740157477; + heightFeet = heightInches / 12; + idealWeight = (50 + 2.3 * (heightInches - 60)); + if (dropdownValue == 'Small(fingers overlap)') { + idealWeight = idealWeight - 10; + } else if (dropdownValue == 'Medium(fingers touch)') { + idealWeight = idealWeight; + } else if (dropdownValue == 'Large(fingers don\'n touch)') { + idealWeight = idealWeight + 10; + } + + maxIdealWeight = (((idealWeight) * 1.1).round() * 100) / 100; + overWeightBy = weight - maxIdealWeight.roundToDouble(); + minRange = ((idealWeight / 1.1) * 10).round() / 10; + maxRange = maxIdealWeight; + idealWeight = idealWeight; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ideal Body Weight', + body: Padding( + padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), + child: SingleChildScrollView( + child: Container( + height: 800.0, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: Texts( + 'Calculates the ideal body weight based on height, Weight, and Body Size', + ), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + Texts( + 'Weight', + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Texts('Body Frame Size'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Small(fingers overlap)', + 'Medium(fingers touch)', + 'Large(fingers don\'n touch)', + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 30.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + // calculateBmr(); + // calculateCalories(); + calculateIdealWeight(); + + print(idealWeight); + //print(overWeightBy); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IdealBodyResult( + idealBodyWeight: idealWeight, + minRange: minRange, + mixRange: maxRange, + overWeightBy: overWeightBy, + textResult: textResult, + )), + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart new file mode 100644 index 00000000..605e499a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart @@ -0,0 +1,170 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +class IdealBodyResult extends StatelessWidget { + final double idealBodyWeight; + final double minRange; + final double mixRange; + final double overWeightBy; + final String textResult; + + IdealBodyResult( + {this.idealBodyWeight, + this.minRange, + this.mixRange, + this.overWeightBy, + this.textResult}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ideal Body Weight', + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'Ideal weight range is', + fontSize: 23.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + children: [ + Texts( + minRange.toStringAsFixed(1), + fontSize: 30.0, + ), + Padding( + padding: EdgeInsets.only(top: 8.0, left: 4.0), + child: Text( + 'Kg', + style: TextStyle(color: Colors.red), + ), + ), + ], + ), + Icon( + Icons.arrow_forward, + color: Colors.red, + size: 55.0, + ), + Row( + children: [ + Texts( + mixRange.toStringAsFixed(1), + fontSize: 30.0, + ), + Padding( + padding: EdgeInsets.only(top: 8.0, left: 4.0), + child: Text( + 'Kg', + style: TextStyle(color: Colors.red), + ), + ), + ], + ), + ], + ), + overWeightBy >= 0 && overWeightBy <= 10 + ? Column( + children: [ + Texts( + 'Congratulations! The current weight is\n perfect and considered healthy', + fontSize: 20.0, + ), + ], + ) + : overWeightBy > 10 && overWeightBy < 17 + ? Column( + children: [ + Texts( + 'This means that the weight is a little bit more than ideal weight by'), + Texts(overWeightBy.toStringAsFixed(1)), + Texts( + 'May wish to consult with the doctor for medical help. Click to view our list of Doctors'), + ], + ) + : overWeightBy >= 18 + ? Container( + height: 250.0, + width: 350, + child: Column( + children: [ + Texts( + 'Means that you suffer from excessive\n obesity by', + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 40.0, + ), + SizedBox( + height: 25.0, + ), + Texts( + 'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), + ], + ), + ) + : overWeightBy < -18 + ? Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Under Weight', + fontSize: 18.0, + ), + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 20.0, + ), + ], + ) + : Container( + height: 250.0, + width: 350.0, + child: Column( + children: [ + Texts( + 'under wheight', + fontSize: 20.0, + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 20.0, + ), + SizedBox( + height: 25.0, + ), + Texts( + 'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), + ], + ), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index 7a48cf9b..9a2f08df 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -96,7 +96,7 @@ class _BloodCholesterolState extends State { children: [ Texts( 'Convert from', - ) + ), ], ), ), diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart new file mode 100644 index 00000000..56fb0428 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -0,0 +1,279 @@ +import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'health_calculator/bmr_calculator/bmr_calculator.dart'; +import 'health_calculator/ideal_body/ideal_body.dart'; + +class HealthCalculators extends StatefulWidget { + @override + _HealthCalculatorsState createState() => _HealthCalculatorsState(); +} + +class _HealthCalculatorsState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Health Calculators', + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(70.0), + child: Stack( + children: [ + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 1.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 5.7, + ), + ), + color: Colors.white, + ), + child: Center( + child: TabBar( + controller: _tabController, + isScrollable: true, + indicatorWeight: 4.0, + indicatorColor: Colors.red, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Colors.grey, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts('General Health'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts("Women's Health"), + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + Container( + child: Column( + children: [ + Container( + width: double.infinity, + height: 80, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage(page: BMICalculator()), + ); + }, + child: MedicalProfileItem( + title: 'BMI', + imagePath: 'bmi_health_calculator.png', + subTitle: 'Calculators', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: CalorieCalculator(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Calories', + imagePath: 'calories-calculator.png', + subTitle: 'Calculators', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BmrCalculator(), + ), + ); + }, + child: MedicalProfileItem( + title: 'BMR', + imagePath: 'BMR_calculator.png', + subTitle: 'Calculators', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: IdealBody(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Ideal Body', + imagePath: 'body_weight.png', + subTitle: 'Weight', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BodyFat(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Body', + imagePath: 'body_fat.png', + subTitle: 'Fat', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: Carbs(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Carbohydrate', + imagePath: 'carb_protein.png', + subTitle: 'Protein Fat', + ), + ), + ), + ], + ), + ], + ), + ), + Container( + child: Column( + children: [ + Container( + width: double.infinity, + height: 80, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // Navigator.push( + // context, + // FadePage(page: BloodSugar()), + // ); + }, + child: MedicalProfileItem( + title: 'Ovulation', + imagePath: 'ovulation_period_icon.png', + subTitle: 'Period', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: BloodCholesterol(), + // ), + // ); + }, + child: MedicalProfileItem( + title: 'Delivery', + imagePath: 'delivery_date_icon.png', + subTitle: 'Due Date', + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..ff2c0a00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -110,6 +110,9 @@ dependencies: #Popup_window popup_box: ^0.1.0 + #Numbers + number_inc_dec: ^0.6.6 + From 84f429e559dddd4f2c18d7c1c88ec7ce37344683 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Oct 2020 12:50:08 +0300 Subject: [PATCH 42/65] merge --- .../all_habib_medical_service_page.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 5cd92898..bc30626e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -220,7 +220,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(page:BloodDonationPage()), + FadePage(page: BloodDonationPage()), ), imageLocation: 'assets/images/new-design/blood_icon.png', title: 'Blood Donation', @@ -288,7 +288,8 @@ class _AllHabibMedicalServiceState extends State { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); }, imageLocation: From 24795e808f5ef4bc1da8924f904bc4666416c409 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 12:56:42 +0300 Subject: [PATCH 43/65] child Vaccines --- .../dialogs/SelectGenderDialog.dart | 85 ++++++++----------- .../ChildVaccines/vaccinationtable_page.dart | 13 ++- 2 files changed, 47 insertions(+), 51 deletions(-) diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 295c6dcd..5eb461c6 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -5,20 +5,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class SelectGenderDialog extends StatefulWidget { - final Gender beneficiaryType; - final Function(Gender) onValueSelected; - - SelectGenderDialog({Key key, this.beneficiaryType, this.onValueSelected}); - @override - _SelectGenderDialogState createState() => - _SelectGenderDialogState(this.beneficiaryType); + _SelectGenderDialogState createState() => _SelectGenderDialogState(); } class _SelectGenderDialogState extends State { - _SelectGenderDialogState(this.beneficiaryType); - Gender beneficiaryType; - @override Widget build(BuildContext context) { return SimpleDialog( @@ -34,21 +25,12 @@ class _SelectGenderDialogState extends State { child: InkWell( onTap: () { setState(() { - beneficiaryType = Gender.Male; + //beneficiaryType = Gender.Male; }); }, child: ListTile( - title: Text("Male"), - leading: Radio( - value: Gender.Male, - groupValue: beneficiaryType, - activeColor: Colors.red[800], - onChanged: (Gender value) { - setState(() { - beneficiaryType = value; - }); - }, - ), + title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), + ), ), ) @@ -57,33 +39,33 @@ class _SelectGenderDialogState extends State { SizedBox( height: 5.0, ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - beneficiaryType = Gender.Female; - }); - }, - child: ListTile( - title: Text("Female"), - leading: Radio( - value: Gender.Female, - groupValue: beneficiaryType, - activeColor: Colors.red[800], - onChanged: (Gender value) { - setState(() { - beneficiaryType = value; - }); - }, - ), - ), - ), - ) - ], - ), + // Row( + // children: [ + // Expanded( + // flex: 1, + // child: InkWell( + // onTap: () { + // setState(() { + // beneficiaryType = Gender.Female; + // }); + // }, + // child: ListTile( + // title: Text("Female"), + // leading: Radio( + // value: Gender.Female, + // groupValue: beneficiaryType, + // activeColor: Colors.red[800], + // onChanged: (Gender value) { + // setState(() { + // beneficiaryType = value; + // }); + // }, + // ), + // ), + // ), + // ) + // ], + // ), SizedBox( height: 5.0, ), @@ -121,7 +103,7 @@ class _SelectGenderDialogState extends State { flex: 1, child: InkWell( onTap: () { - widget.onValueSelected(beneficiaryType); + // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, child: Padding( @@ -143,4 +125,7 @@ class _SelectGenderDialogState extends State { ], ); } + + + } diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 952cfb0c..6ac11e4f 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -9,6 +9,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'dialogs/SelectGenderDialog.dart'; + class VaccinationTablePage extends StatelessWidget { @override Widget build(BuildContext context) { @@ -142,7 +144,16 @@ class VaccinationTablePage extends StatelessWidget { color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), label: "Send Email ", // - onTap: () {} + onTap: () { + //SelectGenderDialog(); +//=============== + showDialog( + context: context, + child: SelectGenderDialog( + ), + ); + //========= + } ), From 8f18d1025ac4a043157a073edc942a23c08c201d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 7 Oct 2020 15:11:52 +0300 Subject: [PATCH 44/65] voice search --- lib/config/shared_pref_kay.dart | 1 + lib/pages/MyAppointments/MyAppointments.dart | 24 +- lib/pages/login/confirm-login.dart | 536 +++++++++--------- .../authentication/auth_provider.dart | 62 +- lib/widgets/drawer/app_drawer_widget.dart | 1 - .../others/floating_button_search.dart | 299 ++++++++-- 6 files changed, 559 insertions(+), 364 deletions(-) diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 61e36022..d987ef96 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -14,3 +14,4 @@ const FAMILY_FILE = 'family-file'; const USER_LAT = 'user-lat'; const USER_LONG = 'user-long'; const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING'; +const IS_SEARCH_APPO = 'is-search-appo'; diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index aa0e7d98..379c6e71 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; @@ -30,7 +32,7 @@ class _MyAppointmentsState extends State TabController _tabController; bool isDataLoaded = false; - + var sharedPref = new AppSharedPreferences(); @override void initState() { _tabController = new TabController(length: 3, vsync: this); @@ -203,14 +205,24 @@ class _MyAppointmentsState extends State }); } - openAppointmentsTab() { - if (widget._patientBookedAppointmentListHospital.length != 0) { + openAppointmentsTab() async { + var flag = await this.sharedPref.getInt(IS_SEARCH_APPO); + + if (flag == 1) { _tabController.index = 0; - } else if (widget._patientConfirmedAppointmentListHospital.length != 0) { + } else if (flag == 2) { _tabController.index = 1; - } else if (widget._patientArrivedAppointmentListHospital.length != 0) { + } else if (flag == 3) { _tabController.index = 2; - return; + } else { + if (widget._patientBookedAppointmentListHospital.length != 0) { + _tabController.index = 0; + } else if (widget._patientConfirmedAppointmentListHospital.length != 0) { + _tabController.index = 1; + } else if (widget._patientArrivedAppointmentListHospital.length != 0) { + _tabController.index = 2; + return; + } } } diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index cc3ed1e8..5b4124b4 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -22,6 +22,7 @@ import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; + class ConfirmLogin extends StatefulWidget { @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -74,182 +75,170 @@ class _ConfirmLogin extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, - body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.all(20), - height: SizeConfig.realScreenHeight * .9, - width: SizeConfig.realScreenWidth, - child: Column( - children: [ - Expanded( - flex: 3, - child: user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 80, - width: 80, - ), - AppText( - TranslationBase.of(context) - .welcomeBack + - ' ' + - user.name, - fontSize: SizeConfig.textMultiplier * 3.5, - ), - AppText( - TranslationBase.of(context).accountInfo, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - Card( - color: Colors.grey[300], - child: Row( - children: [ - Expanded( - child: ListTile( - title: Text( - TranslationBase.of(context) - .lastLoginAt, - textAlign: TextAlign.center, - ), - subtitle: Text( - user.editedOn != null - ? formatDate(DateUtil - .convertStringToDate( - user.editedOn)) - : '--', - textAlign: - TextAlign.center), - )), - Expanded( - child: ListTile( - title: Text( - TranslationBase.of(context) - .lastLoginWith, - textAlign: - TextAlign.center), - subtitle: Text( - getType(user.logInType, - context), - textAlign: - TextAlign.center), - )) - ], - )) - ], - ) - : Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 80, - width: 80, - ), - this.onlySMSBox == false - ? AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: - SizeConfig.textMultiplier * - 3.5, - textAlign: TextAlign.left, - ) - : AppText( + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(20), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column( + children: [ + Expanded( + flex: 3, + child: user != null && isMoreOption == false + ? Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 80, + width: 80, + ), + AppText( + TranslationBase.of(context).welcomeBack + + ' ' + + user.name, + fontSize: SizeConfig.textMultiplier * 3.5, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + Card( + color: Colors.grey[300], + child: Row( + children: [ + Expanded( + child: ListTile( + title: Text( + TranslationBase.of(context) + .lastLoginAt, + textAlign: TextAlign.center, + ), + subtitle: Text( + user.editedOn != null + ? formatDate(DateUtil + .convertStringToDate( + user.editedOn)) + : '--', + textAlign: TextAlign.center), + )), + Expanded( + child: ListTile( + title: Text( TranslationBase.of(context) - .verifyFingerprint2, - fontSize: - SizeConfig.textMultiplier * - 2.5, - textAlign: TextAlign.left, - ), - ])), - user != null && isMoreOption == false - ? Expanded( - flex: 2, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( + .lastLoginWith, + textAlign: TextAlign.center), + subtitle: Text( + getType( + user.logInType, context), + textAlign: TextAlign.center), + )) + ], + )) + ], + ) + : Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 80, + width: 80, + ), + this.onlySMSBox == false + ? AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: + SizeConfig.textMultiplier * 3.5, + textAlign: TextAlign.left, + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: + SizeConfig.textMultiplier * 2.5, + textAlign: TextAlign.left, + ), + ])), + user != null && isMoreOption == false + ? Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + authenticateUser( + 3, + BiometricType + .face.index) + }, + child: + getButton(user.logInType))), + Expanded(child: getButton(5)) + ]) + ])) + : Expanded( + flex: 4, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded( - child: InkWell( - onTap: () => { - authenticateUser( - 3, - BiometricType - .face.index) - }, - child: getButton( - user.logInType))), - Expanded(child: getButton(5)) - ]) - ])) - : Expanded( - flex: 4, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + Expanded(child: getButton(3)), + Expanded(child: getButton(2)) + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded(child: getButton(3)), - Expanded(child: getButton(2)) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded(child: getButton(1)), - Expanded(child: getButton(4)) - ], - ), - ]), - ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - user != null - ? Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context) - .useAnotherAccount, - () => { - Navigator.of(context).pushNamed( - LOGIN_TYPE, - ) - }, - )), - ], - ) - : SizedBox(), - ], - )) - ], - ))) - ); + Expanded(child: getButton(1)), + Expanded(child: getButton(4)) + ], + ), + ]), + ), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + user != null + ? Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context) + .useAnotherAccount, + () => { + Navigator.of(context).pushNamed( + LOGIN_TYPE, + ) + }, + )), + ], + ) + : SizedBox(), + ], + )) + ], + )))); } Future _getAvailableBiometrics() async { @@ -313,38 +302,39 @@ class _ConfirmLogin extends State { var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); - authService.checkPatientAuthentication(request).then((value) => { - if (value['isSMSSent']) - { - sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), - this.loginTokenID = value['LogInTokenID'], - sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), - // Future.delayed(Duration(seconds: 1), () { - this.sendActivationCode(type) - // }) - } - else - { - if (value['IsAuthenticated']) {this.checkActivationCode()} - } - }).catchError((err) { + authService + .checkPatientAuthentication(request) + .then((value) => { + if (value['isSMSSent']) + { + sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), + this.loginTokenID = value['LogInTokenID'], + sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), + // Future.delayed(Duration(seconds: 1), () { + this.sendActivationCode(type) + // }) + } + else + { + if (value['IsAuthenticated']) {this.checkActivationCode()} + } + }) + .catchError((err) { print(err); }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } - sendActivationCode(type) { + sendActivationCode(type) async { var request = this.getCommonRequest(); - // loading(true); - this.authService.sendActivationCode(request).then((result) => { - if (result != null && result['isSMSSent'] == true) - {loading(false), this.startSMSService(type)} - else - {loading(false)} - }).catchError((err) { - print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + // loading(true); + + await this.authService.sendActivationCode(request).then((result) => { + if (result != null && result['isSMSSent'] == true) + {this.startSMSService(type)} + }); + + // SMSOTP.showLoadingDialog(context, false), } @@ -376,45 +366,50 @@ class _ConfirmLogin extends State { } getMobileInfo(request) { - this.authService.getLoginInfo(request).then((result) => { - if (result['SMSLoginRequired'] == false) - { - this.loginTokenID = result.logInTokenID, - this.patientOutSA = result.patientOutSA, - // sms for register the biometric - if (result.isSMSSent) + this + .authService + .getLoginInfo(request) + .then((result) => { + if (result['SMSLoginRequired'] == false) { - this.onlySMSBox = false, - //this.button(); + this.loginTokenID = result.logInTokenID, + this.patientOutSA = result.patientOutSA, + // sms for register the biometric + if (result.isSMSSent) + { + this.onlySMSBox = false, + //this.button(); + } + else + {checkActivationCode()} } else - {checkActivationCode()} - } - else - { - if (result['IsAuthenticated'] == true) { - setState(() { - isMoreOption = true; - this.onlySMSBox = true; - // this.fingrePrintBefore = true; - }), - - //sharedPref.setBool(ONLY_SMS, true), - // this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS); - //this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE); - // this.cs.confirmLogin(); - //this.button(); + if (result['IsAuthenticated'] == true) + { + setState(() { + isMoreOption = true; + this.onlySMSBox = true; + // this.fingrePrintBefore = true; + }), + + //sharedPref.setBool(ONLY_SMS, true), + // this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS); + //this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE); + // this.cs.confirmLogin(); + //this.button(); + } + // else + // { + // // this.cs.presentAlert(result.ErrorEndUserMessage); + // } } - // else - // { - // // this.cs.presentAlert(result.ErrorEndUserMessage); - // } - } - }).catchError((err) { + }) + .catchError((err) { print(err); }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));; + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + ; } setUser() async {} @@ -435,9 +430,13 @@ class _ConfirmLogin extends State { : int.parse(this.user.mobile); this.zipCode = this.registerd_data != null ? this.registerd_data.zipCode - : this.user.outSA == true ? "971" : "966"; + : this.user.outSA == true + ? "971" + : "966"; this.patientOutSA = this.registerd_data != null - ? this.registerd_data.zipCode == "966" ? 0 : 1 + ? this.registerd_data.zipCode == "966" + ? 0 + : 1 : this.user.outSA; if (this.registerd_data != null) { this.loginTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); @@ -485,46 +484,51 @@ class _ConfirmLogin extends State { SMSOTP.showLoadingDialog(context, true); var request = this.getCommonRequest().toJson(); - this.authService.checkActivationCode(request, value).then((result) => { - if (result is Map) - { - result = CheckActivationCode.fromJson(result), - if (this.registerd_data != null && - this.registerd_data.isRegister == true) + this + .authService + .checkActivationCode(request, value) + .then((result) => { + if (result is Map) { - Navigator.of(context).pushNamed( - REGISTER_INFO, - ) + result = CheckActivationCode.fromJson(result), + if (this.registerd_data != null && + this.registerd_data.isRegister == true) + { + Navigator.of(context).pushNamed( + REGISTER_INFO, + ) + } + else + { + this.userData = result + .list, //AuthenticatedUser.fromJson(result['List'][0]), + this.sharedPref.setObject(USER_PROFILE, result.list), + this.loginTokenID = result.logInTokenID, + this + .sharedPref + .setObject(LOGIN_TOKEN_ID, result.logInTokenID), + this + .sharedPref + .setString(TOKEN, result.authenticationTokenID), + this.checkIfUserAgreedBefore(result), + // Navigator.of(context).pop(), + SMSOTP.showLoadingDialog(context, false), + } } else { - this.userData = result - .list, //AuthenticatedUser.fromJson(result['List'][0]), - this.sharedPref.setObject(USER_PROFILE, result.list), - this.loginTokenID = result.logInTokenID, - this - .sharedPref - .setObject(LOGIN_TOKEN_ID, result.logInTokenID), - this - .sharedPref - .setString(TOKEN, result.authenticationTokenID), - this.checkIfUserAgreedBefore(result), // Navigator.of(context).pop(), SMSOTP.showLoadingDialog(context, false), + Future.delayed(Duration(seconds: 1), () { + AppToast.showErrorToast(message: result); + }), } - } - else - { - // Navigator.of(context).pop(), - SMSOTP.showLoadingDialog(context, false), - Future.delayed(Duration(seconds: 1), () { - AppToast.showErrorToast(message: result); - }), - } - }).catchError((err) { + }) + .catchError((err) { print(err); }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));; + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + ; } checkIfUserAgreedBefore(CheckActivationCode result) { @@ -537,7 +541,10 @@ class _ConfirmLogin extends State { } insertIMEI() { - authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { + authService + .insertDeviceImei(selectedOption) + .then((value) => {goToHome()}) + .catchError((err) { print(err); }); } @@ -545,7 +552,6 @@ class _ConfirmLogin extends State { goToHome() { // authService.insertDeviceImei().then((value) => print(value)); Navigator.of(context).pushNamed(HOME); - } loading(flag) { diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 1598184c..6d8c00e2 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -156,19 +156,15 @@ class AuthProvider with ChangeNotifier { request.generalid = GENERAL_ID; request.languageID = LANGUAGE_ID; request.patientOutSA = request.zipCode == '966' ? 0 : 1; - try { - dynamic localRes; - await new BaseAppClient().post(CHECK_PATIENT_AUTH, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request.toJson()); - return Future.value(localRes); - } catch (error) { - print(error); + + dynamic localRes; + await new BaseAppClient().post(CHECK_PATIENT_AUTH, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { throw error; - } + }, body: request.toJson()); + return Future.value(localRes); } Future getLoginInfo(request) async { @@ -180,19 +176,15 @@ class AuthProvider with ChangeNotifier { request.deviceTypeID = DeviceTypeID; request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.isDentalAllowedBackend = false; - try { - dynamic localRes; - await new BaseAppClient().post(GET_MOBILE_INFO, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request.toJson()); - return Future.value(localRes); - } catch (error) { - print(error); + + dynamic localRes; + await new BaseAppClient().post(GET_MOBILE_INFO, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { throw error; - } + }, body: request.toJson()); + return Future.value(localRes); } Future sendActivationCode(request) async { @@ -204,20 +196,16 @@ class AuthProvider with ChangeNotifier { request.deviceTypeID = DeviceTypeID; request.patientOutSA = request.zipCode == '966' ? 0 : 1; request.isDentalAllowedBackend = false; - try { - dynamic localRes; - await new BaseAppClient().post(SEND_ACTIVATION_CODE, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - authenticatedUser = CheckActivationCode.fromJson(localRes); - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request.toJson()); - return Future.value(localRes); - } catch (error) { - print(error); + + dynamic localRes; + await new BaseAppClient().post(SEND_ACTIVATION_CODE, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + authenticatedUser = CheckActivationCode.fromJson(localRes); + }, onFailure: (String error, int statusCode) { throw error; - } + }, body: request.toJson()); + return Future.value(localRes); } Future checkActivationCode(request, [value]) async { diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 3c5ac608..ce1397f8 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -323,7 +323,6 @@ class _AppDrawerState extends State { await this.sharedPref.getObject(USER_PROFILE)); setState(() { this.user = data; - print(this.user); }); } } diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 2d5b6071..b8c8c916 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -1,27 +1,44 @@ import 'dart:collection'; +import 'dart:io'; import 'dart:math'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; +import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/ErService/AmbulanceReq.dart'; +import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/NearestEr.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/pages/login/welcome.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; +import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; @@ -30,6 +47,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; @@ -38,6 +56,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/cupertino.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @override @@ -67,11 +86,12 @@ class _FloatingSearchButton extends State bool isSearching = false; Map results = {}; String lastStatus; - + AuthenticatedUser user; bool _isInit = true; var event = RobotProvider(); - + var sharedPref = new AppSharedPreferences(); bool _hasSpeech = false; + ProjectViewModel projectProvider; @override void initState() { super.initState(); @@ -83,14 +103,17 @@ class _FloatingSearchButton extends State }); } }); + requestPermissions(); // Future.delayed(const Duration(seconds: 10), () { initSpeechState().then((value) => {}); + getUserData(); // }); } @override Widget build(BuildContext context) { + projectProvider = Provider.of(context); return AnimatedPositioned( onEnd: () { // setState(() { @@ -156,7 +179,9 @@ class _FloatingSearchButton extends State child: GestureDetector( onTap: () { setState(() { - activeAnimation = true; + if (this.mounted) { + activeAnimation = true; + } }); }, child: Align( @@ -169,45 +194,7 @@ class _FloatingSearchButton extends State ), ), ), - ]) - - // Stack( - // fit: StackFit.loose, - // overflow: Overflow.visible, - // children: [ - // Container(), - // Positioned( - // child: GestureDetector( - // behavior: HitTestBehavior.translucent, - // onTapDown: (TapDownDetails details) => { - // setState(() { - // activeAnimation = true; - // }) - // }, // handle your image tap here - // child: Image.asset( - // 'assets/images/CloseIcon.png', - // fit: BoxFit.cover, // this is the solution for border - // width: 30.0, - // height: 30.0, - // ), - // )), - // Positioned( - // child: GestureDetector( - // onTap: () { - // this.roboSearch(context); - // }, // handle your image tap here - // child: SvgPicture.asset('assets/images/robort_svg.svg'))) - - // // new RawMaterialButton( - // // // shape: new CircleBorder(), - // // elevation: 1.0, - // // child: SvgPicture.asset('assets/images/robort_svg.svg'), - // // onPressed: () {}, - // // ), - // ], - // ) - - ); + ])); } startVoiceSearch() async { @@ -232,12 +219,11 @@ class _FloatingSearchButton extends State if (result.finalResult == true) { // setState(() { - reconizedWord = result.recognizedWords; event.setValue({"searchText": reconizedWord}); - setState(() { - searchText = reconizedWord; - }); + // setState(() { + // searchText = reconizedWord; + // }); Future.delayed(const Duration(seconds: 1), () { _speak(reconizedWord); }); @@ -278,9 +264,9 @@ class _FloatingSearchButton extends State } if (!mounted) return; - setState(() { - _hasSpeech = hasSpeech; - }); + // setState(() { + // _hasSpeech = hasSpeech; + // }); } void errorListener(SpeechRecognitionError error) { @@ -402,6 +388,19 @@ class _FloatingSearchButton extends State } } break; + case '104': + { + List clnicID = unique(result['ClinicId']); + //= result['ProjectId'] ? result['ProjectId'] : 0; //result['ProjectId']; + + if (clnicID.length == 1) { + getDoctorsList(result['ProjectId'], clnicID[0], context, + doctorId: null, doctorName: null, isNearest: true); + } else { + goToClinic(clnicID); + } + } + break; case '4': { Navigator.push(context, FadePage(page: LabsHomePage())); @@ -483,11 +482,193 @@ class _FloatingSearchButton extends State } break; case '16': + { + Navigator.push(context, FadePage(page: MyBalancePage())); + } + break; + case '17': + { + Navigator.push(context, FadePage(page: MedicalProfilePage())); + } + break; + case '18': + { + //Drivethrough need to be implemeted here. + + } + break; + case '19': { Navigator.push(context, FadePage(page: LiveCareHome())); } break; + case '20': + { + //CMC service need to be implemeted + } + break; + case '21': + { + Navigator.push(context, FadePage(page: MyFamily())); + } + break; + case '22': + { + Navigator.push(context, FadePage(page: BloodDonationPage())); + } + break; + case '23': + { + //health calculator need to be implemeted + } + break; + case '24': + { + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); + } + break; + case '25': + { + if (user == null) { + Navigator.push(context, FadePage(page: WelcomeLogin())); + } + } + break; + case '26': + { + Navigator.push(context, FadePage(page: ParkingPage())); + } + break; + case '27': + { + Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))); + } + break; + case '28': + { + Navigator.push(context, FadePage(page: AmbulanceReq())); + } + break; + case '29': + { + Navigator.push(context, FadePage(page: FindUsPage())); + } + break; + case '30': + { + launch("tel://" + result['PhoneNumbers'][0]); + } + break; + case '31': + { + Navigator.of(context).popUntil(ModalRoute.withName('/')); + } + break; + case '32': + { + Navigator.push(context, FadePage(page: AdvancePaymentPage())); + } + break; + case '33': + { + if (result['LanguageCode'] != '0') { + if (projectProvider.isArabic) { + projectProvider.changeLanguage('en'); + } else { + projectProvider.changeLanguage('ar'); + } + } + } + break; + case '34': + { + //settings page need to be implemented here + } + break; + case '35': + { + if (Platform.isIOS) { + launch( + "https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); + } else { + launch( + "https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"); + } + } + break; + case '36': + { + Navigator.of(context).pushNamed( + REGISTER, + ); + } + break; + case '37': + { + Navigator.of(context).pushNamed( + SYMPTOM_CHECKER, + ); + } + break; + case '38': + { + await this.sharedPref.setInt(IS_SEARCH_APPO, 1); + Navigator.push(context, FadePage(page: MyAppointments())); + } + break; + case '39': + { + await this.sharedPref.setInt(IS_SEARCH_APPO, 2); + Navigator.push(context, FadePage(page: MyAppointments())); + } + break; + case '40': + { + //Home health care service need to be implemeted here + } + break; + case '41': + { + Navigator.push(context, FadePage(page: PaymentService())); + } + break; + case '42': + { + //weather indicator need to be implemented here + } + break; + case '43': + { + await this.sharedPref.setInt(IS_SEARCH_APPO, 3); + Navigator.push(context, FadePage(page: MyAppointments())); + } + break; + case '44': + { + //chat need be implmented here. + } + break; + case '45': + { + launch('https://hmg.com/ir/ar/Pages/ShareInformation/home.aspx'); + } + break; + case '46': + { + launch('https://hmg.com/ir/ar/pages/home.aspx'); + } + break; case '200': { Navigator.push(context, FadePage(page: FeedbackHomePage())); @@ -499,8 +680,6 @@ class _FloatingSearchButton extends State speak(); break; } - - //searchProvider.setLisener(result); } getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { @@ -526,13 +705,14 @@ class _FloatingSearchButton extends State }); } - getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { + getDoctorsList(projectId, clinicId, context, + {doctorId, doctorName, isNearest = false}) { List doctorsList = []; List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); service - .getDoctorsList(clinicId, projectId, false, context, + .getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName) .then((res) { if (res['MessageStatus'] == 1) { @@ -620,8 +800,8 @@ class _FloatingSearchButton extends State speak() async { if (_currentLocaleId == 'en-US' && results['ReturnMessage'] != null) { - await flutterTts.setVoice("en-us-x-sfg#male_2-local"); - await flutterTts.setLanguage(_currentLocaleId); + await flutterTts.setVoice("en-us-x-sfg#male_2-local"); + await flutterTts.setLanguage(_currentLocaleId); await flutterTts.speak(results['ReturnMessage']); } else if (results['ReturnMessage_Ar'] != null) { await flutterTts.setLanguage(_currentLocaleId); @@ -648,4 +828,13 @@ class _FloatingSearchButton extends State List unique(List list) { return list.toSet().toList(); } + + getUserData() async { + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + setState(() async { + user = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + }); + } + } } From 7b6135a6c7f449e1b962e98bd31e337d1fd48f9a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 7 Oct 2020 15:39:23 +0300 Subject: [PATCH 45/65] voice search --- .../​ health_calculators.dart | 4 ++-- lib/widgets/drawer/app_drawer_widget.dart | 19 ++++++++++--------- .../others/floating_button_search.dart | 6 +++++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index 56fb0428..e49b1142 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -1,6 +1,6 @@ -import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index ce1397f8..42d21e7a 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -7,14 +7,13 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/list/flexible_container.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - +import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../../config/size_config.dart'; import 'drawer_item_widget.dart'; @@ -328,12 +327,7 @@ class _AppDrawerState extends State { } logout() async { - // this.sharedPref.remove(USER_PROFILE); - // this.sharedPref.remove(IMEI_USER_DATA); - // this.sharedPref.remove(TOKEN); - // this.sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.clear(); - this.user = null; Navigator.of(context).pushNamed(HOME); } @@ -365,7 +359,14 @@ class _AppDrawerState extends State { this .familyFileProvider .silentLoggin(user) - .then((value) => loginAfter(value, context)); + .then((value) => loginAfter(value, context)) + .catchError((err) { + print(err); + AppToast.showErrorToast(message: err); + Navigator.of(context).pop(); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + ; } loginAfter(result, context) { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index b8c8c916..92baa9d5 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -121,7 +121,11 @@ class _FloatingSearchButton extends State // position = Offset(250, 400); // }); }, - left: activeAnimation ? 300 : position.dx, + left: activeAnimation + ? TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' + ? 300 + : 0 + : position.dx, top: activeAnimation ? -150 : position.dy, duration: activeAnimation ? const Duration(seconds: 1) From cb2a78e2ee721f07974fb91065ae400db1ed750e Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Wed, 7 Oct 2020 16:17:16 +0300 Subject: [PATCH 46/65] child Vaccines --- .../get_vacainations_itemsmodel.dart | 18 +++++++++ .../get_vaccinations_item_services.dart | 38 +++++++++++++++++++ .../ChildVaccines/add_newchild_page.dart | 18 +-------- lib/pages/ChildVaccines/child_page.dart | 6 --- .../dialogs/SelectGenderDialog.dart | 28 +------------- 5 files changed, 58 insertions(+), 50 deletions(-) create mode 100644 lib/core/model/childvaccines/get_vacainations_itemsmodel.dart create mode 100644 lib/core/service/childvaccines/get_vaccinations_item_services.dart diff --git a/lib/core/model/childvaccines/get_vacainations_itemsmodel.dart b/lib/core/model/childvaccines/get_vacainations_itemsmodel.dart new file mode 100644 index 00000000..14891852 --- /dev/null +++ b/lib/core/model/childvaccines/get_vacainations_itemsmodel.dart @@ -0,0 +1,18 @@ +class GET_VACCINATIONS_ITEMSMODEL { + String dESCRIPTION; + String iTEMCODE; + + GET_VACCINATIONS_ITEMSMODEL({this.dESCRIPTION, this.iTEMCODE}); + + GET_VACCINATIONS_ITEMSMODEL.fromJson(Map json) { + dESCRIPTION = json['DESCRIPTION']; + iTEMCODE = json['ITEM_CODE']; + } + + Map toJson() { + final Map data = new Map(); + data['DESCRIPTION'] = this.dESCRIPTION; + data['ITEM_CODE'] = this.iTEMCODE; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/get_vaccinations_item_services.dart b/lib/core/service/childvaccines/get_vaccinations_item_services.dart new file mode 100644 index 00000000..f7fe4662 --- /dev/null +++ b/lib/core/service/childvaccines/get_vaccinations_item_services.dart @@ -0,0 +1,38 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/get_vacainations_itemsmodel.dart'; + +import '../base_service.dart'; + +class GetVccinationsItemsService extends BaseService { + List getVaccinationsItemModelList = List(); + Map body = Map(); + + + + Future getaccinationsitemOrders() async { + hasError = false; + // await getUser(); + // body['BabyName']="fffffffffff eeeeeeeeeeeeee"; + // body['DOB'] = "/Date(1585774800000+0300)/"; + // body['EmailAddress'] = user.emailAddress; + // body['isDentalAllowedBackend'] = false; + // body['SendEmail'] = false; + // body['IsLogin'] =true; + + + + + await baseAppClient.post(GET_TABLE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + getVaccinationsItemModelList.clear(); + response['List_CreateVaccinationTableModel'].forEach((vital) { + getVaccinationsItemModelList.add( + GET_VACCINATIONS_ITEMSMODEL.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index a24fa5a4..f2970cad 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -274,19 +274,7 @@ class _AddNewChildPageState extends State { model.getNewBabyOrders(newChild: newChild); - //DateTime.now();//DateUtil.convertStringToDate(getStartDay()); - // addvancedModel.alertBy = 2; - // addvancedModel.alertBy = addvancedModel.babyID; - // addvancedModel.genderDescription = - // checkedValue == 1 ? "Male" : "Female"; - // addvancedModel.patientID = addvancedModel.patientID; - // addvancedModel.userID = addvancedModel.userID; - // // advanceModel.fileNumber = _fileTextController.text; - // // advanceModel.hospitalsModel = _selectedHospital; - // // advanceModel.note = _notesTextController.text; - // // advanceModel.email = email ?? model.user.emailAddress; - // // advanceModel.amount = amount; - // // bloodDetails.city=_selectedHospital.toString(); + AppToast.showSuccessToast(message: "Record Added"); //============ Navigator.push( @@ -294,10 +282,6 @@ class _AddNewChildPageState extends State { FadePage( page: ChildPage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) ), ); //============== diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index c657b3ca..6a937aad 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -12,9 +12,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class ChildPage extends StatefulWidget { -//final List babyInformationModelList; - // ChildPage({Key key, this.babyInformationModelList}) ; @override _ChildPageState createState() => _ChildPageState(); @@ -139,10 +137,6 @@ class _ChildPageState extends State with SingleTickerProviderStateMix FadePage( page: AddNewChildPage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) ), ), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 5eb461c6..f84dea29 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -39,33 +39,7 @@ class _SelectGenderDialogState extends State { SizedBox( height: 5.0, ), - // Row( - // children: [ - // Expanded( - // flex: 1, - // child: InkWell( - // onTap: () { - // setState(() { - // beneficiaryType = Gender.Female; - // }); - // }, - // child: ListTile( - // title: Text("Female"), - // leading: Radio( - // value: Gender.Female, - // groupValue: beneficiaryType, - // activeColor: Colors.red[800], - // onChanged: (Gender value) { - // setState(() { - // beneficiaryType = value; - // }); - // }, - // ), - // ), - // ), - // ) - // ], - // ), + SizedBox( height: 5.0, ), From 67e3a13a95c010e1a343696cae2a4dbaf77996f5 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Thu, 8 Oct 2020 16:34:27 +0300 Subject: [PATCH 47/65] child Vaccines add new child modified --- lib/config/config.dart | 8 +- .../childvaccines/create_new_user_model.dart | 165 ++++++++++ .../childvaccines/add_new_child_service.dart | 41 ++- .../childvaccines/child_vaccines_service.dart | 39 ++- .../get_vaccinations_item_services.dart | 11 - .../user_information_service.dart | 50 ++- .../add_new_child_view_model.dart | 32 +- .../child_vaccines_view_model.dart | 16 +- .../user_information_view_model.dart | 4 +- lib/locator.dart | 1 + .../ChildVaccines/add_newchild_page.dart | 74 ++--- lib/pages/ChildVaccines/child_page.dart | 285 ++++++++++-------- .../ChildVaccines/child_vaccines_page.dart | 7 +- 13 files changed, 473 insertions(+), 260 deletions(-) create mode 100644 lib/core/model/childvaccines/create_new_user_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 2f497de2..e45d5cf8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -69,14 +69,16 @@ const GET_FINDUS_REQUEST= const GET_LIVECHAT_REQUEST= 'Services/Patients.svc/REST/GetPatientICProjects'; -///babyInformation -const GET_BABYINFORMATION_REQUEST= - 'Services/Community.svc/REST/GetBabyByUserID'; +///Get Baby By User ID +const GET_BABY_BY_USER_ID= 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation const GET_USERINFORMATION_REQUEST= 'Services/Community.svc/REST/GetUserInformation_New'; +///newUserId +const GET_NEW_USER_REQUEST= + 'Services/Community.svc/REST/CreateNewUser_New'; ///addNewChild const GET_NEWCHILD_REQUEST= diff --git a/lib/core/model/childvaccines/create_new_user_model.dart b/lib/core/model/childvaccines/create_new_user_model.dart new file mode 100644 index 00000000..980567e2 --- /dev/null +++ b/lib/core/model/childvaccines/create_new_user_model.dart @@ -0,0 +1,165 @@ +class CreateNewUser_New { + Null date; + int languageID; + int serviceName; + Null time; + Null androidLink; + Null authenticationTokenID; + Null data; + bool dataw; + int dietType; + Null errorCode; + Null errorEndUserMessage; + Null errorEndUserMessageN; + Null errorMessage; + int errorType; + int foodCategory; + Null iOSLink; + bool isAuthenticated; + int mealOrderStatus; + int mealType; + int messageStatus; + int numberOfResultRecords; + Null patientBlodType; + Null successMsg; + Null successMsgN; + Null htmlResult; + bool isHMGPatient; + bool isRegister; + bool isSendSMS; + Null listBabyInformationModel; + Null listBabyNeedReminderModel; + Null listCreateVaccinationTableModel; + Null listHisPatientModel; + Null listUserInformationModel; + Null listUserInformationModelNew; + Null listVaccinationTableModel; + Null tokinID; + int userID; + Null verificationCode; + + CreateNewUser_New( + {this.date, + this.languageID, + this.serviceName, + this.time, + this.androidLink, + this.authenticationTokenID, + this.data, + this.dataw, + this.dietType, + this.errorCode, + this.errorEndUserMessage, + this.errorEndUserMessageN, + this.errorMessage, + this.errorType, + this.foodCategory, + this.iOSLink, + this.isAuthenticated, + this.mealOrderStatus, + this.mealType, + this.messageStatus, + this.numberOfResultRecords, + this.patientBlodType, + this.successMsg, + this.successMsgN, + this.htmlResult, + this.isHMGPatient, + this.isRegister, + this.isSendSMS, + this.listBabyInformationModel, + this.listBabyNeedReminderModel, + this.listCreateVaccinationTableModel, + this.listHisPatientModel, + this.listUserInformationModel, + this.listUserInformationModelNew, + this.listVaccinationTableModel, + this.tokinID, + this.userID, + this.verificationCode}); + + CreateNewUser_New.fromJson(Map json) { + date = json['Date']; + languageID = json['LanguageID']; + serviceName = json['ServiceName']; + time = json['Time']; + androidLink = json['AndroidLink']; + authenticationTokenID = json['AuthenticationTokenID']; + data = json['Data']; + dataw = json['Dataw']; + dietType = json['DietType']; + errorCode = json['ErrorCode']; + errorEndUserMessage = json['ErrorEndUserMessage']; + errorEndUserMessageN = json['ErrorEndUserMessageN']; + errorMessage = json['ErrorMessage']; + errorType = json['ErrorType']; + foodCategory = json['FoodCategory']; + iOSLink = json['IOSLink']; + isAuthenticated = json['IsAuthenticated']; + mealOrderStatus = json['MealOrderStatus']; + mealType = json['MealType']; + messageStatus = json['MessageStatus']; + numberOfResultRecords = json['NumberOfResultRecords']; + patientBlodType = json['PatientBlodType']; + successMsg = json['SuccessMsg']; + successMsgN = json['SuccessMsgN']; + htmlResult = json['HtmlResult']; + isHMGPatient = json['IsHMGPatient']; + isRegister = json['IsRegister']; + isSendSMS = json['IsSendSMS']; + listBabyInformationModel = json['List_BabyInformationModel']; + listBabyNeedReminderModel = json['List_BabyNeedReminderModel']; + listCreateVaccinationTableModel = json['List_CreateVaccinationTableModel']; + listHisPatientModel = json['List_His_PatientModel']; + listUserInformationModel = json['List_UserInformationModel']; + listUserInformationModelNew = json['List_UserInformationModel_New']; + listVaccinationTableModel = json['List_VaccinationTableModel']; + tokinID = json['TokinID']; + userID = json['UserID']; + verificationCode = json['VerificationCode']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['LanguageID'] = this.languageID; + data['ServiceName'] = this.serviceName; + data['Time'] = this.time; + data['AndroidLink'] = this.androidLink; + data['AuthenticationTokenID'] = this.authenticationTokenID; + data['Data'] = this.data; + data['Dataw'] = this.dataw; + data['DietType'] = this.dietType; + data['ErrorCode'] = this.errorCode; + data['ErrorEndUserMessage'] = this.errorEndUserMessage; + data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; + data['ErrorMessage'] = this.errorMessage; + data['ErrorType'] = this.errorType; + data['FoodCategory'] = this.foodCategory; + data['IOSLink'] = this.iOSLink; + data['IsAuthenticated'] = this.isAuthenticated; + data['MealOrderStatus'] = this.mealOrderStatus; + data['MealType'] = this.mealType; + data['MessageStatus'] = this.messageStatus; + data['NumberOfResultRecords'] = this.numberOfResultRecords; + data['PatientBlodType'] = this.patientBlodType; + data['SuccessMsg'] = this.successMsg; + data['SuccessMsgN'] = this.successMsgN; + data['HtmlResult'] = this.htmlResult; + data['IsHMGPatient'] = this.isHMGPatient; + data['IsRegister'] = this.isRegister; + data['IsSendSMS'] = this.isSendSMS; + data['List_BabyInformationModel'] = this.listBabyInformationModel; + data['List_BabyNeedReminderModel'] = this.listBabyNeedReminderModel; + data['List_CreateVaccinationTableModel'] = + this.listCreateVaccinationTableModel; + data['List_His_PatientModel'] = this.listHisPatientModel; + data['List_UserInformationModel'] = this.listUserInformationModel; + data['List_UserInformationModel_New'] = this.listUserInformationModelNew; + data['List_VaccinationTableModel'] = this.listVaccinationTableModel; + data['TokinID'] = this.tokinID; + data['UserID'] = this.userID; + data['VerificationCode'] = this.verificationCode; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/add_new_child_service.dart b/lib/core/service/childvaccines/add_new_child_service.dart index 22a081a3..5e4a4d86 100644 --- a/lib/core/service/childvaccines/add_new_child_service.dart +++ b/lib/core/service/childvaccines/add_new_child_service.dart @@ -1,26 +1,41 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import '../base_service.dart'; class CreteNewBabyService extends BaseService { List createNewBabyModelList = List(); + List userModelList = List(); + List newUserModelList = List(); - Future getCreateNewBabyOrders({ CreateNewBaby newChild}) async { + + Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { hasError = false; + await getUser(); + Map body = Map.from(newChild.toJson()); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['UserID'] = userID; + body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_NEWCHILD_REQUEST, onSuccess: (dynamic response, int statusCode) { - createNewBabyModelList.clear(); - - response['List_UserInformationModel_New'].forEach((vital) { - createNewBabyModelList.add( - CreateNewBaby.fromJson(vital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: newChild.toJson()); + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - -} \ No newline at end of file +} diff --git a/lib/core/service/childvaccines/child_vaccines_service.dart b/lib/core/service/childvaccines/child_vaccines_service.dart index 75a07338..09256f47 100644 --- a/lib/core/service/childvaccines/child_vaccines_service.dart +++ b/lib/core/service/childvaccines/child_vaccines_service.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; @@ -8,22 +9,17 @@ import '../base_service.dart'; class ChildVaccinesService extends BaseService { List babyInformationModelList = List(); List userInformationModelList = List(); + int userID = 0; - Map body = Map(); Future getAllBabyInformationOrders() async { + Map body = Map(); hasError = false; - body['isDentalAllowedBackend'] = false; body['IsLogin'] = true; - - //body['UserID'] = userInformationModelList[0].userID;//AuthenticatedUser.fromJson(json['List'][0] //babyInformationModelList[0].userID; - body['UserID'] = 46013;//42843; - - - await baseAppClient.post(GET_BABYINFORMATION_REQUEST, + body['UserID'] = userID; + await baseAppClient.post(GET_BABY_BY_USER_ID, onSuccess: (dynamic response, int statusCode) { babyInformationModelList.clear(); - response['List_BabyInformationModel'].forEach((vital) { babyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); }); @@ -32,4 +28,29 @@ class ChildVaccinesService extends BaseService { super.error = error; }, body: body); } + + Future getNewUserOrders() async { + Map body = Map(); + hasError = false; + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['UserID'] = userID; + body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(GET_NEW_USER_REQUEST, + onSuccess: (dynamic response, int statusCode) { + userID = response['UserID']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/service/childvaccines/get_vaccinations_item_services.dart b/lib/core/service/childvaccines/get_vaccinations_item_services.dart index f7fe4662..5ff936af 100644 --- a/lib/core/service/childvaccines/get_vaccinations_item_services.dart +++ b/lib/core/service/childvaccines/get_vaccinations_item_services.dart @@ -11,17 +11,6 @@ class GetVccinationsItemsService extends BaseService { Future getaccinationsitemOrders() async { hasError = false; - // await getUser(); - // body['BabyName']="fffffffffff eeeeeeeeeeeeee"; - // body['DOB'] = "/Date(1585774800000+0300)/"; - // body['EmailAddress'] = user.emailAddress; - // body['isDentalAllowedBackend'] = false; - // body['SendEmail'] = false; - // body['IsLogin'] =true; - - - - await baseAppClient.post(GET_TABLE_REQUEST, onSuccess: (dynamic response, int statusCode) { getVaccinationsItemModelList.clear(); diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart index 7651ef0f..0628920c 100644 --- a/lib/core/service/childvaccines/user_information_service.dart +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -1,41 +1,35 @@ - import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import '../base_service.dart'; -class UserInformationService extends BaseService{ - +class UserInformationService extends BaseService { List userInformationModelList = List(); Map body = Map(); - - Future getUserInformationOrders() async { hasError = false; - await getUser(); - body['CreatedBy'] = 102; - body['EditedBy'] = 102; - body['EmailAddress'] = user.emailAddress; - body['IsLogin'] =true; - body['LogInTokenID'] = 'ZBGoQFUG50eQJd6Y7u1ykA=='; - body['MobileNumber'] = user.mobileNumber; - body['NationalID'] = user.nationalityID; - body['ZipCode'] = user.zipCode; - body['isDentalAllowedBackend'] = false; - + await getUser(); + body['CreatedBy'] = 102; + body['EditedBy'] = 102; + body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_USERINFORMATION_REQUEST, onSuccess: (dynamic response, int statusCode) { - userInformationModelList.clear(); - - response['List_UserInformationModel_New'].forEach((vital) { - userInformationModelList.add(List_UserInformationModel.fromJson(vital)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + userInformationModelList.clear(); + + response['List_UserInformationModel_New'].forEach((vital) { + userInformationModelList.add(List_UserInformationModel.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - - -} \ No newline at end of file +} diff --git a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart index 26355bd7..f0b55caa 100644 --- a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -1,28 +1,36 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; -class AddNewChildViewModel extends BaseViewModel{ +class AddNewChildViewModel extends BaseViewModel { CreteNewBabyService _creteNewBabyService = locator(); - - - - List get creteNewBabyModelList=> _creteNewBabyService.createNewBabyModelList; - getNewBabyOrders({ CreateNewBaby newChild}) async { + ChildVaccinesService _childVaccinesService = locator(); + bool isAdded = false; + ///create new baby + createNewBabyOrders({ CreateNewBaby newChild}) async { setState(ViewState.Busy); - - await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild); - - if ( _creteNewBabyService.hasError) { - error = _creteNewBabyService.error; + await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; setState(ViewState.Error); - } else + } else { + isAdded = true; setState(ViewState.Idle); + // await _childVaccinesService.getAllBabyInformationOrders(); + // if (_childVaccinesService.hasError) { + // error = _childVaccinesService.error; + // setState(ViewState.Error); + // } else{ + // + // } + } } + } diff --git a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart index e6a8ca60..c19d9168 100644 --- a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -7,18 +7,22 @@ import '../../../locator.dart'; import '../base_view_model.dart'; class ChildVaccinesViewModel extends BaseViewModel{ - - ChildVaccinesService _childVaccinesService = locator(); + List get babyInformationModelList=> _childVaccinesService.babyInformationModelList; - - List get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList; - getBabyInformatioRequestOrders() async { + getNewUserOrders() async { setState(ViewState.Busy); + await _childVaccinesService.getNewUserOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else + getBabyInformatioRequestOrders(); + } + getBabyInformatioRequestOrders() async { await _childVaccinesService.getAllBabyInformationOrders(); - if (_childVaccinesService.hasError) { error = _childVaccinesService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/child_vaccines/user_information_view_model.dart b/lib/core/viewModels/child_vaccines/user_information_view_model.dart index c362ef73..43269f42 100644 --- a/lib/core/viewModels/child_vaccines/user_information_view_model.dart +++ b/lib/core/viewModels/child_vaccines/user_information_view_model.dart @@ -11,11 +11,9 @@ class UserInformationViewModel extends BaseViewModel { List get userInformationModelList => _userInformationService.userInformationModelList; - getUserInformatioRequestOrders() async { + getUserInformationRequestOrders() async { setState(ViewState.Busy); - await _userInformationService.getUserInformationOrders(); - if (_userInformationService.hasError) { error = _userInformationService.error; setState(ViewState.Error); diff --git a/lib/locator.dart b/lib/locator.dart index 46b97fce..734e281f 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -123,6 +123,7 @@ void setupLocator() { locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => VaccinationTableService()); diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index f2970cad..a8e97b60 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -1,6 +1,7 @@ import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; @@ -19,8 +20,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; - - enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } @@ -56,6 +55,7 @@ class AddNewChildPage extends StatefulWidget { DateTime.now().day, (hour * count))); } } + @override _AddNewChildPageState createState() => _AddNewChildPageState(); } @@ -75,15 +75,17 @@ class _AddNewChildPageState extends State { TextEditingController _notesTextController = TextEditingController(); BeneficiaryType beneficiaryType = BeneficiaryType.NON; Gender gender = Gender.Male; + CreateNewUser_New newUserChild = CreateNewUser_New(); + //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); List_BabyInformationModel addvancedModel = List_BabyInformationModel(); - CreateNewBaby newChild=CreateNewBaby(); - List_UserInformationModel informationModel =List_UserInformationModel(); + CreateNewBaby newChild = CreateNewBaby(); + List_UserInformationModel informationModel = List_UserInformationModel(); @override Widget build(BuildContext context) { return BaseView( - builder: (_,model,w)=> AppScaffold( + builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: "Vaccintion", body: SingleChildScrollView( @@ -97,7 +99,8 @@ class _AddNewChildPageState extends State { height: 50, ), Texts( - "Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName, + "Add the child's information below to recieve the schedule of vaccinations.", + //+model.user.firstName, textAlign: TextAlign.center, ), SizedBox( @@ -139,13 +142,13 @@ class _AddNewChildPageState extends State { width: 170, child: SecondaryButton( textColor: - checkedValue == 1 ? Colors.white : Colors.black, + checkedValue == 1 ? Colors.white : Colors.black, color: checkedValue == 1 ? Colors.red : Colors.white, label: "Male", // onTap: () { - // bloodDetails.city=_selectedHospital.toString(); + setState(() { checkedValue = 1; print("checkedValue=" + checkedValue.toString()); @@ -160,7 +163,7 @@ class _AddNewChildPageState extends State { width: 170, child: SecondaryButton( textColor: - checkedValue == 2 ? Colors.white : Colors.black, + checkedValue == 2 ? Colors.white : Colors.black, color: checkedValue == 2 ? Colors.red : Colors.white, label: "Female", // @@ -220,9 +223,8 @@ class _AddNewChildPageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts(//getStartDay() - // DateUtil.yearMonthDay(DateTime.now()) - getStartDay() - ), + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay()), Icon( Icons.calendar_today, color: Colors.black, @@ -248,45 +250,29 @@ class _AddNewChildPageState extends State { color: checkedValue == false ? Colors.white24 : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), + 63, + 72, + 74, + 1, + ), label: "Add", // - onTap: () { - - newChild.babyName = - _firstTextController.text + " " + _secondTextController.text; + onTap: () async{ + newChild.babyName = _firstTextController.text + " " + _secondTextController.text; newChild.gender = checkedValue.toString(); - newChild.strDOB=getStartDay() ; - newChild.alertBy=addvancedModel.alertBy; - newChild.createdBy=informationModel.createdBy ; - newChild.editedBy=informationModel.createdBy; - newChild.tempValue=true; - // newChild.userID=46013;//informationModel.userID; - newChild.isLogin=true; - //newChild.tokenID='qMgbP94U23RkXtWWT0Sw=='; - //'ZBGoQFUG50eQJd6Y7u1ykA=='; - - - model.getNewBabyOrders(newChild: newChild); - - + newChild.strDOB = getStartDay(); + newChild.tempValue = true; + newChild.isLogin = true; + await model.createNewBabyOrders(newChild: newChild); + if(model.isAdded){ AppToast.showSuccessToast(message: "Record Added"); - //============ - Navigator.push( - context, - FadePage( - page: ChildPage(), + Navigator.pop(context,model.isAdded); + }else{ - ), - ); - //============== + //TODO handling error + } - // bloodDetails. }, ), ), diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 6a937aad..becd086f 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -12,139 +12,172 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class ChildPage extends StatefulWidget { - - @override _ChildPageState createState() => _ChildPageState(); } -class _ChildPageState extends State with SingleTickerProviderStateMixin { +class _ChildPageState extends State + with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { - var checkedValue= true; + var checkedValue = true; return BaseView( - onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - appBarTitle: " Vaccination", - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 15,right: 15,top: 70), - child: Column( - children: [ - ...List.generate(model.babyInformationModelList.length, (index) => - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - - ), - padding: EdgeInsets.all(12), + onModelReady: (model) => model.getNewUserOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination", + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + model.babyInformationModelList.length, + (index) => Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.white, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + padding: EdgeInsets.all(12), + width: double.infinity, + child: Column( + children: [ + Row(children: [ + Texts("CHILD NAME"), + ]), + Row(children: [ + Texts(model + .babyInformationModelList[index] + .babyName + .trim()), + ]), + Row(children: [ + IconButton( + icon: Image.asset(model + .babyInformationModelList[ + index] + .gender == + 1 + ? 'assets/images/new-design/male.png' + : 'assets/images/new-design/female.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model + .babyInformationModelList[index] + .genderDescription), + IconButton( + icon: Icon( + Icons.remove_red_eye, + color: Colors.red, + ), + tooltip: 'Increase volume by 10', + onPressed: () { + Navigator.push( + context, + FadePage( + page: VaccinationTablePage(), + + //ChildPage(babyInformationModelList:model.BabyInformationModelList) + // HospitalsPage( + // findusHospitalModelList: model.FindusHospitalModelList, + // ) + ), + ); + // setState(() { + // // _volume += 10; + // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + // }); + }, + ) + ]), + Row(children: [ + Texts("Birthday"), + ]), + Row(children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/calender-secondary.png'), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(DateUtil.yearMonthDay(model + .babyInformationModelList[index] + .dOB)), + ]), + Row(children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/garbage.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts("Birthday"), + ]), + SizedBox( + height: 12, + ), + ], + ), + + ), + + + ) + ], + )) + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - child: Column( - - children: [ - Row(children:[Texts("CHILD NAME"),]), - Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), - - Row( - children: [IconButton( - icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'), - tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - Texts(model.babyInformationModelList[index].genderDescription), - IconButton( - icon: Icon(Icons.remove_red_eye,color: Colors.red,), - tooltip: 'Increase volume by 10', - onPressed: () { - Navigator.push( - context, - FadePage( - page: VaccinationTablePage(), - - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) - - ), - ); - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - }, - )] - ), - Row(children:[Texts("Birthday"),]), - Row(children:[IconButton( - icon: new Image.asset('assets/images/new-design/calender-secondary.png'), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), - Row(children:[IconButton( - icon: new Image.asset('assets/images/new-design/garbage.png'), - tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, - ), - Texts("Birthday"),]), - ], - ) - - - ) - - ) - - ], - - - ) - ) - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "ADD NEW CHILD ", - // - onTap: () => Navigator.push( - context, - FadePage( - page: AddNewChildPage(), - - - ), - ), - - - ), - ), - ) - ); + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "ADD NEW CHILD ", + // + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddNewChildPage(), + ), + ).then((value) { + if (value) model.getNewUserOrders(); + }); + }, + ), + ), + )); } } diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index ba4589a9..f8fe7b74 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -29,7 +29,7 @@ class _ChildVaccinesPageState extends State Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getUserInformatioRequestOrders(), + onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -132,10 +132,7 @@ class _ChildVaccinesPageState extends State FadePage( page: ChildPage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) + ), ), From 8ddec0ad99112cc5aa9b9ba852908e85edf55342 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 11 Oct 2020 08:37:05 +0300 Subject: [PATCH 48/65] child Vaccines add new child modified --- lib/pages/ChildVaccines/child_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index becd086f..9f9f933c 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -47,7 +47,7 @@ class _ChildPageState extends State color: Colors.white, ), padding: EdgeInsets.all(12), - width: double.infinity, + width: 200,//double.infinity, child: Column( children: [ Row(children: [ From 06416b49345000080c8955eca05b79cf2a66baa6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 11 Oct 2020 14:32:14 +0300 Subject: [PATCH 49/65] add Not authenticated Page --- assets/images/Wifi-AR.png | Bin 0 -> 18245 bytes assets/images/wifi-EN.png | Bin 0 -> 19261 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 11 +- lib/core/enum/Ambulate.dart | 41 +++- lib/core/enum/OrderService.dart | 22 ++ lib/core/model/er/PickUpRequestPresOrder.dart | 204 ++++++++++++++++++ lib/core/service/client/base_app_client.dart | 4 +- lib/core/service/er/am_service.dart | 49 ++++- lib/core/service/medical/medical_service.dart | 19 ++ lib/core/viewModels/base_view_model.dart | 1 + .../viewModels/er/am_request_view_model.dart | 30 ++- .../viewModels/medical/labs_view_model.dart | 86 ++++---- .../medical/medical_view_model.dart | 19 +- lib/pages/ErService/AmbulanceReq.dart | 21 +- .../AmbulanceRequestIndex.dart | 8 +- .../BillAmount.dart | 19 +- .../PickupLocation.dart | 200 ++++++++++++----- .../SelectTransportationMethod.dart | 23 +- .../Summary.dart | 0 lib/pages/ErService/OrderLogPage.dart | 62 ++++++ lib/pages/base/base_view.dart | 4 +- lib/pages/landing/home_page.dart | 1 + lib/pages/login/confirm-login.dart | 1 + lib/pages/login/forgot-password.dart | 1 + lib/pages/login/login-type.dart | 1 + lib/pages/login/login.dart | 1 + lib/pages/login/register-info.dart | 1 + lib/pages/login/register.dart | 1 + lib/pages/login/welcome.dart | 1 + lib/pages/medical/labs/labs_home_page.dart | 1 + lib/pages/medical/medical_profile_page.dart | 1 + .../radiology/radiology_home_page.dart | 1 + lib/uitl/ProgressDialog.dart | 32 ++- lib/uitl/translations_delegate_base.dart | 4 + lib/widgets/others/OrderLogItem.dart | 32 +++ lib/widgets/others/app_scaffold_widget.dart | 95 ++++---- lib/widgets/others/not_auh_page.dart | 79 +++++++ pubspec.yaml | 3 + 39 files changed, 884 insertions(+), 199 deletions(-) create mode 100644 assets/images/Wifi-AR.png create mode 100644 assets/images/wifi-EN.png create mode 100644 lib/core/enum/OrderService.dart create mode 100644 lib/core/model/er/PickUpRequestPresOrder.dart rename lib/pages/ErService/{ => AmbulanceRequestIndexPages}/AmbulanceRequestIndex.dart (89%) rename lib/pages/ErService/{ => AmbulanceRequestIndexPages}/BillAmount.dart (96%) rename lib/pages/ErService/{ => AmbulanceRequestIndexPages}/PickupLocation.dart (67%) rename lib/pages/ErService/{ => AmbulanceRequestIndexPages}/SelectTransportationMethod.dart (92%) rename lib/pages/ErService/{ => AmbulanceRequestIndexPages}/Summary.dart (100%) create mode 100644 lib/pages/ErService/OrderLogPage.dart create mode 100644 lib/widgets/others/OrderLogItem.dart create mode 100644 lib/widgets/others/not_auh_page.dart diff --git a/assets/images/Wifi-AR.png b/assets/images/Wifi-AR.png new file mode 100644 index 0000000000000000000000000000000000000000..a8e2d9af3fd23ab15c89bc14bb4602cf257c7567 GIT binary patch literal 18245 zcmXV$bx<2^7sUx0q*!n%!HZjQcbDSs))OJy`w{&qg zak79BHMcjl0Ly+iv9eILFfsRZ9I+69fss0pl@L|;SU&Yd`ez`S{64M-1_n}LddYvn zhA#;IEWT0rX@tU5RMO(T>XhQ=U!fD`{>V|3=9;Q1l*m?Q3Ii3D42U{%2QqRyKK4ko8-T}3r!eje7| z&b?eg{N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ozw24(t?JHrG$s<_V`OSI6Ky4#o`MN$qr<>t?Wp7*R?*cZ(bH4m}8*3#sTQ)PycP zbUTCSeSs|BlI3O7{bLaCcuki1vP_d@9rX$&;;`m^5%D}7$2lTPP_OFNJIUBR-!+O$ z`xr2gi>JiRvYaZ*eYQuBL3YCP^2h74Y%0s-I#w56Q=&be>*M7sQzT1l!KBx5;yico z<>)#+DpYL5itQ2)%5u6aSIe?E3ITN<^mymzJ7t+<>)iU2_VGTObV-3VCY}Ez9|`yo$MDjKjmGAvV-x<9e zLRNCk{Xq(U%?qQ+P=S8;$mh4q@6YKN4DP||Jh2EUGb{kbJ|N3q*oeJ+oUGg$+_zx} zc{_B1`da3qP7IAJzAs0LHA!RdY1J`)5uQK0BdVP#McFGQHO^xQYg?`SKvsTP$!1q& zBO9*!%Cem-Tg%Va)W)mikD7NBUDSV%$n|}d^~JGGUZW=(e4oej4aX%G+F(j_AEDmQ z$Y8pSIIJ$jqGi{U8f-7gR!!#%tp-I8^}s;B`dw5{CzzT@#NpD%D-2Vzb}U+ z62_2;@u0t#I;4$43{azKm|XV3lm}-aKXVk9pig_1G~V+);KK>(#lsy!0bPBzy!J79 z?V^s25&;nbMIa#f;Ej$>^IGTUD>1kYfj}S- k2m}IwKp+e|{=WbN0DRXX)M3hnVgLXD07*qoM6N<$f*0@>M*si- literal 0 HcmV?d00001 diff --git a/assets/images/wifi-EN.png b/assets/images/wifi-EN.png new file mode 100644 index 0000000000000000000000000000000000000000..5711925c73665a7cbccd0bba985c4b9acafad527 GIT binary patch literal 19261 zcmYgXRajeX69j_06bQxL-91>5;ts{NxVyW%ySo*NyBBwNcP$PD{(N_TZjvWA$vN-N z?Ci{*2t|2G6vVHH5D*Y3(o*8e;P)8_2*?_ESnwxvyVq^-8=kX-rn8EjnX{XrqbY=l ziJg%tiL{NOxv8?Lp^1mXsHp%1gv_?IxQMFz+JzuOBc+6knq4R*JZhC}Ki5SEa^wg! zyg{K+FGL?YMI;F;YdDl=bSnX*2s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7Zl?nbDmfNniS`xxTg5|O7U{r7T3&VBx~_RoLV{rs|d?T4{$1>`cf_9 z=2FoUdq`sFfN)#?(3LI(vFaclhrm>QO4nd;gBTDTP+SYdR8ALFyo@scu3S>MziadI zjj@&f@!$2$r;K|K>$+GzbFH6mU1Oe!xe9Kc_P$f^yrAI32jn1t8Hvx|QVbMMY$4=z zg<^1XWCAA&$=j)lW~^l{E5|hAcye&0T--bNnN}0)N44@<;L_qcNt7N2>gp`>mXRCH zDz4p&>&?ZrTk%pGIOA2!Qu9R7#s2rCTt8G9p zw6U;gTE$C%SHr8YL?Q$-F`g9G(js*o#a8&M zg~CkvlyDc}U_YY_sUv$CVF!^kKC+)zx<)S0X&^ZcM3O=<+@pelfq{X6fq{X6fq{X6 jfq{X6fnh}9{{> localizedValues = { "All":{"en":"All","ar":"الكل"}, "QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"}, "ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"}, - + "ServiceInformationButton":{"en":"LOGIN / REGISTER","ar":"دخول / تسجيل"}, + "ServiceInformationTitle":{"en":"Service Information","ar":"معلومات الخدمة"}, + "info-lab": { + "en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.", + "ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية." + }, + "info-radiology": { + "en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.", + "ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل." + }, }; diff --git a/lib/core/enum/Ambulate.dart b/lib/core/enum/Ambulate.dart index 059a281c..f8b2e8be 100644 --- a/lib/core/enum/Ambulate.dart +++ b/lib/core/enum/Ambulate.dart @@ -6,22 +6,55 @@ extension SelectedAmbulate on Ambulate { String getAmbulateTitle(BuildContext context) { switch (this) { case Ambulate.Wheelchair: - // TODO: Handle this case. return 'Wheelchair'; break; case Ambulate.Walker: - // TODO: Handle this case. return 'Walker'; break; case Ambulate.Stretcher: - // TODO: Handle this case. return 'Stretcher'; break; case Ambulate.None: - // TODO: Handle this case. return 'None'; break; } return 'None'; } + + int selectAmbulateNumber() { + switch (this) { + case Ambulate.Wheelchair: + return 0; + break; + case Ambulate.Walker: + return 1; + break; + case Ambulate.Stretcher: + return 2; + break; + case Ambulate.None: + return 3; + break; + } + return 3; + } + + Ambulate getAmbulateById(int id) { + switch (id) { + case 0: + return Ambulate.Wheelchair; + break; + case 1: + return Ambulate.Walker; + break; + case 2: + return Ambulate.Stretcher; + break; + case 3: + return Ambulate.None; + break; + } + + return Ambulate.None; + } } diff --git a/lib/core/enum/OrderService.dart b/lib/core/enum/OrderService.dart new file mode 100644 index 00000000..e6ce24eb --- /dev/null +++ b/lib/core/enum/OrderService.dart @@ -0,0 +1,22 @@ +enum OrderService { AMBULANCE } + +extension SelectedOrderService on OrderService { + int getIdOrderService() { + switch (this) { + case OrderService.AMBULANCE: + return 4; + break; + } + return 4; + } + + OrderService getOrderServiceById(int id) { + switch (id) { + case 4: + return OrderService.AMBULANCE; + break; + } + + return OrderService.AMBULANCE; + } +} diff --git a/lib/core/model/er/PickUpRequestPresOrder.dart b/lib/core/model/er/PickUpRequestPresOrder.dart new file mode 100644 index 00000000..9ce3e678 --- /dev/null +++ b/lib/core/model/er/PickUpRequestPresOrder.dart @@ -0,0 +1,204 @@ +class PickUpRequestPresOrder { + int id; + int presOrderID; + String createDate; + String lastEditDate; + int createdBy; + int lastEditBy; + bool isActive; + String requestNo; + int requesterId; + int direction; + bool haveAppointment; + dynamic appointmentId; + int tripType; + int pickupUrgency; + String pickupDateTime; + dynamic pickupLocationId; + int pickupSpot; + dynamic dropoffLocationId; + int transportationMethodId; + int cost; + double vAT; + double totalPrice; + int amountCollected; + int selectedAmbulate; + String requesterNote; + int status; + int paymentStatus; + dynamic rejectReason; + int visibility; + dynamic durationId; + dynamic imageId; + String requesterFileNo; + String requesterMobileNo; + bool requesterIsOutSA; + String pickupLocationLongitude; + String pickupLocationLattitude; + String dropoffLocationLongitude; + String dropoffLocationLattitude; + dynamic appointmentClinicName; + dynamic appointmentDoctorName; + dynamic appointmentBranch; + dynamic appointmentTime; + String pickupLocationName; + String dropoffLocationName; + String title; + String titleAR; + String ambulateDescription; + String ambulateDescriptionN; + + PickUpRequestPresOrder( + {this.id, + this.presOrderID, + this.createDate, + this.lastEditDate, + this.createdBy, + this.lastEditBy, + this.isActive, + this.requestNo, + this.requesterId, + this.direction, + this.haveAppointment, + this.appointmentId, + this.tripType, + this.pickupUrgency, + this.pickupDateTime, + this.pickupLocationId, + this.pickupSpot, + this.dropoffLocationId, + this.transportationMethodId, + this.cost, + this.vAT, + this.totalPrice, + this.amountCollected, + this.selectedAmbulate, + this.requesterNote, + this.status, + this.paymentStatus, + this.rejectReason, + this.visibility, + this.durationId, + this.imageId, + this.requesterFileNo, + this.requesterMobileNo, + this.requesterIsOutSA, + this.pickupLocationLongitude, + this.pickupLocationLattitude, + this.dropoffLocationLongitude, + this.dropoffLocationLattitude, + this.appointmentClinicName, + this.appointmentDoctorName, + this.appointmentBranch, + this.appointmentTime, + this.pickupLocationName, + this.dropoffLocationName, + this.title, + this.titleAR, + this.ambulateDescription, + this.ambulateDescriptionN}); + + PickUpRequestPresOrder.fromJson(Map json) { + id = json['Id']; + presOrderID = json['PresOrderID']; + createDate = json['CreateDate']; + lastEditDate = json['LastEditDate']; + createdBy = json['CreatedBy']; + lastEditBy = json['LastEditBy']; + isActive = json['IsActive']; + requestNo = json['RequestNo']; + requesterId = json['RequesterId']; + direction = json['Direction']; + haveAppointment = json['HaveAppointment']; + appointmentId = json['AppointmentId']; + tripType = json['TripType']; + pickupUrgency = json['PickupUrgency']; + pickupDateTime = json['PickupDateTime']; + pickupLocationId = json['PickupLocationId']; + pickupSpot = json['PickupSpot']; + dropoffLocationId = json['DropoffLocationId']; + transportationMethodId = json['TransportationMethodId']; + cost = json['Cost']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + amountCollected = json['AmountCollected']; + selectedAmbulate = json['SelectedAmbulate']; + requesterNote = json['RequesterNote']; + status = json['Status']; + paymentStatus = json['PaymentStatus']; + rejectReason = json['RejectReason']; + visibility = json['Visibility']; + durationId = json['DurationId']; + imageId = json['ImageId']; + requesterFileNo = json['RequesterFileNo']; + requesterMobileNo = json['RequesterMobileNo']; + requesterIsOutSA = json['RequesterIsOutSA']; + pickupLocationLongitude = json['PickupLocationLongitude']; + pickupLocationLattitude = json['PickupLocationLattitude']; + dropoffLocationLongitude = json['DropoffLocationLongitude']; + dropoffLocationLattitude = json['DropoffLocationLattitude']; + appointmentClinicName = json['AppointmentClinicName']; + appointmentDoctorName = json['AppointmentDoctorName']; + appointmentBranch = json['AppointmentBranch']; + appointmentTime = json['AppointmentTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + title = json['Title']; + titleAR = json['TitleAR']; + ambulateDescription = json['AmbulateDescription']; + ambulateDescriptionN = json['AmbulateDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['Id'] = this.id; + data['PresOrderID'] = this.presOrderID; + data['CreateDate'] = this.createDate; + data['LastEditDate'] = this.lastEditDate; + data['CreatedBy'] = this.createdBy; + data['LastEditBy'] = this.lastEditBy; + data['IsActive'] = this.isActive; + data['RequestNo'] = this.requestNo; + data['RequesterId'] = this.requesterId; + data['Direction'] = this.direction; + data['HaveAppointment'] = this.haveAppointment; + data['AppointmentId'] = this.appointmentId; + data['TripType'] = this.tripType; + data['PickupUrgency'] = this.pickupUrgency; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationId'] = this.pickupLocationId; + data['PickupSpot'] = this.pickupSpot; + data['DropoffLocationId'] = this.dropoffLocationId; + data['TransportationMethodId'] = this.transportationMethodId; + data['Cost'] = this.cost; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + data['AmountCollected'] = this.amountCollected; + data['SelectedAmbulate'] = this.selectedAmbulate; + data['RequesterNote'] = this.requesterNote; + data['Status'] = this.status; + data['PaymentStatus'] = this.paymentStatus; + data['RejectReason'] = this.rejectReason; + data['Visibility'] = this.visibility; + data['DurationId'] = this.durationId; + data['ImageId'] = this.imageId; + data['RequesterFileNo'] = this.requesterFileNo; + data['RequesterMobileNo'] = this.requesterMobileNo; + data['RequesterIsOutSA'] = this.requesterIsOutSA; + data['PickupLocationLongitude'] = this.pickupLocationLongitude; + data['PickupLocationLattitude'] = this.pickupLocationLattitude; + data['DropoffLocationLongitude'] = this.dropoffLocationLongitude; + data['DropoffLocationLattitude'] = this.dropoffLocationLattitude; + data['AppointmentClinicName'] = this.appointmentClinicName; + data['AppointmentDoctorName'] = this.appointmentDoctorName; + data['AppointmentBranch'] = this.appointmentBranch; + data['AppointmentTime'] = this.appointmentTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['Title'] = this.title; + data['TitleAR'] = this.titleAR; + data['AmbulateDescription'] = this.ambulateDescription; + data['AmbulateDescriptionN'] = this.ambulateDescriptionN; + return data; + } +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f5494049..4ad8de79 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -15,7 +15,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); ///await BaseAppClient.post('', /// onSuccess: (dynamic response, int statusCode) {}, /// onFailure: (String error, int statusCode) {}, -/// body: null); +/// body: Map(); class BaseAppClient { post(String endPoint, @@ -78,7 +78,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - var asd=""; + if (await Utils.checkConnection()) { final response = await http.post(url.trim(), body: json.encode(body), diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index b6a91871..b654e0eb 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -1,23 +1,30 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import '../base_service.dart'; class AmService extends BaseService { List amModelList = List(); List patientAllPresOrdersList = List(); + bool hasPendingOrder = false; + int pendingOrderID = 0; + String pendingOrderStatus = ""; + String pendingOrderStatusAR = ""; + PickUpRequestPresOrder pickUpRequestPresOrder; Future getAllTransportationOrders() async { hasError = false; Map body = Map(); - body['isDentalAllowedBackend']= false; + body['isDentalAllowedBackend'] = false; body['IdentificationNo'] = user.patientIdentificationNo; await baseAppClient.post(GET_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) { - amModelList.clear(); - response['PatientER_RRT_GetAllTransportationMethodList'].forEach((vital) { - amModelList.add(PatientERTransportationMethod.fromJson(vital)); + amModelList.clear(); + response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) { + amModelList.add(PatientERTransportationMethod.fromJson(item)); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -27,11 +34,39 @@ class AmService extends BaseService { Future getPatientAllPresOrdersList() async { hasError = false; + hasPendingOrder = false; await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { - patientAllPresOrdersList.clear(); - response['PatientER_GetPatientAllPresOrdersList'].forEach((vital) { - patientAllPresOrdersList.add(PatientAllPresOrders.fromJson(vital)); + patientAllPresOrdersList.clear(); + response['PatientER_GetPatientAllPresOrdersList'].forEach((item) { + if (item['ServiceID'] == OrderService.AMBULANCE.getIdOrderService()) { + var order = PatientAllPresOrders.fromJson(item); + patientAllPresOrdersList.add(order); + if (order.status == 1) { + hasPendingOrder = true; + pendingOrderID = order.iD; + pendingOrderStatus = order.description; + pendingOrderStatusAR = order.descriptionN; + } + } + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getOrderDetails() async { + hasError = false; + hasPendingOrder = false; + Map body = Map(); + body['PresOrderID'] = pendingOrderID; + await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID, + onSuccess: (dynamic response, int statusCode) { + patientAllPresOrdersList.clear(); + response['PatientER_RRT_GetPickUpRequestByPresOrderIDList'] + .forEach((item) { + pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart index 572e5096..f90280cf 100644 --- a/lib/core/service/medical/medical_service.dart +++ b/lib/core/service/medical/medical_service.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:flutter/cupertino.dart'; class MedicalService extends BaseService { List appoitmentAllHistoryResultList = List(); @@ -26,4 +28,21 @@ class MedicalService extends BaseService { super.error = error; }, body: body); } + + addAmbulanceRequest({@required PatientER patientER}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['RequesterFileNo'] = user.patientID; + body['RequesterMobileNo'] = user.mobileNumber; + body['RequesterIsOutSA'] = user.outSA; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, + onSuccess: (response, statusCode) async { + + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart index 7e16d22d..18ab02e3 100644 --- a/lib/core/viewModels/base_view_model.dart +++ b/lib/core/viewModels/base_view_model.dart @@ -18,6 +18,7 @@ class BaseViewModel extends ChangeNotifier { AuthenticatedUser user; AppSharedPreferences sharedPref = AppSharedPreferences(); + AuthenticatedUserObject authenticatedUserObject = locator(); void setState(ViewState viewState) { _state = viewState; diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index a5261456..fbd3d95d 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; @@ -14,17 +15,22 @@ class AmRequestViewModel extends BaseViewModel { HospitalService _hospitalService = locator(); MedicalService _medicalService = locator(); - List - get amRequestModeList => _amService.amModelList; + List get amRequestModeList => + _amService.amModelList; - List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; + List get patientAllPresOrdersList => + _amService.patientAllPresOrdersList; List get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList; + List get hospitals => _hospitalService.hospitals; + + bool get hasPendingOrder =>_amService.hasPendingOrder; + Future getAppointmentHistory() async { setState(ViewState.BusyLocal); - await _medicalService.getAppointmentHistory(isActiveAppointment: true); + await _medicalService.getAppointmentHistory(isActiveAppointment: true); if (_medicalService.hasError) { error = _medicalService.error; setState(ViewState.ErrorLocal); @@ -32,8 +38,6 @@ class AmRequestViewModel extends BaseViewModel { setState(ViewState.Idle); } - - Future getAmRequestOrders() async { setState(ViewState.Busy); await _amService.getAllTransportationOrders(); @@ -54,9 +58,21 @@ class AmRequestViewModel extends BaseViewModel { getPatientAllPresOrdersList(); } - Future getPatientAllPresOrdersList()async{ + Future getPatientAllPresOrdersList() async { setState(ViewState.Busy); await _amService.getPatientAllPresOrdersList(); + if (_hospitalService.hasError) { + error = _hospitalService.error; + setState(ViewState.Error); + } else if (_amService.hasPendingOrder) { + getOrderDetails(); + } else + setState(ViewState.Idle); + } + + Future getOrderDetails() async { + setState(ViewState.Busy); + await _amService.getOrderDetails(); if (_hospitalService.hasError) { error = _hospitalService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 032aeb1e..8cbf0efc 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -21,52 +21,54 @@ class LabsViewModel extends BaseViewModel { : _patientLabOrdersListHospital; void getLabs() async { - setState(ViewState.Busy); - await _labsService.getPatientLabOrdersList(); - if (_labsService.hasError) { - error = _labsService.error; - setState(ViewState.Error); - } else { - _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + if (authenticatedUserObject.isLogin) { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersList(); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.patientLabOrdersList.forEach((element) { + List patientLabOrdersClinic = + _patientLabOrdersListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); - if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, - patientDoctorAppointment: element)); - } + if (patientLabOrdersClinic.length != 0) { + _patientLabOrdersListClinic[_patientLabOrdersListClinic + .indexOf(patientLabOrdersClinic[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListClinic.add(PatientLabOrdersList( + filterName: element.clinicDescription, + patientDoctorAppointment: element)); + } - // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + // doctor list sort via project + List patientLabOrdersHospital = + _patientLabOrdersListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); - if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, - patientDoctorAppointment: element)); - } - }); + if (patientLabOrdersHospital.length != 0) { + _patientLabOrdersListHospital[_patientLabOrdersListHospital + .indexOf(patientLabOrdersHospital[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListHospital.add(PatientLabOrdersList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); - setState(ViewState.Idle); + setState(ViewState.Idle); + } } } diff --git a/lib/core/viewModels/medical/medical_view_model.dart b/lib/core/viewModels/medical/medical_view_model.dart index fa330aad..4563f615 100644 --- a/lib/core/viewModels/medical/medical_view_model.dart +++ b/lib/core/viewModels/medical/medical_view_model.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -11,13 +12,15 @@ class MedicalViewModel extends BaseViewModel { _medicalService.appoitmentAllHistoryResultList; getAppointmentHistory() async { - setState(ViewState.Busy); - if (_medicalService.appoitmentAllHistoryResultList.length == 0) - await _medicalService.getAppointmentHistory(); - if (_medicalService.hasError) { - error = _medicalService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); + if (authenticatedUserObject.isLogin) { + setState(ViewState.Busy); + if (_medicalService.appoitmentAllHistoryResultList.length == 0) + await _medicalService.getAppointmentHistory(); + if (_medicalService.hasError) { + error = _medicalService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index c50093be..ec96f482 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -10,7 +10,8 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'AmbulanceRequestIndex.dart'; +import 'AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart'; +import 'OrderLogPage.dart'; class AmbulanceReq extends StatefulWidget { @override @@ -26,11 +27,13 @@ class _AmbulanceReqState extends State super.initState(); _tabController = TabController(length: 2, vsync: this); } + @override void dispose() { super.dispose(); _tabController.dispose(); } + @override Widget build(BuildContext context) { return BaseView( @@ -80,13 +83,14 @@ class _AmbulanceReqState extends State indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.40, child: Center( - child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions + child: Texts( + "Ambulance Request"), //TranslationBase.of(context).prescriptions ), ), Container( @@ -110,8 +114,14 @@ class _AmbulanceReqState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - AmbulanceRequestIndex(amRequestViewModel: model,), - Container() + model.hasPendingOrder + ? Container() + : AmbulanceRequestIndexPage( + amRequestViewModel: model, + ), + OrderLogPage( + amRequestViewModel: model, + ) ], ), ) @@ -121,5 +131,4 @@ class _AmbulanceReqState extends State ), ); } - } diff --git a/lib/pages/ErService/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart similarity index 89% rename from lib/pages/ErService/AmbulanceRequestIndex.dart rename to lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 16d07b88..55e75e22 100644 --- a/lib/pages/ErService/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -9,16 +9,16 @@ import 'PickupLocation.dart'; import 'SelectTransportationMethod.dart'; import 'Summary.dart'; -class AmbulanceRequestIndex extends StatefulWidget { +class AmbulanceRequestIndexPage extends StatefulWidget { final AmRequestViewModel amRequestViewModel; - AmbulanceRequestIndex({Key key, this.amRequestViewModel}); + AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); @override - _AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); + _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState(); } -class _AmbulanceRequestIndexState extends State { +class _AmbulanceRequestIndexPageState extends State { int currentIndex = 0; PageController pageController; PatientER _patientER = PatientER(); diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart similarity index 96% rename from lib/pages/ErService/BillAmount.dart rename to lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index 44e17c3a..cc6af0f2 100644 --- a/lib/pages/ErService/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -26,6 +26,22 @@ class BillAmount extends StatefulWidget { class _BillAmountState extends State { Ambulate _ambulate = Ambulate.None; String note =""; + + + @override + void initState() { + + if(widget.patientER.ambulate!=null) + { + setState(() { + _ambulate = widget.patientER.ambulate; + note = widget.patientER.requesterNote; + }); + } + super.initState(); + } + + @override Widget build(BuildContext context) { return SingleChildScrollView( @@ -278,7 +294,7 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text('Walker'), + title: Text('None'), leading: Radio( value: Ambulate.None, groupValue: _ambulate, @@ -320,6 +336,7 @@ class _BillAmountState extends State { setState(() { widget.patientER.ambulate = _ambulate; widget.patientER.requesterNote = note; + widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); widget.changeCurrentTab(3); }); }, diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart similarity index 67% rename from lib/pages/ErService/PickupLocation.dart rename to lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 4b32c9bb..795f4dcc 100644 --- a/lib/pages/ErService/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -1,9 +1,12 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; +import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -15,8 +18,8 @@ import 'package:geolocator/geolocator.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'AmbulanceReq.dart'; -import 'AvailableAppointmentsPage.dart'; +import '../AmbulanceReq.dart'; +import '../AvailableAppointmentsPage.dart'; enum HaveAppointment { YES, NO } @@ -41,6 +44,8 @@ class _PickupLocationState extends State { double _latitude; double _longitude; AppoitmentAllHistoryResultList myAppointment; + HospitalsModel _selectedHospital; + PickResult _result; @override void initState() { @@ -142,7 +147,7 @@ class _PickupLocationState extends State { Expanded( child: InkWell( onTap: () { - if(myAppointment == null) { + if (myAppointment == null) { getAppointment(); setState(() { _haveAppointment = HaveAppointment.YES; @@ -164,13 +169,12 @@ class _PickupLocationState extends State { groupValue: _haveAppointment, activeColor: Colors.red[800], onChanged: (value) { - if(myAppointment == null) { + if (myAppointment == null) { getAppointment(); setState(() { _haveAppointment = value; }); } - }, ), ), @@ -212,18 +216,18 @@ class _PickupLocationState extends State { ), ], ), - - if(myAppointment!=null) + if (myAppointment != null) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 12, ), - AppointmentCard(appointment: myAppointment,) + AppointmentCard( + appointment: myAppointment, + ) ], ), - SizedBox( height: 12, ), @@ -231,29 +235,35 @@ class _PickupLocationState extends State { SizedBox( height: 8, ), - Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Pickup Location'), - Icon( - Icons.arrow_drop_down, - size: 24, - color: Colors.black, - ) - ], + InkWell( + onTap: () { + confirmSelectHospitalDialog( + widget.amRequestViewModel.hospitals); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName('Pickup Location')), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), ), ), ], ), - if (widget.patientER.direction == 2) + if (widget.patientER.direction == 1) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -261,6 +271,39 @@ class _PickupLocationState extends State { SizedBox( height: 15, ), + InkWell( + onTap: () { + confirmSelectHospitalDialog( + widget.amRequestViewModel.hospitals); + }, + child: Container( + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(getHospitalName('Pickup Location')), + Icon( + Icons.arrow_drop_down, + size: 24, + color: Colors.black, + ) + ], + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Drop off Location'), + SizedBox( + height: 8, + ), InkWell( onTap: () { Navigator.push( @@ -271,6 +314,9 @@ class _PickupLocationState extends State { // Put YOUR OWN KEY here. onPlacePicked: (PickResult result) { print(result.adrAddress); + setState(() { + _result = result; + }); Navigator.of(context).pop(); }, initialPosition: LatLng(_latitude, _longitude), @@ -290,9 +336,9 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('Pickup Location'), + Texts('Select From Map'), Icon( - Icons.arrow_drop_down, + FontAwesomeIcons.mapMarkerAlt, size: 24, color: Colors.black, ) @@ -300,33 +346,6 @@ class _PickupLocationState extends State { ), ), ), - SizedBox( - height: 12, - ), - Texts('Drop off Location'), - SizedBox( - height: 8, - ), - Container( - padding: EdgeInsets.all(12), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts('Select From Map'), - Icon( - FontAwesomeIcons.mapMarkerAlt, - size: 24, - color: Colors.black, - ) - ], - ), - ), ], ), //TODO show dialog projects @@ -342,7 +361,41 @@ class _PickupLocationState extends State { color: Colors.grey[800], textColor: Colors.white, onTap: () { + if(_result==null || _selectedHospital == null) + AppToast.showErrorToast(message: 'please select all fields'); + else setState(() { + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; + if (widget.patientER.direction == 0) { + widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); + widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); + widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; + widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; + + } else { + widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; + widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; + widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); + widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); + } + + widget.patientER.latitude = widget.patientER.pickupLocationLattitude; + widget.patientER.longitude = widget.patientER.pickupLocationLongitude; + + if(_haveAppointment == HaveAppointment.YES){ + widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); + widget.patientER.appointmentClinicName = myAppointment.clinicName; + widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; + widget.patientER.appointmentBranch = myAppointment.projectName; + widget.patientER.appointmentTime = myAppointment.appointmentDate; + }else{ + widget.patientER.appointmentNo ="0"; + widget.patientER.appointmentClinicName = null; + widget.patientER.appointmentDoctorName = null; + widget.patientER.appointmentBranch = null; + widget.patientER.appointmentTime = null; + } + widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.changeCurrentTab(2); }); @@ -356,12 +409,35 @@ class _PickupLocationState extends State { ); } + void confirmSelectHospitalDialog(List hospitals) { + showDialog( + context: context, + child: SelectHospitalDialog( + hospitals: hospitals, + selectedHospital: _selectedHospital, + onValueSelected: (value) { + setState(() { + _selectedHospital = value; + }); + }, + ), + ); + } + + String getHospitalName(String title) { + return _selectedHospital == null ? title : _selectedHospital.name; + } + getAppointment() { + ProgressDialogUtil.showProgressDialog(context); widget.amRequestViewModel.getAppointmentHistory().then((value) { if (widget.amRequestViewModel.state == ViewState.Error || widget.amRequestViewModel.state == ViewState.ErrorLocal) { AppToast.showErrorToast(message: widget.amRequestViewModel.error); - } else if (widget.amRequestViewModel.appoitmentAllHistoryResultList.length > 0) { + } else if (widget + .amRequestViewModel.appoitmentAllHistoryResultList.length > + 0) { + ProgressDialogUtil.hideProgressDialog(context); Navigator.push( context, MaterialPageRoute( @@ -375,17 +451,23 @@ class _PickupLocationState extends State { setState(() { myAppointment = value; }); - else + else { + ProgressDialogUtil.hideProgressDialog(context); setState(() { _haveAppointment = HaveAppointment.NO; }); + } }); } else { + ProgressDialogUtil.hideProgressDialog(context); setState(() { _haveAppointment = HaveAppointment.NO; }); AppToast.showErrorToast(message: 'You don\'t have any appointment'); } + }).catchError((e) { + ProgressDialogUtil.hideProgressDialog(context); + AppToast.showErrorToast(message: e); }); } } diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart similarity index 92% rename from lib/pages/ErService/SelectTransportationMethod.dart rename to lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 261b9f83..436aabe8 100644 --- a/lib/pages/ErService/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; @@ -32,11 +33,13 @@ class _SelectTransportationMethodState Direction _direction = Direction.FromHospital; Way _way = Way.OneWay; + OrderService _orderService = OrderService.AMBULANCE; + @override void initState() { super.initState(); if (widget.patientER.direction != null) { - _direction = widget.patientER.direction == 1 + _direction = widget.patientER.direction == 0 ? Direction.ToHospital : Direction.FromHospital; _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; @@ -278,15 +281,17 @@ class _SelectTransportationMethodState textColor: Colors.white, onTap: () { setState(() { - widget.patientER.direction = - _direction == Direction.ToHospital ? 1 : 2; + widget.patientER.direction = _direction == Direction.ToHospital ? 0 : 1; widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1; - widget.patientER.selectedAmbulate = (widget - .amRequestViewModel.amRequestModeList - .indexOf(_erTransportationMethod) + - 1); - widget.patientER.patientERTransportationMethod = - _erTransportationMethod; + widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER.patientERTransportationMethod = _erTransportationMethod; + widget.patientER.orderServiceID = _orderService.getIdOrderService(); + widget.patientER.pickupUrgency = 1; + widget.patientER.lineItemNo = 1; + widget.patientER.cost = _erTransportationMethod.price; + widget.patientER.vAT = _erTransportationMethod.vAT ?? 0; + widget.patientER.totalPrice = _erTransportationMethod.totalPrice; + widget.changeCurrentTab(1); }); }, diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart similarity index 100% rename from lib/pages/ErService/Summary.dart rename to lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart diff --git a/lib/pages/ErService/OrderLogPage.dart b/lib/pages/ErService/OrderLogPage.dart new file mode 100644 index 00000000..cbb508e5 --- /dev/null +++ b/lib/pages/ErService/OrderLogPage.dart @@ -0,0 +1,62 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class OrderLogPage extends StatelessWidget { + final AmRequestViewModel amRequestViewModel; + + OrderLogPage({Key key, @required this.amRequestViewModel}); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8), + child: ListView.builder( + itemCount: amRequestViewModel.patientAllPresOrdersList.length, + itemBuilder: (context, index) => Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(2), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + OrderLogItem( + title: 'Request ID', + value: amRequestViewModel.patientAllPresOrdersList[index].iD + .toString(), + ), + OrderLogItem( + title: 'Status', + value: amRequestViewModel + .patientAllPresOrdersList[index].description, + ), + OrderLogItem( + title: 'Pickup Date', + value: DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate(amRequestViewModel + .patientAllPresOrdersList[index].createdOn)), + ), + OrderLogItem( + title: 'Pickup Location', + value: amRequestViewModel + .patientAllPresOrdersList[index].pickupLocationName, + ), + OrderLogItem( + title: 'Drop off Location', + value: amRequestViewModel + .patientAllPresOrdersList[index].dropoffLocationName, + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart index 6014b6c3..f5311aae 100644 --- a/lib/pages/base/base_view.dart +++ b/lib/pages/base/base_view.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -19,10 +20,11 @@ class BaseView extends StatefulWidget { class _BaseViewState extends State> { T model = locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); @override void initState() { - if (widget.onModelReady != null) { + if (widget.onModelReady != null && authenticatedUserObject.isLogin) { widget.onModelReady(model); } super.initState(); diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b811ef8f..b20648e2 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -34,6 +34,7 @@ class _HomePageState extends State { return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( + isShowDecPage: false, body: Container( width: double.infinity, child: SingleChildScrollView( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index ac36c7d6..52afe85f 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -74,6 +74,7 @@ class _ConfirmLogin extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, + isShowDecPage: false, body: isLoading == false ? SingleChildScrollView( child: Container( diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index c1fa7b18..bbdbb1ae 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -21,6 +21,7 @@ class _ForgotPassword extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).forgotPassword, isShowAppBar: true, + isShowDecPage: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 7a8a940d..d1ac54bb 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -16,6 +16,7 @@ class LoginType extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).welcome, isShowAppBar: true, + isShowDecPage: false, body: Padding( padding: EdgeInsets.all(20), child: Column( diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index c1f04a71..22178444 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -57,6 +57,7 @@ class _Login extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, + isShowDecPage: false, body: isLoading == true ? AppCircularProgressIndicator() : SingleChildScrollView( diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 70e5fb29..e94c1af6 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -39,6 +39,7 @@ class _RegisterInfo extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, + isShowDecPage: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 3706f452..3ee13a4c 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -45,6 +45,7 @@ class _Register extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, + isShowDecPage: false, body: isLoading == true ? AppCircularProgressIndicator() : SingleChildScrollView( diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index b4b05900..90bc2a2c 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -28,6 +28,7 @@ class _WelcomeLogin extends State { Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).welcome, + isShowDecPage: false, isShowAppBar: true, body: Padding( padding: EdgeInsets.all(20), diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 325d5dcd..995365d9 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -20,6 +20,7 @@ class LabsHomePage extends StatelessWidget { builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, isShowAppBar: true, + description: TranslationBase.of(context).infoLab, appBarTitle: TranslationBase.of(context).labOrders, body: SingleChildScrollView( physics: BouncingScrollPhysics(), diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index d2b9a9ea..2c5a6fb2 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -48,6 +48,7 @@ class _MedicalProfilePageState extends State { return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( + isShowDecPage: false, baseViewModel: model, body: Container( child: SingleChildScrollView( diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 0f9f4c7b..995ac485 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -20,6 +20,7 @@ class RadiologyHomePage extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, + description: TranslationBase.of(context).infoRadiology, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( diff --git a/lib/uitl/ProgressDialog.dart b/lib/uitl/ProgressDialog.dart index 728b27dd..6820a6d5 100644 --- a/lib/uitl/ProgressDialog.dart +++ b/lib/uitl/ProgressDialog.dart @@ -1,12 +1,26 @@ import 'package:flutter/material.dart'; -class ProgressDialogUtil{ +AlertDialog _alert = AlertDialog( + content: Row( + children: [ + CircularProgressIndicator(), + Container(margin: EdgeInsets.only(left: 7), child: Text("Loading...")), + ], + ), +); - static AlertDialog alert = AlertDialog( - content: new Row( - children: [ - CircularProgressIndicator(), - Container(margin: EdgeInsets.only(left: 7),child:Text("Loading..." )), - ],), - ); -} \ No newline at end of file +class ProgressDialogUtil { + static showProgressDialog(BuildContext context) { + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return _alert; + }, + ); + } + + static hideProgressDialog(BuildContext context) { + Navigator.pop(context); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 28b273e5..493bc327 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -589,6 +589,10 @@ class TranslationBase { String get all => localizedValues['All'][locale.languageCode]; String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; + String get serviceInformationButton => localizedValues['ServiceInformationButton'][locale.languageCode]; + String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode]; + String get infoLab => localizedValues['info-lab'][locale.languageCode]; + String get infoRadiology => localizedValues['info-radiology'][locale.languageCode]; } diff --git a/lib/widgets/others/OrderLogItem.dart b/lib/widgets/others/OrderLogItem.dart new file mode 100644 index 00000000..3e8305d3 --- /dev/null +++ b/lib/widgets/others/OrderLogItem.dart @@ -0,0 +1,32 @@ +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class OrderLogItem extends StatelessWidget { + final String title; + final String value; + OrderLogItem({ this.title, this.value}); + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(10), + width: double.maxFinite, + margin: EdgeInsets.only(bottom: 4,left: 4,right: 4), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12), + bottomLeft: Radius.circular(12), + ), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(title,color: Colors.grey,), + SizedBox(height: 4,), + Texts(value??''), + ], + ), + ); + } +} diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 80a3e7af..dabe3097 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -12,10 +14,12 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import '../../locator.dart'; import 'floating_button_search.dart'; import '../progress_indicator/app_loader_widget.dart'; import 'arrow_back.dart'; import 'network_base_view.dart'; +import 'not_auh_page.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; @@ -26,6 +30,12 @@ class AppScaffold extends StatelessWidget { final bool hasAppBarParam; final BaseViewModel baseViewModel; final Widget floatingActionButton; + final String title; + final String description; + final bool isShowDecPage; + + AuthenticatedUserObject authenticatedUserObject = + locator(); AppScaffold( {@required this.body, @@ -34,50 +44,61 @@ class AppScaffold extends StatelessWidget { this.isShowAppBar = false, this.hasAppBarParam, this.bottomSheet, - this.baseViewModel, this.floatingActionButton}); + this.baseViewModel, + this.floatingActionButton, + this.title, + this.description, + this.isShowDecPage = true}); @override Widget build(BuildContext context) { AppGlobal.context = context; return Scaffold( - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: Theme.of(context).appBarTheme.color, - textTheme: TextTheme( - headline6: TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ), - title: Text(appBarTitle.toUpperCase()), - leading: Builder( - builder: (BuildContext context) { - return ArrowBack(); + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + appBar: isShowAppBar + ? AppBar( + elevation: 0, + backgroundColor: Theme.of(context).appBarTheme.color, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text(authenticatedUserObject.isLogin + ? appBarTitle.toUpperCase() + : TranslationBase.of(context).serviceInformationTitle), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), + centerTitle: true, + actions: [ + IconButton( + icon: Icon(FontAwesomeIcons.home), + color: Colors.white, + onPressed: () { + Navigator.of(context).popUntil(ModalRoute.withName('/')); }, ), - centerTitle: true, - actions: [ - IconButton( - icon: Icon(FontAwesomeIcons.home), - color: Colors.white, - onPressed: () { - Navigator.of(context).popUntil(ModalRoute.withName('/')); - }, - ), - ], - ) - : null, - body: baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(), - bottomSheet: bottomSheet, - // bottomNavigationBar: BottomBarSearch() - floatingActionButton: floatingActionButton??floatingActionButton, - ); + ], + ) + : null, + body: (!authenticatedUserObject.isLogin && isShowDecPage) + ? NotAutPage( + title: appBarTitle, + description: description, + ) + : baseViewModel != null + ? NetworkBaseView( + child: buildBodyWidget(), + baseViewModel: baseViewModel, + ) + : buildBodyWidget(), + bottomSheet: bottomSheet, + // bottomNavigationBar: BottomBarSearch() + floatingActionButton: floatingActionButton ?? floatingActionButton, + ); } buildAppLoaderWidget(bool isLoading) { @@ -85,6 +106,6 @@ class AppScaffold extends StatelessWidget { } buildBodyWidget() { - return body ;//Stack(children: [body, buildAppLoaderWidget(isLoading)]); + return body; //Stack(children: [body, buildAppLoaderWidget(isLoading)]); } } diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart new file mode 100644 index 00000000..298b5609 --- /dev/null +++ b/lib/widgets/others/not_auh_page.dart @@ -0,0 +1,79 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class NotAutPage extends StatelessWidget { + final String title; + final String description; + + NotAutPage({@required this.title, @required this.description}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Scaffold( + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + title ?? 'Service', + fontWeight: FontWeight.w800, + fontSize: 25, + bold: true, + color: Hexcolor("#60686b"), + ), + SizedBox( + height: 12, + ), + Texts( + description ?? 'Description', + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context).size.width * 0.50, + child: Image.asset(projectViewModel.isArabic + ? 'assets/images/wifi-EN.png' + : 'assets/images/Wifi-AR.png'), + ), + ), + SizedBox( + height: 77, + ), + ], + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.pushReplacement( + context, FadePage(page: LoginType())), + label: TranslationBase.of(context).serviceInformationButton, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 6e9349ab..2b078a1d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,9 @@ dependencies: image_picker: ^0.6.7+1 image_cropper: ^1.2.1 + #GIF image + flutter_gifimage: ^1.0.1 + # UI Reqs dotted_border: 1.0.5 expandable: ^4.1.4 From 41d50e23e3df837e9a17bbe58e01472325a9e7d7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 6 Oct 2020 14:06:28 +0300 Subject: [PATCH 50/65] covid drivethru implemented --- .../new-design/covid-19-big-banner-bg.png | Bin 0 -> 10233 bytes ios/Runner/Runner.entitlements | 5 +- .../Appointments/PatientShareResposne.dart | 34 +- .../CovidPaymentInfoResponse.dart | 96 +++ .../health_converter/blood_cholesterol.dart | 2 +- .../health_converter/blood_sugar.dart | 2 +- .../health_converter/triglycerides.dart | 2 +- .../components/DocAvailableAppointments.dart | 4 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 599 ++++++++++++++++++ .../covid-drivethru-location.dart | 77 ++- .../Covid-DriveThru/covid-payment-alert.dart | 288 +++++++++ .../covid-payment-details.dart | 257 ++++++++ lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/landing/home_page.dart | 6 +- lib/pages/landing/landing_page.dart | 3 - .../covid-drivethru/covid-drivethru.dart | 74 +++ 16 files changed, 1406 insertions(+), 45 deletions(-) create mode 100644 assets/images/new-design/covid-19-big-banner-bg.png create mode 100644 lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart create mode 100644 lib/pages/Covid-DriveThru/Covid-TimeSlots.dart create mode 100644 lib/pages/Covid-DriveThru/covid-payment-alert.dart create mode 100644 lib/pages/Covid-DriveThru/covid-payment-details.dart diff --git a/assets/images/new-design/covid-19-big-banner-bg.png b/assets/images/new-design/covid-19-big-banner-bg.png new file mode 100644 index 0000000000000000000000000000000000000000..a66d681553e9014c80c6452df934b6900d599f32 GIT binary patch literal 10233 zcmX|nbwE>X8~1_@B&0=}7Zs2Yq#q=GMmdlk4SPg#Ac%t0U;}*wQHD~ILpnz@L}Di0 zjNz0}x^r}V^ZmZ}`{SH*-zV<8;`h6*6K8(ckd0Y@82|vV85_YY0RW&Ky^LXk($9B; zA2!l2z(T=F9%vaXS=Ow-JBdaypQn%o(ua z0hcRX4pqOZC;RO0Uw?BJDB~jz=hCKHP$-B47Lm)V?u^~Ya&faAXRZfT>dFLIOplDc z`Nto$V3*3vmlm%}oKra0Zr7j{{`}nOhz}Fti1o^TT_R9qut(5jDv7gPgvc z`RtDLuS0nc&gi3gm~Hj=@Vh6z_4p%uWI&RY2rX*=!&GY>{=4OUhaYo20xvyjcUG8! zjnnV?)8{2=rTh3`BkKIPcFykUVe1BZBfDYv8q@m2K@I8S4xO`yp%ykhB|qS@s0x!G zVgr1ry7q&w@;9_c6%7+^MQi0D7X0X~jPL@K#oWZd;!jsS`AXu%qKZt~a+IBdf2``ZOJ;z6yx+nZ`GS4OLPa~PU9D1Os1$@-m)-&#= z?@n&hoq){}EYZm3F>@IvGYs445HXaXC~iMTXjp-}{J59)-(8!I0RgYa+Cu@VKX8$| z`8~v9aiiC=Mt44Z8?6*Uo^H{XoRhFzM%t?^4~{(Sadp{_(H0x%RRK)aCLoDC%PW62 zS`7kVn+32;!(N))zfb}2O`lFx8DDPkwyf--w>3hHoa1dF- zlH&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vR2le8M2B)IC_%kk7L+m2H->khh%dv z&#Hod=58^jQzlo(E`sv(5bwnNE>u%l2OEGl$O#~X{pJwvAW@qfwlA{M{xNc%g;e7= zgp^R+|Ic7A*V7Y1jJ=qrYhS4NICD8YMu5OKt|(&bnfn~R$zQ&@JSWM4uv%wArUc=< zghaCz7T%3z&p>^X7f<6YNTl8?c$x~BG5KU#X~+?}k#mTnLqdEVHXO322IU!73@NLdc)s4uLg^ z7p1?iZmR&mO<|`w9pXmR#rC%Qibe&{JBBWR8;3rJx2LdmpR7Jmaa;d*=h4$-RX5jG z-*>1`vrQ%9A|{GkNt(<4;JuQ2+2_A_09-Nd1Gyi_q2>U-p&v~5IUVy9!(*t^eV)d| z##WoNRXz-A?G-wWF9e8~UCepA`I9eK3E1CV(eQ9ZWr)zIv^08TqI%-Km*=&Qg8p_` zUwrt#rWIoKJRnt9#W#*40^j+*t9 zS88lOkeCI;HCFP?Y97Dq^D!fzQ|DJN>rzrBH2t#pz15JOPu`6%!auyzjiDJ zwnUEoA%lr0+0Ygl6YS&qJk(oQFWsN!$=WptDlZDOyrPX0F)mB(7T(YCZNPp2q&$ho&%>`4 zNKr~N7pOk9qA+LWV)!KC7G-A1IY&dgPj9qRrCU}VUs$#ZIW-5r5~Kg?^2*1#i1#uN z$JelMJfF#pn6i%9hQ;8LA~U=$kh7xQbQ<-dWw7?~v^!E8b*twUbk+V&u$I3I7C`G` m*#a?e6i&|Yv3w((i-I3M3YFD*h5z#lp0WO27~wWD`u_kT#KTko literal 0 HcmV?d00001 diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 0c67376e..903def2a 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -1,5 +1,8 @@ - + + aps-environment + development + diff --git a/lib/models/Appointments/PatientShareResposne.dart b/lib/models/Appointments/PatientShareResposne.dart index 2e22ed60..40670990 100644 --- a/lib/models/Appointments/PatientShareResposne.dart +++ b/lib/models/Appointments/PatientShareResposne.dart @@ -1,19 +1,19 @@ class PatientShareResponse { int advanceNumber; - String appointmentDate; + dynamic appointmentDate; int appointmentNo; int cashPrice; int cashPriceTax; int cashPriceWithTax; int clinicID; - String clinicName; + dynamic clinicName; int companyId; - String companyName; + dynamic companyName; int companyShareWithTax; - String doctorImageURL; - String doctorNameObj; + dynamic doctorImageURL; + dynamic doctorNameObj; int doctorID; - List doctorSpeciality; + List doctorSpeciality; dynamic errCode; int groupID; bool iSAllowOnlineCheckedIN; @@ -22,7 +22,7 @@ class PatientShareResponse { int isFollowup; bool isLiveCareAppointment; bool isOnlineCheckedIN; - String message; + dynamic message; int nextAction; dynamic patientCardID; int patientID; @@ -30,19 +30,19 @@ class PatientShareResponse { dynamic patientShareWithTax; int patientStatusType; dynamic patientTaxAmount; - String patientType; + dynamic patientType; int paymentAmount; - String paymentDate; + dynamic paymentDate; dynamic paymentMethodName; dynamic paymentReferenceNumber; int policyId; - String policyName; - String procedureName; + dynamic policyName; + dynamic procedureName; int projectID; - String projectName; + dynamic projectName; dynamic setupID; int sourceType; - String startTime; + dynamic startTime; int status; int statusCode; dynamic statusDesc; @@ -102,7 +102,7 @@ class PatientShareResponse { this.userID, this.serviceID}); - PatientShareResponse.fromJson(Map json) { + PatientShareResponse.fromJson(Map json) { advanceNumber = json['AdvanceNumber']; appointmentDate = json['AppointmentDate']; appointmentNo = json['AppointmentNo']; @@ -117,7 +117,7 @@ class PatientShareResponse { doctorID = json['DoctorID']; doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; - doctorSpeciality = json['DoctorSpeciality'].cast(); +// doctorSpeciality = json['DoctorSpeciality'].cast(); errCode = json['ErrCode']; groupID = json['GroupID']; iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; @@ -155,8 +155,8 @@ class PatientShareResponse { serviceID = json['ServiceID']; } - Map toJson() { - final Map data = new Map(); + Map toJson() { + final Map data = new Map(); data['AdvanceNumber'] = this.advanceNumber; data['AppointmentDate'] = this.appointmentDate; data['AppointmentNo'] = this.appointmentNo; diff --git a/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart new file mode 100644 index 00000000..a1290e4d --- /dev/null +++ b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart @@ -0,0 +1,96 @@ +class CovidPaymentInfoResponse { + dynamic propertyChanged; + dynamic cashPriceField; + dynamic cashPriceTaxField; + dynamic cashPriceWithTaxField; + dynamic companyIdField; + String companyNameField; + dynamic companyShareWithTaxField; + dynamic errCodeField; + dynamic groupIDField; + dynamic insurancePolicyNoField; + String messageField; + dynamic patientCardIDField; + dynamic patientShareField; + dynamic patientShareWithTaxField; + dynamic patientTaxAmountField; + dynamic policyIdField; + dynamic policyNameField; + String procedureNameField; + dynamic setupIDField; + dynamic statusCodeField; + dynamic subPolicyNoField; + + CovidPaymentInfoResponse( + {this.propertyChanged, + this.cashPriceField, + this.cashPriceTaxField, + this.cashPriceWithTaxField, + this.companyIdField, + this.companyNameField, + this.companyShareWithTaxField, + this.errCodeField, + this.groupIDField, + this.insurancePolicyNoField, + this.messageField, + this.patientCardIDField, + this.patientShareField, + this.patientShareWithTaxField, + this.patientTaxAmountField, + this.policyIdField, + this.policyNameField, + this.procedureNameField, + this.setupIDField, + this.statusCodeField, + this.subPolicyNoField}); + + CovidPaymentInfoResponse.fromJson(Map json) { + propertyChanged = json['PropertyChanged']; + cashPriceField = json['cashPriceField']; + cashPriceTaxField = json['cashPriceTaxField']; + cashPriceWithTaxField = json['cashPriceWithTaxField']; + companyIdField = json['companyIdField']; + companyNameField = json['companyNameField']; + companyShareWithTaxField = json['companyShareWithTaxField']; + errCodeField = json['errCodeField']; + groupIDField = json['groupIDField']; + insurancePolicyNoField = json['insurancePolicyNoField']; + messageField = json['messageField']; + patientCardIDField = json['patientCardIDField']; + patientShareField = json['patientShareField']; + patientShareWithTaxField = json['patientShareWithTaxField']; + patientTaxAmountField = json['patientTaxAmountField']; + policyIdField = json['policyIdField']; + policyNameField = json['policyNameField']; + procedureNameField = json['procedureNameField']; + setupIDField = json['setupIDField']; + statusCodeField = json['statusCodeField']; + subPolicyNoField = json['subPolicyNoField']; + } + + Map toJson() { + final Map data = new Map(); + data['PropertyChanged'] = this.propertyChanged; + data['cashPriceField'] = this.cashPriceField; + data['cashPriceTaxField'] = this.cashPriceTaxField; + data['cashPriceWithTaxField'] = this.cashPriceWithTaxField; + data['companyIdField'] = this.companyIdField; + data['companyNameField'] = this.companyNameField; + data['companyShareWithTaxField'] = this.companyShareWithTaxField; + data['errCodeField'] = this.errCodeField; + data['groupIDField'] = this.groupIDField; + data['insurancePolicyNoField'] = this.insurancePolicyNoField; + data['messageField'] = this.messageField; + data['patientCardIDField'] = this.patientCardIDField; + data['patientShareField'] = this.patientShareField; + data['patientShareWithTaxField'] = this.patientShareWithTaxField; + data['patientTaxAmountField'] = this.patientTaxAmountField; + data['policyIdField'] = this.policyIdField; + data['policyNameField'] = this.policyNameField; + data['procedureNameField'] = this.procedureNameField; + data['setupIDField'] = this.setupIDField; + data['statusCodeField'] = this.statusCodeField; + data['subPolicyNoField'] = this.subPolicyNoField; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index 9a2f08df..58caee36 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -190,7 +190,7 @@ class _BloodCholesterolState extends State { child: TextFormField( controller: textController, inputFormatters: [ - FilteringTextInputFormatter.digitsOnly +// FilteringTextInputFormatter.digitsOnly ], keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index a90a5bbb..f5d66ccf 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -192,7 +192,7 @@ class _BloodSugarState extends State { child: TextFormField( controller: textController, inputFormatters: [ - FilteringTextInputFormatter.digitsOnly +// FilteringTextInputFormatter.digitsOnly ], keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart index fdf8d191..a86fdb88 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart @@ -188,7 +188,7 @@ class _TriglyceridesState extends State { child: TextFormField( controller: textController, inputFormatters: [ - FilteringTextInputFormatter.digitsOnly +// FilteringTextInputFormatter.digitsOnly ], keyboardType: TextInputType.number, decoration: InputDecoration( diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index aca0884f..88116cd9 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -385,8 +385,8 @@ class _DocAvailableAppointmentsState extends State color: _calendarController.isSelected(date) ? Colors.green[400] : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], + ? Colors.brown[300] + : Colors.blue[400], ), width: 40.0, height: 40.0, diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart new file mode 100644 index 00000000..060a8132 --- /dev/null +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -0,0 +1,599 @@ +import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:intl/intl.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:table_calendar/table_calendar.dart'; + +class CovidTimeSlots extends StatefulWidget { + int projectID; + static bool areSlotsAvailable = false; + static DateTime selectedAppoDateTime; + static String selectedDate; + static String selectedTime; + + int selectedClinicID; + int selectedDoctorID; + + PatientShareResponse patientShareResponse; + + CovidTimeSlots({@required this.projectID}); + + @override + _CovidTimeSlotsState createState() => _CovidTimeSlotsState(); +} + +class _CovidTimeSlotsState extends State + with TickerProviderStateMixin { + Map _events; + AnimationController _animationController; + CalendarController _calendarController; + + AppSharedPreferences sharedPref = new AppSharedPreferences(); + + var selectedDate = ""; + dynamic selectedDateJSON; + dynamic jsonFreeSlots; + + List docFreeSlots = []; + List dayEvents = []; + + int selectedButtonIndex = 0; + + dynamic freeSlotsResponse; + + ScrollController _scrollController; + + @override + void initState() { + final _selectedDay = DateTime.now(); + + widget.patientShareResponse = new PatientShareResponse(); + + _scrollController = new ScrollController(); + + _events = { + _selectedDay: ['Event A0'] + }; + + WidgetsBinding.instance.addPostFrameCallback( + (_) => getCovidFreeSlots(context, widget.projectID)); + + _calendarController = CalendarController(); + _animationController = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 50), + ); + + _animationController.forward(); + super.initState(); + } + + @override + void dispose() { + _animationController.dispose(); + _calendarController.dispose(); + super.dispose(); + } + + void _onDaySelected(DateTime day, List events) { + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + setState(() { + this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day); + openTimeSlotsPickerForDate(day, docFreeSlots); + CovidTimeSlots.selectedDate = formatter.format(day); + print(CovidTimeSlots.selectedDate); + }); + } + + void _onVisibleDaysChanged( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onVisibleDaysChanged'); + } + + void _onCalendarCreated( + DateTime first, DateTime last, CalendarFormat format) { + print('CALLBACK: _onCalendarCreated'); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 150.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/new-design/covid-19-big-banner-bg.png"), + fit: BoxFit.fill, + ), + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all(Radius.circular(10))), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 90.0, + height: 90.0), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 40.0), + child: Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 10.0), + child: Text("Drive-Thru", + style: TextStyle( + color: Colors.white, fontSize: 24.0)), + ), + ], + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + color: Colors.white), + margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0), + padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), + width: MediaQuery.of(context).size.width, + height: MediaQuery.of(context).size.height * 0.65, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(10.0), + child: Text( + "Kindly select one of the available appointments from below: ", + style: + TextStyle(color: Colors.black, fontSize: 16.0)), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + alignment: Alignment.center, + child: Text(selectedDate, + style: TextStyle( + fontSize: 18.0, fontWeight: FontWeight.bold)), + ), + Container( + height: 50, + margin: EdgeInsets.all(20.0), + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: dayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide( + color: Colors.blue[400], + //Color of the border + style: BorderStyle.solid, + //Style of the border + width: 1.5, //width of the border + ), + ), + minWidth: + MediaQuery.of(context).size.width * 0.2, + child: index == selectedButtonIndex + ? getSelectedButton(index) + : getNormalButton(index)), + ); + }, + ), + ), + _buildTableCalendarWithBuilders(), + ], + ), + ), + SizedBox( + height: 100.0, + ), + ], + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.all(10.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + bookCovidTestAppointment(); + }, + child: Text("BOOK", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + Widget _buildTableCalendarWithBuilders() { + return TableCalendar( + locale: 'en_US', + calendarController: _calendarController, + events: _events, + initialCalendarFormat: CalendarFormat.month, + startDay: DateTime.now(), + formatAnimation: FormatAnimation.slide, + startingDayOfWeek: StartingDayOfWeek.sunday, + weekendDays: [DateTime.friday, DateTime.saturday], + availableGestures: AvailableGestures.horizontalSwipe, + availableCalendarFormats: const { + CalendarFormat.month: '', + CalendarFormat.week: '', + }, + calendarStyle: CalendarStyle( + outsideDaysVisible: false, + weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), + holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), + ), + daysOfWeekStyle: DaysOfWeekStyle( + weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), + ), + headerStyle: HeaderStyle( + centerHeaderTitle: true, + formatButtonVisible: false, + ), + builders: CalendarBuilders( + selectedDayBuilder: (context, date, _) { + return FadeTransition( + opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), + child: Container( + margin: const EdgeInsets.all(4.0), + padding: const EdgeInsets.only(top: 5.0, left: 6.0), + color: Colors.transparent, + width: 0, + height: 0, + child: Text( + '${date.day}', + style: TextStyle().copyWith(fontSize: 16.0), + ), + ), + ); + }, + todayDayBuilder: (context, date, _) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + }, + markersBuilder: (context, date, events, holidays) { + final children = []; + + if (events.isNotEmpty) { + children.add( + Positioned( + right: 4, + bottom: 4, + child: _buildEventsMarker(date, events), + ), + ); + } + + return children; + }, + ), + onDaySelected: (date, events) { + _onDaySelected(date, events); + _animationController.forward(from: 0.0); + }, + onVisibleDaysChanged: _onVisibleDaysChanged, + onCalendarCreated: _onCalendarCreated, + ); + } + + openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) { + dayEvents.clear(); + DateTime dateStartObj = new DateTime( + dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); + + freeSlots.forEach((v) { + if (v.start == dateStartObj) dayEvents.add(v); + }); + + setState(() { + if (dayEvents.length != 0) + CovidTimeSlots.areSlotsAvailable = true; + else + CovidTimeSlots.areSlotsAvailable = false; + + selectedButtonIndex = 0; + + CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime; + }); + } + + Future> _getJSONSlots() async { + Map _eventsParsed; + List slotsList = []; + DateTime date; + final DateFormat formatter = DateFormat('HH:mm'); + final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); + for (var i = 0; i < freeSlotsResponse.length; i++) { + date = + DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']); + slotsList.add(FreeSlot(date, ['slot'])); + docFreeSlots.add(TimeSlot( + isoTime: formatter.format(date), + start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), + end: date)); + } + _eventsParsed = + Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); + setState(() { + CovidTimeSlots.selectedDate = dateFormatter.format( + DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); + selectedDate = DateUtil.getMonthDayYearDateFormatted( + DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); + selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; + }); + openTimeSlotsPickerForDate( + DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); + _calendarController + .setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); + return _eventsParsed; + } + + Widget _buildEventsMarker(DateTime date, List events) { + return Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _calendarController.isSelected(date) + ? Colors.green[400] + : _calendarController.isToday(date) + ? Colors.brown[300] + : Colors.blue[400], + ), + width: 40.0, + height: 40.0, + child: Center( + child: Text( + '${date.day}', + style: TextStyle().copyWith( + color: Colors.white, + fontSize: 14.0, + ), + ), + ), + ); + } + + Widget getNormalButton(int index) { + return RaisedButton( + color: Colors.white, + textColor: new Color(0xFF60686b), + onPressed: () { + setState(() { + selectedButtonIndex = index; + CovidTimeSlots.selectedTime = dayEvents[index].isoTime; + print(CovidTimeSlots.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + Widget getSelectedButton(int index) { + return RaisedButton( + color: Colors.blue[400], + textColor: Colors.white, + onPressed: () { + setState(() { + selectedButtonIndex = index; + CovidTimeSlots.selectedTime = dayEvents[index].isoTime; + print(CovidTimeSlots.selectedTime); + }); + }, + child: Text(dayEvents[index].isoTime, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), + ); + } + + bookCovidTestAppointment() { +// Navigator.push(context, +// MaterialPageRoute(builder: (context) => CovidPaymentAlert())); + + DoctorList docObject = new DoctorList(); + docObject.doctorID = widget.selectedDoctorID; + docObject.clinicID = widget.selectedClinicID; + docObject.projectID = widget.projectID; + insertAppointmentCovidTest(context, docObject); + } + + insertAppointmentCovidTest(context, DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + AppoitmentAllHistoryResultList appo; + service + .insertAppointment( + docObject.doctorID, + docObject.clinicID, + docObject.projectID, + CovidTimeSlots.selectedTime, + CovidTimeSlots.selectedDate, + context) + .then((res) { + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: "Appointment Booked Successfully"); + Future.delayed(new Duration(milliseconds: 1800), () { + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, + docObject.projectID, docObject); + }); + } else { + appo = new AppoitmentAllHistoryResultList(); + appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo']; + appo.clinicID = res['SameClinicApptList'][0]['DoctorID']; + appo.projectID = res['SameClinicApptList'][0]['ProjectID']; + appo.endTime = res['SameClinicApptList'][0]['EndTime']; + appo.startTime = res['SameClinicApptList'][0]['StartTime']; + appo.doctorID = res['SameClinicApptList'][0]['DoctorID']; + appo.isLiveCareAppointment = false; + appo.originalClinicID = 0; + appo.originalProjectID = 0; + appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate']; + + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: res['ErrorEndUserMessage'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {cancelAppointment(docObject, appo, context)}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { + AppToast.showErrorToast(message: err); + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, + BuildContext context) { + ConfirmDialog.closeAlertDialog(context); + DoctorsListService service = new DoctorsListService(); + service.cancelAppointment(appo, context).then((res) { + if (res['MessageStatus'] == 1) { + Future.delayed(new Duration(milliseconds: 1500), () { + insertAppointmentCovidTest(context, docObject); + }); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + getPatientShare(context, String appointmentNo, int clinicID, int projectID, + DoctorList docObject) { + DoctorsListService service = new DoctorsListService(); + service + .getPatientShare(appointmentNo, clinicID, projectID, context) + .then((res) { + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + navigateToPaymentAlert(); + }); + } + + navigateToPaymentAlert() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentAlert( + patientShareResponse: widget.patientShareResponse))); + } + + getCovidFreeSlots(BuildContext context, int projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + service.getCovidFreeSlots(context, projectID).then((res) { + print(res['COVID19_FreeTimeSlots']); + if (res['MessageStatus'] == 1) { + if (res['COVID19_FreeTimeSlots'].length != 0) { + freeSlotsResponse = res['COVID19_FreeTimeSlots']; + print(res['COVID19_FreeTimeSlots'].length); + _getJSONSlots().then((value) => { + setState(() => { + widget.selectedClinicID = + freeSlotsResponse[0]['ClinicID'], + widget.selectedDoctorID = + freeSlotsResponse[0]['DoctorID'], + _events.clear(), + _events = value + }) + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } +} diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 6b1c5f2b..0563c4bd 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -1,11 +1,13 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:maps_launcher/maps_launcher.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -19,6 +21,7 @@ class _CovidDrivethruLocationState extends State { String projectLat = ""; String projectLong = ""; String projectName = ""; + String projectID = ""; @override void initState() { @@ -94,15 +97,16 @@ class _CovidDrivethruLocationState extends State { )), isLocationSelected ? Container( - margin: EdgeInsets.only(top: 15.0), - alignment: Alignment.centerLeft, - child: Text("Selected Location", - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.black)), - ) : Container(), + margin: EdgeInsets.only(top: 15.0), + alignment: Alignment.centerLeft, + child: Text("Selected Location", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 18.0, + letterSpacing: 0.8, + color: Colors.black)), + ) + : Container(), isLocationSelected ? Container( margin: EdgeInsets.only(top: 5.0), @@ -212,15 +216,22 @@ class _CovidDrivethruLocationState extends State { } getDirections() { - if(isLocationSelected) { - MapsLauncher.launchCoordinates(double.parse(projectLat),double.parse(projectLong), this.projectName); + if (isLocationSelected) { + MapsLauncher.launchCoordinates(double.parse(projectLat), + double.parse(projectLong), this.projectName); } else { - Utils.showErrorToast("Please select address from the dropdown menu to get directions"); + Utils.showErrorToast( + "Please select address from the dropdown menu to get directions"); } } next() { - + if (isLocationSelected) { + getPaymentInfo(context, projectID); + } else { + Utils.showErrorToast( + "Please select address from the dropdown menu to continue"); + } } back() { @@ -229,21 +240,57 @@ class _CovidDrivethruLocationState extends State { setProjectLocation(newValue) { print(newValue); - print(projectsList[(int.parse(newValue) - 1)].projectName); setState(() { this.projectLat = projectsList[(int.parse(newValue) - 1)].latitude.toString(); this.projectLong = projectsList[(int.parse(newValue) - 1)].longitude.toString(); this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; + this.projectID = + projectsList[(int.parse(newValue) - 1)].projectID.toString(); isLocationSelected = true; }); } + getPaymentInfo(BuildContext context, String projectID) { + CovidDriveThruService service = new CovidDriveThruService(); + + CovidPaymentInfoResponse covidPaymentInfoResponse = + new CovidPaymentInfoResponse(); + + service + .getCovidPaymentInformation(context, int.parse(projectID)) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( + res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); + }); + } else {} + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); + }); + } + getProjectsList(BuildContext context) { CovidDriveThruService service = new CovidDriveThruService(); service.getCovidProjectsList(context).then((res) { + print(res); if (res['MessageStatus'] == 1) { + print(res); setState(() { res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart new file mode 100644 index 00000000..ac5f45fc --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -0,0 +1,288 @@ +import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CovidPaymentAlert extends StatefulWidget { + PatientShareResponse patientShareResponse; + + CovidPaymentAlert({@required this.patientShareResponse}); + + @override + _CovidPaymentAlertState createState() => _CovidPaymentAlertState(); +} + +class _CovidPaymentAlertState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 200.0, + color: new Color(0xFFc5272d), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 50.0), + child: SvgPicture.asset( + 'assets/images/new-design/alert_icon.svg', + width: 80.0, + height: 80.0), + ), + Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.only(left: 30.0, right: 20.0), + child: Text("Alert", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + margin: EdgeInsets.only( + left: 30.0, right: 20.0, top: 5.0), + child: Text( + "Pay With-in 15 mins to confirm the appointment", + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.white, fontSize: 20.0)), + ), + ], + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + alignment: Alignment.center, + child: Text("Pay With-in 15 mins", + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFFc5272d), + fontSize: 24.0, + fontWeight: FontWeight.bold)), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.only(top: 15.0), + child: Text( + "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically​.", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.grey[700], + fontSize: 18.0, + letterSpacing: 0.8)), + ), + Container( + margin: EdgeInsets.only( + top: 40.0, bottom: 10.0, left: 0.0, right: 20.0), + child: Text(TranslationBase.of(context).appoInfo, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700], + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(left: 0.0, bottom: 20.0), + width: MediaQuery.of(context).size.width, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.grey[200], + boxShadow: [ + BoxShadow(color: Colors.grey, spreadRadius: 2), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text("COVID-19 TEST", + style: TextStyle( + fontSize: 18.0, + color: Colors.black, + fontWeight: FontWeight.bold)), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: Icon( + Icons.local_hospital, + size: 24, + color: Colors.grey[700], + )), + Container( + child: Text( + widget.patientShareResponse.projectName != + null + ? widget.patientShareResponse.projectName + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: Icon( + Icons.date_range, + size: 24, + color: Colors.grey[700], + )), + Container( + child: Text( + widget.patientShareResponse.appointmentDate != + null + ? getDate(widget.patientShareResponse + .appointmentDate) + .split(" ")[0] + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: Icon( + Icons.access_time, + size: 24, + color: Colors.grey[700], + )), + Container( + child: Text( + widget.patientShareResponse.appointmentDate != + null + ? getDate(widget.patientShareResponse + .appointmentDate) + .split(" ")[1] + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 20.0, right: 20.0), + child: SvgPicture.asset( + "assets/images/new-design/track_icon.svg", + width: 20.0, + height: 20.0)), + Container( + child: Text( + widget.patientShareResponse.doctorNameObj != + null + ? widget + .patientShareResponse.doctorNameObj + : "NULL", + style: TextStyle( + fontSize: 18.0, color: Colors.grey[700])), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + bottomSheet: Container( + margin: EdgeInsets.all(10.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { +// bookCovidTestAppointment(); + }, + child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + String getDate(String appoDate) { + var appoDateFormatted = ""; + + var dateObj = DateUtil.convertStringToDate(appoDate); + + setState(() { + appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString() + + " " + + dateObj.hour.toString() + + ":" + + dateObj.minute.toString() + + ":00"; + }); + return appoDateFormatted; + } +} diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart new file mode 100644 index 00000000..1254997d --- /dev/null +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -0,0 +1,257 @@ +import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; + +class CovidPaymentDetails extends StatefulWidget { + CovidPaymentInfoResponse covidPaymentInfoResponse; + int projectID; + + CovidPaymentDetails( + {@required this.covidPaymentInfoResponse, @required this.projectID}); + + @override + _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); +} + +class _CovidPaymentDetailsState extends State { + bool isAgree = false; + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "COVID-19 TEST", + isShowAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 150.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + "assets/images/new-design/covid-19-big-banner-bg.png"), + fit: BoxFit.fill, + ), + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all(Radius.circular(10))), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: + EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), + child: SvgPicture.asset( + 'assets/images/new-design/covid-19-car.svg', + width: 90.0, + height: 90.0), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 40.0), + child: Text("COVID-19 TEST", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 24.0)), + ), + Container( + margin: EdgeInsets.only( + left: 20.0, right: 20.0, top: 10.0), + child: Text("Drive-Thru", + style: TextStyle( + color: Colors.white, fontSize: 24.0)), + ), + ], + ), + ], + ), + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + color: Colors.white), + margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), + padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), + child: Column( + children: [ + Container( + alignment: Alignment.center, + margin: + EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), + child: Text("Test Fees", + style: TextStyle( + color: Colors.black, + fontSize: 22.0, + fontWeight: FontWeight.bold)), + ), + Table( + children: [ + TableRow(children: [ + TableCell( + child: _getNormalText(TranslationBase.of(context) + .patientShareToDo)), + TableCell( + child: _getNormalText(widget + .covidPaymentInfoResponse.patientShareField + .toString())), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText( + TranslationBase.of(context).patientTaxToDo)), + TableCell( + child: _getNormalText(widget + .covidPaymentInfoResponse + .patientTaxAmountField + .toString())), + ]), + TableRow(children: [ + TableCell( + child: _getNormalText(TranslationBase.of(context) + .patientShareTotalToDo)), + TableCell( + child: _getNormalText(widget + .covidPaymentInfoResponse + .patientShareWithTaxField + .toString())), + ]), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); + }, + activeColor: Colors.blue, + ), + Texts(TranslationBase.of(context) + .iAgreeToTheTermsAndConditions), + ], + ), + ), + Divider( + color: Colors.grey, + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0), + child: Text("You can pay by following options: ", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + fontFamily: "Open-Sans")), + ), + Container( + alignment: Alignment.center, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), + child: Image.asset( + "assets/images/new-design/payment_options_invoice_confirmation.png", + width: 300), + ), + ], + ), + ), + ), + bottomSheet: Container( + margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 20.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: () { + cancel(); + }, + child: Text("CANCEL", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: Colors.grey[500], + onPressed: isAgree ? next : null, + child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ); + } + + void next() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidTimeSlots( + projectID: widget.projectID, + ))); + } + + cancel() { + Navigator.pop(context); + } + + _getNormalText(text) { + return Container( + margin: EdgeInsets.only(top: 20.0, right: 10.0), + child: Text(text, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 15, + fontFamily: 'Open-Sans', + letterSpacing: 0.5, + color: Colors.grey[700])), + ); + } +} diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 796794b2..7c20b53d 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -107,7 +107,7 @@ class _ToDoState extends State { .liveCareAppo, style: TextStyle(fontSize: 12.0)) : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-", - style: TextStyle(fontSize: 12.0)), + style: TextStyle(fontSize: 11.0)), ), ], ), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index d427c2f1..79671682 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -94,11 +94,11 @@ class _HomePageState extends State { children: [ Container( margin: EdgeInsets.only( - top: 15.0), + top: 15.0, left: 3.5, right: 3.5), child: SvgPicture.asset( 'assets/images/new-design/covid-19-car.svg', - width: 50.0, - height: 50.0), + width: 45.0, + height: 45.0), ), Container( margin: EdgeInsets.only( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index a545f8a7..0c6a2144 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -29,9 +29,6 @@ import 'package:rxdart/rxdart.dart'; import 'home_page.dart'; - - - class LandingPage extends StatefulWidget { static bool isOpenCallPage = false; diff --git a/lib/services/covid-drivethru/covid-drivethru.dart b/lib/services/covid-drivethru/covid-drivethru.dart index a9ebbecd..2681783b 100644 --- a/lib/services/covid-drivethru/covid-drivethru.dart +++ b/lib/services/covid-drivethru/covid-drivethru.dart @@ -49,4 +49,78 @@ class CovidDriveThruService extends BaseService { }, body: request); return Future.value(localRes); } + + Future getCovidPaymentInformation(BuildContext context, int projectID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "ProjectID": projectID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_PAYMENT_INFO, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + + Future getCovidFreeSlots(BuildContext context, int projectID) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getString(APP_LANGUAGE); + Request req = appGlobal.getPublicRequest(); + request = { + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "ProjectID": projectID, + "VersionID": req.VersionID, + "Channel": req.Channel, + "generalid": 'Cs2020@2016\$2958', + "PatientOutSA": authUser.outSA, + "TokenID": "", + "DeviceTypeID": req.DeviceTypeID, + "SessionID": "YckwoXhUmWBsnHKEKig", + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "License": true + }; + + dynamic localRes; + + await baseAppClient.post(GET_COVID_DRIVETHRU_FREE_SLOTS, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } } From a8ee7db62b038f5895cace43ac58edc84410a2ec Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 11 Oct 2020 13:20:22 +0300 Subject: [PATCH 51/65] fixes # Conflicts: # lib/config/config.dart --- lib/config/config.dart | 9 ++++++++- .../AlHabibMedicalService/​ health_calculators.dart | 4 ++-- lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart | 1 - 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 96804aeb..0f92db66 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -258,6 +258,14 @@ const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; + +const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; + +const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; + +const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; + + ///My Trackers const GET_DIABETIC_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_GetDiabtecResults'; @@ -304,7 +312,6 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; -const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; const TIMER_MIN = 10; diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index 56fb0428..97141716 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -1,5 +1,3 @@ -import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; -import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; @@ -8,7 +6,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'health_calculator/bmi_calculator/bmi_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart'; +import 'health_calculator/calorie_calculator/calorie_calculator.dart'; import 'health_calculator/ideal_body/ideal_body.dart'; class HealthCalculators extends StatefulWidget { diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 2113d2b5..8e9fe806 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -140,7 +140,6 @@ class _HospitalsLiveChatPageState extends State { icon: Icon( Icons .arrow_forward_ios, - .arrow_forward, color: tappedIndex == index ? Colors.white From 83735ab68d183f733387c5f278cd77e178275545 Mon Sep 17 00:00:00 2001 From: Amjad amireh Date: Sun, 11 Oct 2020 15:23:01 +0300 Subject: [PATCH 52/65] modified Child vaccintion note --- lib/config/config.dart | 4 + .../childvaccines/delete_baby_model.dart | 76 ++++++ .../childvaccines/delete_baby_service.dart | 75 +++++ .../add_new_child_view_model.dart | 20 +- .../child_vaccines_view_model.dart | 40 +++ lib/locator.dart | 4 + .../ChildVaccines/add_newchild_page.dart | 79 +++--- lib/pages/ChildVaccines/child_page.dart | 57 ++-- .../ChildVaccines/child_vaccines_page.dart | 256 +----------------- .../dialogs/SelectGenderDialog.dart | 6 + .../ChildVaccines/dialogs/delete_child.dart | 103 +++++++ .../ChildVaccines/vaccinationtable_page.dart | 62 +---- lib/widgets/input/text_field.dart | 9 +- 13 files changed, 424 insertions(+), 367 deletions(-) create mode 100644 lib/core/model/childvaccines/delete_baby_model.dart create mode 100644 lib/core/service/childvaccines/delete_baby_service.dart create mode 100644 lib/pages/ChildVaccines/dialogs/delete_child.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e45d5cf8..1342c28e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -84,6 +84,10 @@ const GET_NEW_USER_REQUEST= const GET_NEWCHILD_REQUEST= 'Services/Community.svc/REST/CreateNewBaby'; +///delteChild +const DELETE_CHILD_REQUEST= + 'Services/Community.svc/REST/DeleteBaby'; + ///addNewTABLE const GET_TABLE_REQUEST= diff --git a/lib/core/model/childvaccines/delete_baby_model.dart b/lib/core/model/childvaccines/delete_baby_model.dart new file mode 100644 index 00000000..9274b1e8 --- /dev/null +++ b/lib/core/model/childvaccines/delete_baby_model.dart @@ -0,0 +1,76 @@ +class DeleteBaby { + bool isLogin; + int babyID; + int editedBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + DeleteBaby( + {this.isLogin, + this.babyID, + this.editedBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + DeleteBaby.fromJson(Map json) { + isLogin = json['IsLogin']; + babyID = json['BabyID']; + editedBy = json['EditedBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['IsLogin'] = this.isLogin; + data['BabyID'] = this.babyID; + data['EditedBy'] = this.editedBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/delete_baby_service.dart b/lib/core/service/childvaccines/delete_baby_service.dart new file mode 100644 index 00000000..115d13c5 --- /dev/null +++ b/lib/core/service/childvaccines/delete_baby_service.dart @@ -0,0 +1,75 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import '../base_service.dart'; + + + +class DeleteBabyService extends BaseService{ + + List createNewBabyModelList = List(); + List userModelList = List(); + List newUserModelList = List(); + + List deleteBabyModelList= List(); + + + Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async { + hasError = false; + await getUser(); + Map body = Map.from(deleteChild.toJson()); + // body['CreatedBy'] = 102; + body['EditedBy'] = 102; + //body['BabyID'] = babyID; + //body['BabyID'] = createNewBabyModelList ; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + + body['isDentalAllowedBackend'] = false; + + await baseAppClient.post(DELETE_CHILD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + var asd =""; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + // Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { + // hasError = false; + // await getUser(); + // Map body = Map.from(newChild.toJson()); + // body['CreatedBy'] = 102; + // body['EditedBy'] = 102; + // body['UserID'] = userID; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + // body['IsLogin'] = true; + // body['LogInTokenID'] = await sharedPref.getString(TOKEN); + // body['MobileNumber'] = user.mobileNumber; + // body['NationalID'] = user.nationalityID; + // body['ZipCode'] = user.zipCode; + // + // body['isDentalAllowedBackend'] = false; + // + // await baseAppClient.post(GET_NEWCHILD_REQUEST, + // onSuccess: (dynamic response, int statusCode) { + // var asd =""; + // }, + // onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: body); + // } + +} \ No newline at end of file diff --git a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart index f0b55caa..eebaca02 100644 --- a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -11,6 +13,7 @@ class AddNewChildViewModel extends BaseViewModel { CreteNewBabyService _creteNewBabyService = locator(); ChildVaccinesService _childVaccinesService = locator(); + // DeleteBabyService _deleteBabyService = locator(); bool isAdded = false; ///create new baby createNewBabyOrders({ CreateNewBaby newChild}) async { @@ -22,15 +25,18 @@ class AddNewChildViewModel extends BaseViewModel { } else { isAdded = true; setState(ViewState.Idle); - // await _childVaccinesService.getAllBabyInformationOrders(); - // if (_childVaccinesService.hasError) { - // error = _childVaccinesService.error; - // setState(ViewState.Error); - // } else{ - // - // } + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } } } + + + } diff --git a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart index c19d9168..7c4af285 100644 --- a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -1,7 +1,12 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +//======== +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -11,6 +16,16 @@ class ChildVaccinesViewModel extends BaseViewModel{ List get babyInformationModelList=> _childVaccinesService.babyInformationModelList; + +//=========== + CreteNewBabyService _creteNewBabyService = locator(); + + DeleteBabyService _deleteBabyService = locator(); + bool isAdded = false; + bool isDeleted = false; + //============ + + getNewUserOrders() async { setState(ViewState.Busy); await _childVaccinesService.getNewUserOrders(); @@ -30,4 +45,29 @@ class ChildVaccinesViewModel extends BaseViewModel{ setState(ViewState.Idle); } + + + ///delete baby + deleteBabyOrders({ DeleteBaby newChild}) async { + setState(ViewState.Busy); + //await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID); + //getDeleteBabyOrder(deleteChild: newChild,); + // getDeleteBabyOrder + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; + setState(ViewState.Error); + } else { + isDeleted = true; + setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } + } + } + } \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 734e281f..e6140ce1 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -13,6 +13,7 @@ import 'core/service/blood/blood_details_servies.dart'; import 'core/service/blood/blood_donation_service.dart'; import 'core/service/childvaccines/add_new_child_service.dart'; import 'core/service/childvaccines/child_vaccines_service.dart'; +import 'core/service/childvaccines/delete_baby_service.dart'; import 'core/service/childvaccines/user_information_service.dart'; import 'core/service/childvaccines/vaccination_table_service.dart'; import 'core/service/contactus/finadus_service.dart'; @@ -123,6 +124,9 @@ void setupLocator() { locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); + locator.registerLazySingleton(() => DeleteBabyService()); + + locator.registerLazySingleton(() => VaccinationTableService()); diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index a8e97b60..51b89f98 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -133,13 +133,16 @@ class _AddNewChildPageState extends State { height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, padding: EdgeInsets.all(12), + + child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( height: MediaQuery.of(context).size.height * 0.12, - width: 170, + width: 175, + color: Colors.white, child: SecondaryButton( textColor: checkedValue == 1 ? Colors.white : Colors.black, @@ -160,7 +163,8 @@ class _AddNewChildPageState extends State { ), Container( height: MediaQuery.of(context).size.height * 0.12, - width: 170, + width: 175, + color: Colors.white, child: SecondaryButton( textColor: checkedValue == 2 ? Colors.white : Colors.black, @@ -236,46 +240,47 @@ class _AddNewChildPageState extends State { SizedBox( height: 12, ), - //========= - ], - ), - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.12, - width: double.infinity, - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: "Add", - // - onTap: () async{ - newChild.babyName = _firstTextController.text + " " + _secondTextController.text; - newChild.gender = checkedValue.toString(); - newChild.strDOB = getStartDay(); - newChild.tempValue = true; - newChild.isLogin = true; + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "Add", + // + onTap: () async{ + newChild.babyName = _firstTextController.text + " " + _secondTextController.text; + newChild.gender = checkedValue.toString(); + newChild.strDOB = getStartDay(); + newChild.tempValue = true; + newChild.isLogin = true; - await model.createNewBabyOrders(newChild: newChild); - if(model.isAdded){ - AppToast.showSuccessToast(message: "Record Added"); - Navigator.pop(context,model.isAdded); - }else{ + await model.createNewBabyOrders(newChild: newChild); + if(model.isAdded){ + AppToast.showSuccessToast(message: "Record Added"); + Navigator.pop(context,model.isAdded); + }else{ - //TODO handling error - } + //TODO handling error + } - }, + }, + ), + ), + //========= + ], + ), ), ), + // bottomSheet: ), ); } diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 9f9f933c..806a5b71 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -11,6 +13,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'dialogs/delete_child.dart'; + class ChildPage extends StatefulWidget { @override _ChildPageState createState() => _ChildPageState(); @@ -18,6 +22,9 @@ class ChildPage extends StatefulWidget { class _ChildPageState extends State with SingleTickerProviderStateMixin { + + DeleteBaby deleteBaby = DeleteBaby(); + @override Widget build(BuildContext context) { var checkedValue = true; @@ -84,23 +91,19 @@ class _ChildPageState extends State Icons.remove_red_eye, color: Colors.red, ), - tooltip: 'Increase volume by 10', + tooltip: '', onPressed: () { Navigator.push( context, FadePage( + + page: VaccinationTablePage(), - //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // HospitalsPage( - // findusHospitalModelList: model.FindusHospitalModelList, - // ) + ), ); - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); + }, ) ]), @@ -111,11 +114,10 @@ class _ChildPageState extends State IconButton( icon: new Image.asset( 'assets/images/new-design/calender-secondary.png'), - tooltip: 'Increase volume by 10', + tooltip: '', onPressed: () { setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); }, ), @@ -128,14 +130,31 @@ class _ChildPageState extends State icon: new Image.asset( 'assets/images/new-design/garbage.png'), tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); + onPressed: ()async { + + //===================== + await model.deleteBabyOrders(newChild:deleteBaby ); + + + deleteBaby.babyID=model.babyInformationModelList[index] + .babyID; + + await model.deleteBabyOrders(newChild:deleteBaby ); + if(model.isDeleted){ + AppToast.showSuccessToast(message: "Record Deleted"); + Navigator.pop(context,model.isDeleted); + }else{ + + //TODO handling error + } + + + + + }, ), - Texts("Birthday"), + Texts("Delete"), ]), SizedBox( height: 12, @@ -153,7 +172,7 @@ class _ChildPageState extends State bottomSheet: Container( height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(15), child: SecondaryButton( textColor: Colors.white, color: checkedValue == false diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index f8fe7b74..92f3a0be 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -50,7 +50,8 @@ class _ChildVaccinesPageState extends State child: Texts("Welcome back",fontSize: 20,), ) , ), - Divider(color:Colors.black ,), + Divider(color:Colors.black , indent: 10, + endIndent: 10,), SizedBox( height: 20, ), @@ -61,13 +62,17 @@ class _ChildVaccinesPageState extends State ) , ), - Divider(color:Colors.black ,), + Divider(color:Colors.black , indent: 10, + endIndent: 10,), Padding( padding: const EdgeInsets.all(10.0), child:Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: model.user.emailAddress,//'Title', + fillColor: Colors.red, + + hintText: model.user.emailAddress, controller: titleController, fontSize: 20, hintColor: Colors.black, @@ -75,9 +80,7 @@ class _ChildVaccinesPageState extends State onChanged: (text) { addEmail=text; model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; - // checkedValue=true; - // print("First text field: $text"); - // print("First text field:"+ model.user.emailAddress); + }, validator: (value) { @@ -99,7 +102,7 @@ class _ChildVaccinesPageState extends State height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(15), child: SecondaryButton( textColor: Colors.white, color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), @@ -121,7 +124,7 @@ class _ChildVaccinesPageState extends State height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, - padding: EdgeInsets.all(12), + padding: EdgeInsets.all(15), child: SecondaryButton( textColor: Colors.white, color: Color.fromRGBO(63, 72, 74, 1,), @@ -140,6 +143,7 @@ class _ChildVaccinesPageState extends State ), ), + // Texts( // // TranslationBase.of(context).advancePaymentLabel, // model.user.emailAddress, @@ -148,253 +152,21 @@ class _ChildVaccinesPageState extends State SizedBox( height: 12, ), - // InkWell( - // onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getHospitalName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), SizedBox( height: 12, ), - // InkWell( - // //======Gender======== - // onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model), - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // //Texts(getBeneficiaryType()), - // Texts(getGender()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), SizedBox( height: 12, ), - // InkWell( - // //======Gender======== - // onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model), - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // //Texts(getBeneficiaryType()), - // Texts(getBlood()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), + SizedBox( height: 12, ), - // Row( - // children: [ - // Container( - // child: Text(" To view the terms and conditions "), - // ), - // SizedBox( - // width: MediaQuery.of(context).size.height * 0.10, - // ), - // // InkWell( - // // onTap: () { - // // Navigator.of(context).push(MaterialPageRoute( - // // builder: (BuildContext context) => UserAgreementPage())); - // // }, - // // child: Container( - // // child: Texts(" Click here ",color: Colors.blue,), - // // ), - // // ) - // ], - // ), + SizedBox( height: 12, ), - // Row( - // children: [ - // Checkbox( - // onChanged: (bool value) { - // setState(() { - // checkedValue = value; - // }); - // }, - // // tristate: checkedValue==true,//i == 1, - // value: checkedValue, - // activeColor: Colors.red,//Color(0xFF6200EE), - // ), - // SizedBox(height: 10,), - // Row(children: [ - // - // ],), - // SizedBox( - // width: 10, - // ), - // Text( - // 'I agree to the terms and conditions ', - // style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), - // ), - // ], - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).fileNumber, - // controller: _fileTextController, - // ), - // if (beneficiaryType == BeneficiaryType.OtherAccount) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.OtherAccount) - // InkWell( - // onTap: () { - // if (_fileTextController.text.isNotEmpty) - // model - // .getPatientInfoByPatientID( - // id: _fileTextController.text) - // .then((value) { - // confirmSelectPatientDialog(model.patientInfoList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: - // Colors.blue.withOpacity(0.6)); - // else - // AppToast.showErrorToast( - // message: 'Please Enter The File Number'); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getPatientName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), - // SizedBox( - // height: 12, - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).amount, - // keyboardType: TextInputType.number, - // onChanged: (value) { - // setState(() { - // amount = value; - // }); - // }, - // ), - // SizedBox( - // height: 12, - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).depositorEmail, - // initialValue: model.user.emailAddress, - // onChanged: (value) { - // email = value; - // }, - // ), - // SizedBox( - // height: 12, - // ), - // NewTextFields( - // hintText: TranslationBase.of(context).notes, - // controller: _notesTextController, - // ), SizedBox( height: 10, ), diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index f84dea29..259bbdb7 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -1,10 +1,14 @@ import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class SelectGenderDialog extends StatefulWidget { + final Email; + + const SelectGenderDialog({Key key, this.Email}) : super(key: key); @override _SelectGenderDialogState createState() => _SelectGenderDialogState(); } @@ -31,6 +35,7 @@ class _SelectGenderDialogState extends State { child: ListTile( title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), + ), ), ) @@ -77,6 +82,7 @@ class _SelectGenderDialogState extends State { flex: 1, child: InkWell( onTap: () { + AppToast.showSuccessToast(message: "Email Sended"); // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, diff --git a/lib/pages/ChildVaccines/dialogs/delete_child.dart b/lib/pages/ChildVaccines/dialogs/delete_child.dart new file mode 100644 index 00000000..250f40d3 --- /dev/null +++ b/lib/pages/ChildVaccines/dialogs/delete_child.dart @@ -0,0 +1,103 @@ +import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class DeleteChild extends StatefulWidget { + @override + _DeleteChildState createState() => _DeleteChildState(); +} + +class _DeleteChildState extends State { + @override + Widget build(BuildContext context) { + return SimpleDialog( + children: [ + Container( + child: Column( + children: [ + Divider(), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + setState(() { + //beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Delete the child "), + + ), + ), + ) + ], + ), + SizedBox( + height: 5.0, + ), + + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).cancel.toUpperCase(), + color: Colors.red, + ), + ), + ), + ), + ), + ), + Container( + width: 1, + height: 30, + color: Colors.grey[500], + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // widget.onValueSelected(beneficiaryType); + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + TranslationBase.of(context).ok, + fontWeight: FontWeight.w400, + ), + ), + ), + ), + ), + ], + ) + ], + ), + ) + ], + ); + } +} diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 6ac11e4f..c160acfb 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -61,67 +61,7 @@ class VaccinationTablePage extends StatelessWidget { ],), Divider(color:Colors.black ,), - // Row(children:[Texts("CHILD NAME"),]), - // Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), - - // Row( - // children: [IconButton( - // icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'), - // tooltip: '', - // onPressed: () { - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - // }, - // ), - // Texts(model.babyInformationModelList[index].genderDescription), - // IconButton( - // icon: Icon(Icons.remove_red_eye,color: Colors.red,), - // tooltip: 'Increase volume by 10', - // onPressed: () { - // Navigator.push( - // context, - // FadePage( - // page: VaccinationTablePage(), - // - // //ChildPage(babyInformationModelList:model.BabyInformationModelList) - // // HospitalsPage( - // // findusHospitalModelList: model.FindusHospitalModelList, - // // ) - // - // ), - // ); - // // setState(() { - // // // _volume += 10; - // // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // // }); - // }, - // )] - // ), - // Row(children:[Texts("Birthday"),]), - // Row(children:[IconButton( - // icon: new Image.asset('assets/images/new-design/calender-secondary.png'), - // tooltip: 'Increase volume by 10', - // onPressed: () { - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - // }, - // ), - // Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]), - // Row(children:[IconButton( - // icon: new Image.asset('assets/images/new-design/garbage.png'), - // tooltip: '', - // onPressed: () { - // setState(() { - // // _volume += 10; - // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - // }); - // }, - // ), - // Texts("Birthday"),]), + ], ) diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index 0476c352..7cfba5e6 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -46,6 +46,7 @@ class TextFields extends StatefulWidget { this.suffixIcon, this.autoFocus, this.onChanged, + // this.initialValue, this.minLines, this.maxLines, @@ -72,6 +73,7 @@ class TextFields extends StatefulWidget { this.fontSize = 16.0, this.fontWeight = FontWeight.w700, this.autoValidate = false, + this.fillColor, this.hintColor}) : super(key: key); @@ -108,6 +110,7 @@ class TextFields extends StatefulWidget { final bool focus; final bool borderOnlyError; final Color hintColor; + final Color fillColor; @override _TextFieldsState createState() => _TextFieldsState(); @@ -211,7 +214,7 @@ class _TextFieldsState extends State { blurRadius: focus ? 34.0 : 12.0) ]), child: TextFormField( - + keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), autovalidate: widget.autoValidate, @@ -242,6 +245,7 @@ class _TextFieldsState extends State { .textTheme .body2 .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -249,12 +253,15 @@ class _TextFieldsState extends State { ] : widget.inputFormatters, decoration: InputDecoration( + counterText: "", hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, + + ), contentPadding: widget.padding != null ? widget.padding From c6a9b6653803b9ce3839e7df2c75b9ab4deac01e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 11 Oct 2020 16:11:57 +0300 Subject: [PATCH 53/65] women health --- .../bmr_calculator/bmr_calculator.dart | 6 +- .../health_calculator/body_fat/body_fat.dart | 593 +++++++++--------- .../calorie_calculator.dart | 6 +- .../health_calculator/carbs/carbs.dart | 2 +- .../delivery_due/delivery_due.dart | 146 +++++ .../delivery_due_result_page.dart | 106 ++++ .../ideal_body/ideal_body.dart | 300 ++++----- .../ovulation_period/ovulation_period.dart | 350 +++++++++++ .../ovulation_result_page.dart | 96 +++ .../​ health_calculators.dart | 22 +- 10 files changed, 1173 insertions(+), 454 deletions(-) create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart index 05d3d07a..3d287610 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -207,7 +207,7 @@ class _BmrCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -306,7 +306,7 @@ class _BmrCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -481,7 +481,7 @@ class _BmrCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 4a939b3f..ccc7d212 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -285,98 +285,101 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(heightCm.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(heightCm.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (heightCm < 250) + heightCm++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (heightCm < 250) - heightCm++; + if (heightCm > 0) + heightCm--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (heightCm > 0) - heightCm--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: heightCm.toDouble(), - min: 0, - max: 250, - onChanged: (double newValue) { - setState(() { - heightCm = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: heightCm.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + heightCm = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -458,96 +461,99 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(neck.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(neck.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (neck < 60) neck++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (neck < 60) neck++; + if (neck > 5) neck--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (neck > 5) neck--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: neck.toDouble(), - min: 5, - max: 60, - onChanged: (double newValue) { - setState(() { - neck = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: neck.toDouble(), + min: 5, + max: 60, + onChanged: (double newValue) { + setState(() { + neck = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -629,96 +635,100 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(waist.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(waist.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (waist < 200) + waist++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (waist < 200) waist++; + if (waist > 5) waist--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (waist > 5) waist--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: waist.toDouble(), - min: 5, - max: 200, - onChanged: (double newValue) { - setState(() { - waist = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: waist.toDouble(), + min: 5, + max: 200, + onChanged: (double newValue) { + setState(() { + waist = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -800,96 +810,99 @@ class _BodyFatState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(hip.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(hip.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, ), + onTap: () { + setState(() { + if (hip < 140) hip++; + }); + }, ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (hip < 140) hip++; + if (hip > 5) hip--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (hip > 5) hip--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: hip.toDouble(), - min: 5, - max: 140, - onChanged: (double newValue) { - setState(() { - hip = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: hip.toDouble(), + min: 5, + max: 140, + onChanged: (double newValue) { + setState(() { + hip = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index ac1aacc3..994484e7 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -181,7 +181,7 @@ class _CalorieCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -280,7 +280,7 @@ class _CalorieCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, @@ -448,7 +448,7 @@ class _CalorieCalculatorState extends State { Row( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index 32ec9262..2dfc3f92 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -97,7 +97,7 @@ class _CarbsState extends State { Column( children: [ Container( - width: 335.0, + width: 340.0, height: 60.0, decoration: BoxDecoration( color: Colors.white, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart new file mode 100644 index 00000000..1e8cb50c --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -0,0 +1,146 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; + +import 'delivery_due_result_page.dart'; + +class DeliveryDue extends StatefulWidget { + @override + _DeliveryDueState createState() => _DeliveryDueState(); +} + +class _DeliveryDueState extends State { + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + var dateFrom = DateTime.now(); + var dateTo = DateTime.now(); + var conceivedDate = DateTime.now(); + var deliveryDue = DateTime.now(); + var firstTrimester = DateTime.now(); + var secondTrimester = DateTime.now(); + var thirdTrimester = DateTime.now(); + var dt = DateTime.now(); + var newFormat = DateFormat("yy-MM-dd"); + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Delivery Due Date', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), + child: SingleChildScrollView( + child: Container( + child: Column( + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + 'Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual perios began (the first day), then click calculate.', + ), + Divider( + //height: 2, + thickness: 2, + ), + Column( + children: [ + Texts( + 'What was the date of the first day of the last period?', + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate == date + ? null + : bloodSugarDate = DateTime.now(); + dateFrom = date.add(Duration(days: 10)); + + dateTo = date.add(Duration(days: 20)); + conceivedDate = date.add(Duration(days: 14)); + deliveryDue = date.add(Duration(days: 280)); + firstTrimester = date.add(Duration(days: 85)); + secondTrimester = date.add(Duration(days: 190)); + thirdTrimester = date.add(Duration(days: 280)); + }); + }, + currentTime: DateTime.now(), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon(Icons.date_range_rounded), + Texts('Date'), + ], + ), + Texts(getDate()), + ], + ), + ), + ), + ], + ), + SizedBox( + height: 280.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DeliveryDueResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + firstTrimester: firstTrimester, + secondTrimester: secondTrimester, + thirdTrimester: thirdTrimester, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart new file mode 100644 index 00000000..fc53b044 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due_result_page.dart @@ -0,0 +1,106 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class DeliveryDueResult extends StatelessWidget { + var dateFrom; + var dateTo; + var conceivedDate; + var deliveryDue; + var firstTrimester; + var secondTrimester; + var thirdTrimester; + DeliveryDueResult( + {this.dateFrom, + this.dateTo, + this.conceivedDate, + this.deliveryDue, + this.firstTrimester, + this.secondTrimester, + this.thirdTrimester}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Delivery Due Date', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), + child: SingleChildScrollView( + child: Container( + height: 750.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'The next ovulation period is estimated to be:', + fontWeight: FontWeight.w400, + ), + Texts( + 'From:', + fontWeight: FontWeight.w400, + ), + Texts(DateFormat.yMMMEd().format(dateFrom), + fontWeight: FontWeight.w800, + fontSize: 21.0, + color: Color(0xffC5272D)), + Texts( + 'To:', + fontWeight: FontWeight.w400, + ), + Texts(DateFormat.yMMMEd().format(dateTo), + fontWeight: FontWeight.w800, + fontSize: 21.0, + color: Color(0xffC5272D)), + Texts( + 'You have conceived on:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(conceivedDate), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'First Trimester Ends (12 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(firstTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Second Trimester Ends (27 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(secondTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Third Trimester, Estimated Due Date (40 weeks):', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(thirdTrimester), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index f534416f..fb4f8948 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -29,7 +29,7 @@ class _IdealBodyState extends State { double overWeightBy; int weight = 0; double idealWeight = 0; - String dropdownValue; + String dropdownValue = 'Medium(fingers touch)'; double calories = 0; String textResult = ''; double maxIdealWeight; @@ -126,97 +126,100 @@ class _IdealBodyState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(height.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), ), ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (height < 250) - height++; + if (height > 0) height--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (height > 0) height--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: height.toDouble(), - min: 0, - max: 250, - onChanged: (double newValue) { - setState(() { - height = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], @@ -304,97 +307,100 @@ class _IdealBodyState extends State { ), Row( children: [ - Container( - width: 335.0, - height: 60.0, - decoration: BoxDecoration( - color: Colors.white, - ), - child: Row( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 10.0, horizontal: 8.0), - child: Center( - child: Container( - width: 60.0, - foregroundDecoration: BoxDecoration( - borderRadius: BorderRadius.circular(5.0), - border: Border.all( - color: Colors.blueGrey, - width: 2.0, + Expanded( + child: Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: + BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), ), - ), - child: Row( - children: [ - Expanded( - child: Center( - child: Text(weight.toString()), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), ), - ), - Container( - height: 38.0, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Container( - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 0.5, + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), ), ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), ), - child: InkWell( + InkWell( child: Icon( - Icons.arrow_drop_up, + Icons.arrow_drop_down, size: 18.0, ), onTap: () { setState(() { - if (weight < 250) - weight++; + if (weight > 0) weight--; }); }, ), - ), - InkWell( - child: Icon( - Icons.arrow_drop_down, - size: 18.0, - ), - onTap: () { - setState(() { - if (weight > 0) weight--; - }); - }, - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), - ), - Expanded( - child: Slider( - value: weight.toDouble(), - min: 0, - max: 250, - onChanged: (double newValue) { - setState(() { - weight = newValue.round(); - }); - }, - activeColor: Color(0xffC5272D), - inactiveColor: Color(0xffF3C5C6), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), ), - ), - ], + ], + ), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart new file mode 100644 index 00000000..adc2f06d --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -0,0 +1,350 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; + +class OvulationPeriod extends StatefulWidget { + @override + _OvulationPeriodState createState() => _OvulationPeriodState(); +} + +class _OvulationPeriodState extends State { + DateTime bloodSugarDate = DateTime.now(); + DateTime timeSugarDate = DateTime.now(); + int cycleLength = 0; + int lutealPhaseLength = 0; + String selectedDate; + var dateFrom = DateTime.now(); + var dateTo = DateTime.now(); + var conceivedDate = DateTime.now(); + var deliveryDue = DateTime.now(); + var dt = DateTime.now(); + var newFormat = DateFormat("yy-MM-dd"); + String updatedDt; + + String getTime() { + return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; + } + + String getDate() { + return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}"; + } + + // void calculate() {} + // + // void calculateFertility(DateTime selectedDate) {const diff = Date.} + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ovulation Period', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 700.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Calculates Ovulation Period'), + SizedBox( + height: 12.0, + ), + Divider( + //height: 2, + thickness: 2, + ), + SizedBox( + height: 12.0, + ), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now(), + onConfirm: (date) { + print('confirm $date'); + setState(() { + bloodSugarDate = date; + dateFrom = date.add(Duration(days: 10)); + updatedDt = DateFormat.yMMMEd().format(dateFrom); + + dateTo = date.add(Duration(days: 20)); + conceivedDate = date.add(Duration(days: 14)); + deliveryDue = date.add(Duration(days: 280)); + }); + }, + currentTime: DateTime.now(), + ); + }, + child: Container( + padding: EdgeInsets.all(12), + width: double.infinity, + height: 65, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts('Date'), + Texts(getDate()), + ], + ), + ), + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Average Cycle Length (usually 28 days):', + fontWeight: FontWeight.w400, + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(cycleLength.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (cycleLength < 45) + cycleLength++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (cycleLength > 0) + cycleLength--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: cycleLength.toDouble(), + min: 0, + max: 45, + onChanged: (double newValue) { + setState(() { + cycleLength = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Average Luteal Phase Length (usually 14 days):', + fontWeight: FontWeight.w400, + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 340.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: + Text(lutealPhaseLength.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (lutealPhaseLength < 15) + lutealPhaseLength++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (lutealPhaseLength > 0) + lutealPhaseLength--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: lutealPhaseLength.toDouble(), + min: 0, + max: 15, + onChanged: (double newValue) { + setState(() { + lutealPhaseLength = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + SizedBox( + height: 220.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OvulationResult( + conceivedDate: conceivedDate, + dateFrom: dateFrom, + dateTo: dateTo, + deliveryDue: deliveryDue, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart new file mode 100644 index 00000000..6669bf75 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart @@ -0,0 +1,96 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class OvulationResult extends StatelessWidget { + var dateFrom; + var dateTo; + var conceivedDate; + var deliveryDue; + OvulationResult( + {this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate}); + //var newFormat = DateFormat("yy-MM-dd"); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ovulation Period', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 750.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'The next ovulation period is estimated to be:', + fontWeight: FontWeight.w400, + ), + Texts( + 'From:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(dateFrom), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'To:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(dateTo), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'Useful Information:', + color: Color(0xffC5272D), + ), + Texts( + 'You have conceived on:', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(conceivedDate), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'The baby\'s age right now:', + fontWeight: FontWeight.w400, + ), + Texts( + '5 Weeks, 2', + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Texts( + 'The delivery due date is estimated to be on the: ', + fontWeight: FontWeight.w400, + ), + Texts( + DateFormat.yMMMEd().format(deliveryDue), + fontWeight: FontWeight.w800, + fontSize: 21.0, + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart index 56fb0428..15f7209b 100644 --- a/lib/pages/AlHabibMedicalService/​ health_calculators.dart +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -2,6 +2,7 @@ import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/page import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -9,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart'; +import 'health_calculator/delivery_due/delivery_due.dart'; import 'health_calculator/ideal_body/ideal_body.dart'; class HealthCalculators extends StatefulWidget { @@ -233,10 +235,10 @@ class _HealthCalculatorsState extends State flex: 1, child: InkWell( onTap: () { - // Navigator.push( - // context, - // FadePage(page: BloodSugar()), - // ); + Navigator.push( + context, + FadePage(page: OvulationPeriod()), + ); }, child: MedicalProfileItem( title: 'Ovulation', @@ -249,12 +251,12 @@ class _HealthCalculatorsState extends State flex: 1, child: InkWell( onTap: () { - // Navigator.push( - // context, - // FadePage( - // page: BloodCholesterol(), - // ), - // ); + Navigator.push( + context, + FadePage( + page: DeliveryDue(), + ), + ); }, child: MedicalProfileItem( title: 'Delivery', From 3ad928902bedf0df8ad065261fc55fbffe1084ce Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 12 Oct 2020 11:44:32 +0300 Subject: [PATCH 54/65] voice command --- assets/images/book.svg | 1 - assets/images/{ => svg}/robort_svg.svg | 0 assets/images/{ => svg}/symptom.svg | 0 lib/core/service/client/base_app_client.dart | 27 +- lib/main.dart | 8 +- .../E-Referral/e_referral_index_page.dart | 109 ++++--- .../h2o/h2o_index_page.dart | 2 +- .../AlHabibMedicalService/h2o/today_page.dart | 73 ++--- lib/pages/Blood/my_balance_page.dart | 5 +- lib/pages/BookAppointment/SearchResults.dart | 7 +- .../BookAppointment/widgets/BranchView.dart | 19 +- lib/pages/landing/home_page.dart | 36 ++- lib/pages/landing/landing_page.dart | 2 +- .../medical/balance/my_balance_page.dart | 5 +- .../my_trackers/Weight/WeightHomePage.dart | 2 +- .../my_trackers/Weight/WeightMonthlyPage.dart | 21 +- .../my_trackers/Weight/WeightWeeklyPage.dart | 34 +- .../my_trackers/Weight/WeightYeaPage.dart | 20 +- .../blood_pressure/BloodPressureHomePage.dart | 2 +- .../blood_pressure/BloodPressureMonthly.dart | 14 +- .../blood_pressure/BloodPressureYeaPage.dart | 9 +- .../bloodPressureWeeklyPage.dart | 42 ++- .../my_trackers/blood_suger/BloodMonthly.dart | 150 ++++----- .../my_trackers/blood_suger/BloodYeaPage.dart | 9 +- .../blood_suger/blood_sugar_home_page.dart | 30 +- .../blood_suger/blood_sugar_weekly_page.dart | 42 ++- .../vital_sign_details_wideget.dart | 4 +- .../medical/vital_sign/vital_sign_item.dart | 18 +- lib/pages/paymentService/payment_service.dart | 8 +- .../rate_appointment_clinic.dart | 2 +- .../rate_appointment_doctor.dart | 6 +- lib/services/robo_search/search_provider.dart | 2 +- lib/widgets/buttons/button.dart | 2 +- .../medical/laboratory_result_widget.dart | 30 +- .../medical/medical_profile_item.dart | 2 +- .../others/app_expandable_notifier.dart | 14 +- lib/widgets/others/app_scaffold_widget.dart | 2 +- .../others/floating_button_search.dart | 210 +++++++------ lib/widgets/robo-search/robosearch.dart | 297 ++++++++++++++---- pubspec.yaml | 6 +- 40 files changed, 797 insertions(+), 475 deletions(-) delete mode 100644 assets/images/book.svg rename assets/images/{ => svg}/robort_svg.svg (100%) rename assets/images/{ => svg}/symptom.svg (100%) diff --git a/assets/images/book.svg b/assets/images/book.svg deleted file mode 100644 index d4679486..00000000 --- a/assets/images/book.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/robort_svg.svg b/assets/images/svg/robort_svg.svg similarity index 100% rename from assets/images/robort_svg.svg rename to assets/images/svg/robort_svg.svg diff --git a/assets/images/symptom.svg b/assets/images/svg/symptom.svg similarity index 100% rename from assets/images/symptom.svg rename to assets/images/svg/symptom.svg diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index f5494049..16b3286c 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -32,7 +32,9 @@ class BaseAppClient { var user = await sharedPref.getObject(USER_PROFILE); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID : SETUP_ID; } body['VersionID'] = VERSION_ID; @@ -41,7 +43,9 @@ class BaseAppClient { body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; body['PatientOutSA'] = body.containsKey('PatientOutSA') - ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA + ? body['PatientOutSA'] != null + ? body['PatientOutSA'] + : PATIENT_OUT_SA : PATIENT_OUT_SA; if (body.containsKey('isDentalAllowedBackend')) { @@ -55,30 +59,32 @@ class BaseAppClient { body['DeviceTypeID'] = DeviceTypeID; - if(!body.containsKey('IsPublicRequest')) { + if (!body.containsKey('IsPublicRequest')) { body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + ? body['PatientType'] != null + ? body['PatientType'] + : PATIENT_TYPE : PATIENT_TYPE; body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : PATIENT_TYPE_ID + ? body['PatientTypeID'] + : PATIENT_TYPE_ID : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = token; body['PatientID'] = - body['PatientID'] != null ? body['PatientID'] : user['PatientID']; + body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = getSessionId(token); + body['SessionID'] = SESSION_ID;//getSessionId(token); } } print("URL : $url"); print("Body : ${json.encode(body)}"); - var asd=""; + var asd = ""; if (await Utils.checkConnection()) { final response = await http.post(url.trim(), body: json.encode(body), @@ -139,6 +145,7 @@ class BaseAppClient { } String getSessionId(String id) { - return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); + ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); + // return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); } } diff --git a/lib/main.dart b/lib/main.dart index ec42e7a3..d8e3307d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -66,7 +66,8 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100], + scaffoldBackgroundColor: + HexColor('#E9E9E9'), // Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Colors.grey, canvasColor: Colors.white, @@ -74,9 +75,8 @@ class MyApp extends StatelessWidget { highlightColor: Colors.grey[100].withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Colors.grey, - bottomSheetTheme:BottomSheetThemeData( - backgroundColor: Hexcolor('#E0E0E0') - ) , + bottomSheetTheme: BottomSheetThemeData( + backgroundColor: HexColor('#E0E0E0')), cursorColor: Colors.grey, iconTheme: IconThemeData(), appBarTheme: AppBarTheme( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart index 00148889..ef0be383 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart @@ -17,66 +17,63 @@ import 'e_referral_page.dart'; class EReferralIndexPage extends StatelessWidget { @override Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: "Service Information", - body: SingleChildScrollView( + return AppScaffold( + isShowAppBar: true, + appBarTitle: "Service Information", + body: SingleChildScrollView( padding: EdgeInsets.all(12), - child: - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "E-Referral: ", - fontWeight: FontWeight.normal, - fontSize: 25, - color: Hexcolor("#60686b"), - ), - SizedBox( - height: 12, - ), - Texts( - "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", - fontWeight: FontWeight.normal, - fontSize: 17, - ), - SizedBox( - height: 22, - ), - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: CarouselSlider( - imagesUrlList: [ - "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png", - "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png" - ], - ), - ), - ), - SizedBox( - height: 77, - ), - ], - ) - - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - onTap: ()=> Navigator.push(context, FadePage(page: EReferralPage())), - label: "E-Referral", - textColor: Theme.of(context).backgroundColor), + Texts( + "E-Referral: ", + fontWeight: FontWeight.normal, + fontSize: 25, + color: HexColor("#60686b"), + ), + SizedBox( + height: 12, + ), + Texts( + "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: SizedBox( + height: MediaQuery.of(context).size.height * 0.55, + width: MediaQuery.of(context).size.width * 0.50, + child: CarouselSlider( + imagesUrlList: [ + "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png", + "https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png" + ], + ), + ), + ), + SizedBox( + height: 77, ), ], - ), - - )); + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, FadePage(page: EReferralPage())), + label: "E-Referral", + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); } } diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index 9ce35d27..68ce1936 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -23,7 +23,7 @@ class H2OPageIndexPage extends StatelessWidget { "Water Tracker:", fontWeight: FontWeight.normal, fontSize: 25, - color: Hexcolor("#60686b"), + color: HexColor("#60686b"), ), SizedBox( height: 12, diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index 55767e5a..b92efc9e 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -6,10 +6,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; + class TodayPage extends StatelessWidget { @override Widget build(BuildContext context) { - return BaseView( + return BaseView( onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, @@ -27,11 +28,11 @@ class TodayPage extends StatelessWidget { animation: true, animationDuration: 1200, lineWidth: 15.0, - percent:model.userProgressData ==null ?0.0: - (model.userProgressData.percentageConsumed / - 100) >= 1 ? 1 : (model.userProgressData - .percentageConsumed / - 100), + percent: model.userProgressData == null + ? 0.0 + : (model.userProgressData.percentageConsumed / 100) >= 1 + ? 1 + : (model.userProgressData.percentageConsumed / 100), //, center: Center( child: Column( @@ -46,13 +47,16 @@ class TodayPage extends StatelessWidget { SizedBox( height: 4, ), - Text(model.userProgressData ==null ?"0.0": - model.userProgressData.quantityConsumed - .toString() + 'ml', + Text( + model.userProgressData == null + ? "0.0" + : model.userProgressData.quantityConsumed + .toString() + + 'ml', style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20.0, - color: Hexcolor("#60BCF9")), + color: HexColor("#60BCF9")), ), SizedBox( height: 4, @@ -60,9 +64,7 @@ class TodayPage extends StatelessWidget { SizedBox( height: 5, width: 50, - child: Container( - - ), + child: Container(), ), SizedBox( height: 4, @@ -74,23 +76,28 @@ class TodayPage extends StatelessWidget { SizedBox( height: 4, ), - Text(model.userProgressData ==null ?"0.0": - (model.userProgressData.quantityLimit - - model.userProgressData - .quantityConsumed) < 0 ? "0 ml" : - (model.userProgressData.quantityLimit - - model.userProgressData - .quantityConsumed).toString() + ' ml', + Text( + model.userProgressData == null + ? "0.0" + : (model.userProgressData.quantityLimit - + model.userProgressData + .quantityConsumed) < + 0 + ? "0 ml" + : (model.userProgressData.quantityLimit - + model.userProgressData + .quantityConsumed) + .toString() + + ' ml', style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0), + fontWeight: FontWeight.bold, fontSize: 18.0), ), ], ), ), circularStrokeCap: CircularStrokeCap.butt, - backgroundColor: Hexcolor("#D1E3F6"), - progressColor: Hexcolor("#60BCF9"), + backgroundColor: HexColor("#D1E3F6"), + progressColor: HexColor("#60BCF9"), ), ), Row( @@ -105,9 +112,9 @@ class TodayPage extends StatelessWidget { height: 30, width: 70, decoration: BoxDecoration( - color: Hexcolor("#D1E3F6"), - borderRadius: BorderRadius.all( - Radius.circular(30))), + color: HexColor("#D1E3F6"), + borderRadius: + BorderRadius.all(Radius.circular(30))), ), ), Text( @@ -125,9 +132,9 @@ class TodayPage extends StatelessWidget { height: 30, width: 70, decoration: BoxDecoration( - color: Hexcolor("#60BCF9"), - borderRadius: BorderRadius.all( - Radius.circular(30))), + color: HexColor("#60BCF9"), + borderRadius: + BorderRadius.all(Radius.circular(30))), ), ), Text( @@ -143,10 +150,7 @@ class TodayPage extends StatelessWidget { ), SizedBox( height: 0.5, - width: MediaQuery - .of(context) - .size - .width, + width: MediaQuery.of(context).size.width, child: Container( color: Colors.grey, ), @@ -163,4 +167,3 @@ class TodayPage extends StatelessWidget { ); } } - diff --git a/lib/pages/Blood/my_balance_page.dart b/lib/pages/Blood/my_balance_page.dart index 07d27e2d..26665c2b 100644 --- a/lib/pages/Blood/my_balance_page.dart +++ b/lib/pages/Blood/my_balance_page.dart @@ -39,7 +39,7 @@ class MyBalancePage extends StatelessWidget { width: double.infinity, height: 65, decoration: BoxDecoration( - color: Hexcolor('#B61422'), + color: HexColor('#B61422'), shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), @@ -97,7 +97,8 @@ class MyBalancePage extends StatelessWidget { textColor: Colors.white, label: TranslationBase.of(context).createAdvancedPayment, onTap: () { - Navigator.push(context, + Navigator.push( + context, //FadePage(page: AdvancePaymentPage())); FadePage(page: BloodDonationPage())); }, diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index e9767072..bd4bb601 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -21,12 +21,6 @@ class _SearchResultsState extends State { // var event = RobotProvider(); List tempList = []; - @override - void initState() { - // event.controller.stream.listen((p) {}); - super.initState(); - } - @override Widget build(BuildContext context) { return AppScaffold( @@ -41,6 +35,7 @@ class _SearchResultsState extends State { ...List.generate( widget.patientDoctorAppointmentListHospital.length, (index) => AppExpandableNotifier( + isExpand: index == 1 ? true : false, title: widget.patientDoctorAppointmentListHospital[index] .filterName + " - " + diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart index 455a579b..58ccbd1a 100644 --- a/lib/pages/BookAppointment/widgets/BranchView.dart +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -31,6 +31,7 @@ class _BranchViewState extends State { body: new ListView.builder( itemBuilder: (BuildContext context, int index) { return new ExpandableListView( + isExpanded: index == 0 ? true : false, result2: widget.result, resultDistance: widget.resultDistance, val: index, @@ -48,8 +49,14 @@ class ExpandableListView extends StatefulWidget { final List doctorsList2; final val; static int doctorListheight = 0; + final bool isExpanded; const ExpandableListView( - {Key key, this.result2, this.resultDistance, this.val, this.doctorsList2}) + {Key key, + this.result2, + this.resultDistance, + this.val, + this.doctorsList2, + this.isExpanded}) : super(key: key); @override @@ -58,9 +65,17 @@ class ExpandableListView extends StatefulWidget { class _ExpandableListViewState extends State { bool expandFlag = false; - + @override + void initState() { + setState(() { + expandFlag = widget.isExpanded; + setDoctorViewHeight(widget.result2[widget.val].toString()); + }); + super.initState(); + } @override Widget build(BuildContext context) { + return new Container( width: MediaQuery.of(context).size.width * 0.6, margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 9b702ff3..3c253aa8 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -123,7 +123,7 @@ class _HomePageState extends State { width: double.infinity, height: 125, decoration: BoxDecoration( - color: Hexcolor('#A59E9E'), + color: HexColor('#A59E9E'), shape: BoxShape.rectangle, border: Border.all( color: Colors.transparent, width: 0.5), @@ -169,7 +169,7 @@ class _HomePageState extends State { width: 90, height: 30, decoration: BoxDecoration( - color: Hexcolor('#D81A2E'), + color: HexColor('#D81A2E'), shape: BoxShape.rectangle, border: Border.all( color: Colors.transparent, @@ -196,7 +196,7 @@ class _HomePageState extends State { width: double.infinity, height: 130, decoration: BoxDecoration( - color: Hexcolor('#A59E9E'), + color: HexColor('#A59E9E'), shape: BoxShape.rectangle, border: Border.all( color: Colors.transparent, width: 0.5), @@ -256,7 +256,7 @@ class _HomePageState extends State { width: 90, height: 30, decoration: BoxDecoration( - color: Hexcolor('#D81A2E'), + color: HexColor('#D81A2E'), shape: BoxShape.rectangle, border: Border.all( color: Colors.transparent, @@ -364,7 +364,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 5, + height: 3, ), Texts( TranslationBase.of(context) @@ -401,7 +401,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), @@ -422,21 +422,21 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 5, + height: 3, ), Texts( TranslationBase.of(context).emergencyService, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), ), ), height: MediaQuery.of(context).size.width * 0.4, - color: Hexcolor("#747C80"), + color: HexColor("#747C80"), imageName: 'emergency_service_image.png', ), ], @@ -473,7 +473,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.9, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), @@ -497,7 +497,7 @@ class _HomePageState extends State { height: 55, ), SizedBox( - height: 15, + height: 10, ), Texts( TranslationBase.of(context) @@ -505,7 +505,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), @@ -537,7 +537,7 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height: 15, + height: 10, ), Texts( TranslationBase.of(context) @@ -545,7 +545,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: SizeConfig.textMultiplier * 1.7, ) ], ), @@ -563,7 +563,7 @@ class _HomePageState extends State { ), ), SizedBox( - height: 8, + height: 5, ), Container( margin: EdgeInsets.only(left: 15, right: 15), @@ -698,7 +698,9 @@ class DashboardItem extends StatelessWidget { : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( color: !hasBorder - ? color != null ? color : Hexcolor('#050705').withOpacity(opacity) + ? color != null + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(6.0), border: hasBorder @@ -706,7 +708,7 @@ class DashboardItem extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/$imageName'), + image: ExactAssetImage('assets/images/$imageName'), fit: BoxFit.cover, colorFilter: new ColorFilter.mode( Colors.black.withOpacity(0.2), BlendMode.dstIn), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 23d1645c..dcfa3ba8 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -348,7 +348,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { actions: [ IconButton( iconSize: 70, - icon: SvgPicture.asset('assets/images/robort_svg.svg', + icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', height: 100, width: 100, fit: BoxFit.cover), onPressed: () { triggerRobot(); diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 446333cc..421e2bed 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -38,7 +38,7 @@ class MyBalancePage extends StatelessWidget { width: double.infinity, height: 65, decoration: BoxDecoration( - color: Hexcolor('#B61422'), + color: HexColor('#B61422'), shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), @@ -96,8 +96,7 @@ class MyBalancePage extends StatelessWidget { textColor: Colors.white, label: TranslationBase.of(context).createAdvancedPayment, onTap: () { - Navigator.push(context, - FadePage(page: AdvancePaymentPage())); + Navigator.push(context, FadePage(page: AdvancePaymentPage())); }, ), ), diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 7d7c5dd5..8e6f808c 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -135,7 +135,7 @@ class _WeightHomePageState extends State width: 55, height: 55, decoration: BoxDecoration( - shape: BoxShape.circle, color: Hexcolor('515B5D')), + shape: BoxShape.circle, color: HexColor('515B5D')), child: Center( child: Icon( Icons.add, diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index 5bdbfeab..9f7063f1 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -15,8 +15,7 @@ class WeightMonthlyPage extends StatelessWidget { final List> data; final List diabtecPatientResult; - const WeightMonthlyPage( - {Key key, this.data, this.diabtecPatientResult}) + const WeightMonthlyPage({Key key, this.data, this.diabtecPatientResult}) : super(key: key); @override @@ -67,7 +66,7 @@ class WeightMonthlyPage extends StatelessWidget { children: [ Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -83,18 +82,26 @@ class WeightMonthlyPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Time', color: Colors.white,fontSize: 15,), + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), ), height: 40), Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Value', color: Colors.white,fontSize: 15,), + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ], diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index ac1a3214..9c3363dd 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -29,8 +29,9 @@ class WeightWeeklyPage extends StatelessWidget { dateTimeFactory: const charts.LocalDateTimeFactory(), ), ), - SizedBox(height: 12,), - + SizedBox( + height: 12, + ), Padding( padding: const EdgeInsets.all(8.0), child: Texts('Details'), @@ -62,7 +63,7 @@ class WeightWeeklyPage extends StatelessWidget { children: [ Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -78,37 +79,50 @@ class WeightWeeklyPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Time', color: Colors.white,fontSize: 15,), + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), ), height: 40), Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Value', color: Colors.white,fontSize: 15,), + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), ), height: 40), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), ), child: Center( - child: Texts('Edit', color: Colors.white,fontSize: 15,), + child: Texts( + 'Edit', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), ], ), ); - diabtecPatientResult.forEach((diabtec) { + diabtecPatientResult.forEach( + (diabtec) { tableRow.add( TableRow( children: [ diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index 3ddeaa82..587cc3f6 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -65,7 +65,7 @@ class WeightYearPage extends StatelessWidget { children: [ Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -81,25 +81,33 @@ class WeightYearPage extends StatelessWidget { ), Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Time', color: Colors.white,fontSize: 15,), + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), ), height: 40), Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Value', color: Colors.white,fontSize: 15,), + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ], ), ); diabtecPatientResult.forEach( - (diabtec) { + (diabtec) { tableRow.add( TableRow( children: [ diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index c118f2ca..d2bcde47 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -138,7 +138,7 @@ class _BloodPressureHomePageState extends State width: 55, height: 55, decoration: BoxDecoration( - shape: BoxShape.circle, color: Hexcolor('515B5D')), + shape: BoxShape.circle, color: HexColor('515B5D')), child: Center( child: Icon( Icons.add, diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart index f38cc3b6..8b9e504f 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -67,7 +67,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -85,7 +85,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( child: Texts( @@ -99,7 +99,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( child: Texts( @@ -113,7 +113,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), @@ -149,7 +149,8 @@ class BloodPressureMonthlyPage extends StatelessWidget { ), ), ), - Container(child: Container( + Container( + child: Container( height: 70, padding: EdgeInsets.all(10), color: Colors.white, @@ -160,7 +161,8 @@ class BloodPressureMonthlyPage extends StatelessWidget { fontSize: 12, ), ), - ),), + ), + ), Container( child: Container( height: 70, diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart index dfcf42ae..0c67be7c 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -65,7 +65,7 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -83,7 +83,7 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( child: Texts( @@ -97,7 +97,7 @@ class BloodPressureYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( child: Texts( @@ -108,11 +108,10 @@ class BloodPressureYearPage extends StatelessWidget { ), height: 40), ), - Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index fbcbf417..52313483 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -30,8 +30,9 @@ class BloodPressureWeeklyPage extends StatelessWidget { dateTimeFactory: const charts.LocalDateTimeFactory(), ), ), - SizedBox(height: 12,), - + SizedBox( + height: 12, + ), Padding( padding: const EdgeInsets.all(8.0), child: Texts('Details'), @@ -64,7 +65,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -82,50 +83,67 @@ class BloodPressureWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Time', color: Colors.white,fontSize: 15,), + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Measured', color: Colors.white,fontSize: 15,), + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Value', color: Colors.white,fontSize: 15,), + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), ), child: Center( - child: Texts('Edit', color: Colors.white,fontSize: 15,), + child: Texts( + 'Edit', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), ], ), ); - diabtecPatientResult.forEach((diabtec) { + diabtecPatientResult.forEach( + (diabtec) { tableRow.add( TableRow( children: [ diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index da31c4ed..fdd7b348 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -1,4 +1,3 @@ - import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; @@ -14,7 +13,8 @@ class BloodMonthlyPage extends StatelessWidget { final List> data; final List diabtecPatientResult; - const BloodMonthlyPage({Key key, this.data,this.diabtecPatientResult}) : super(key: key); + const BloodMonthlyPage({Key key, this.data, this.diabtecPatientResult}) + : super(key: key); @override Widget build(BuildContext context) { return AppScaffold( @@ -24,14 +24,14 @@ class BloodMonthlyPage extends StatelessWidget { width: double.maxFinite, height: 180, color: Colors.white, - child: charts.LineChart( - data, + child: charts.LineChart(data, //animate: animate, - defaultRenderer: new charts.LineRendererConfig(includePoints: true) - ), + defaultRenderer: + new charts.LineRendererConfig(includePoints: true)), + ), + SizedBox( + height: 12, ), - SizedBox(height: 12,), - Padding( padding: const EdgeInsets.all(8.0), child: Texts('Details'), @@ -51,7 +51,6 @@ class BloodMonthlyPage extends StatelessWidget { ], ), ) - ], ), ); @@ -65,7 +64,7 @@ class BloodMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -83,105 +82,116 @@ class BloodMonthlyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Time', color: Colors.white,fontSize: 15,), + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Measured', color: Colors.white,fontSize: 15,), + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), - Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), ), child: Center( - child: Texts('Value', color: Colors.white,fontSize: 15,), + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), ], ), ); - diabtecPatientResult.forEach((diabtec) { - tableRow.add( - TableRow( - children: [ - Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', - textAlign: TextAlign.center, - fontSize: 12, + diabtecPatientResult.forEach( + (diabtec) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', + textAlign: TextAlign.center, + fontSize: 12, + ), ), ), ), - ), - Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', - textAlign: TextAlign.center, - fontSize: 12, + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', + textAlign: TextAlign.center, + fontSize: 12, + ), ), ), ), - ), - Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${diabtec.measuredDesc}', - textAlign: TextAlign.center, - fontSize: 12, + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.measuredDesc}', + textAlign: TextAlign.center, + fontSize: 12, + ), ), ), ), - ), - Container( - child: Container( - height: 70, - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${diabtec.resultValue}', - textAlign: TextAlign.center, - fontSize: 12, + Container( + child: Container( + height: 70, + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${diabtec.resultValue}', + textAlign: TextAlign.center, + fontSize: 12, + ), ), ), ), - ), - - ], - ), - ); - }, + ], + ), + ); + }, ); return tableRow; } diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index 3bddab88..47f87847 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -64,7 +64,7 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -82,7 +82,7 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( child: Texts( @@ -96,7 +96,7 @@ class BloodYearPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( child: Texts( @@ -107,11 +107,10 @@ class BloodYearPage extends StatelessWidget { ), height: 40), ), - Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 1190b6b6..c8c7fa4a 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -37,7 +37,6 @@ class _BloodSugarHomePageState extends State _tabController.dispose(); } - @override Widget build(BuildContext context) { return BaseView( @@ -78,7 +77,8 @@ class _BloodSugarHomePageState extends State indicatorSize: TabBarIndicatorSize.label, indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, - labelPadding: EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), + labelPadding: + EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( @@ -114,27 +114,37 @@ class _BloodSugarHomePageState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - BloodSugarWeeklyPage(data: model.getBloodWeeklySeries(),diabtecPatientResult: model.weekDiabtecPatientResult,), - BloodMonthlyPage(data: model.getBloodMonthlyTimeSeriesSales(),diabtecPatientResult: model.monthDiabtecPatientResult,), - BloodYearPage(data: model.getBloodYearTimeSeriesSales(),diabtecPatientResult: model.yearDiabtecPatientResult,) + BloodSugarWeeklyPage( + data: model.getBloodWeeklySeries(), + diabtecPatientResult: model.weekDiabtecPatientResult, + ), + BloodMonthlyPage( + data: model.getBloodMonthlyTimeSeriesSales(), + diabtecPatientResult: model.monthDiabtecPatientResult, + ), + BloodYearPage( + data: model.getBloodYearTimeSeriesSales(), + diabtecPatientResult: model.yearDiabtecPatientResult, + ) ], ), ) ], ), floatingActionButton: InkWell( - onTap: (){ + onTap: () { Navigator.push(context, FadePage(page: AddBloodSugarPage())); }, child: Container( width: 55, height: 55, decoration: BoxDecoration( - shape: BoxShape.circle, - color: Hexcolor('515B5D') - ), + shape: BoxShape.circle, color: HexColor('515B5D')), child: Center( - child: Icon(Icons.add,color: Colors.white,), + child: Icon( + Icons.add, + color: Colors.white, + ), ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 6b892162..4b007929 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -29,8 +29,9 @@ class BloodSugarWeeklyPage extends StatelessWidget { dateTimeFactory: const charts.LocalDateTimeFactory(), ), ), - SizedBox(height: 12,), - + SizedBox( + height: 12, + ), Padding( padding: const EdgeInsets.all(8.0), child: Texts('Details'), @@ -63,7 +64,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -81,50 +82,67 @@ class BloodSugarWeeklyPage extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Time', color: Colors.white,fontSize: 15,), + child: Texts( + 'Time', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Measured', color: Colors.white,fontSize: 15,), + child: Texts( + 'Measured', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), ), child: Center( - child: Texts('Value', color: Colors.white,fontSize: 15,), + child: Texts( + 'Value', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), ), child: Center( - child: Texts('Edit', color: Colors.white,fontSize: 15,), + child: Texts( + 'Edit', + color: Colors.white, + fontSize: 15, + ), ), height: 40), ), ], ), ); - diabtecPatientResult.forEach((diabtec) { + diabtecPatientResult.forEach( + (diabtec) { tableRow.add( TableRow( children: [ diff --git a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart index ad5c6ffb..589284a1 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart @@ -52,7 +52,7 @@ class _VitalSignDetailsWidgetState extends State { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topLeft: Radius.circular(10.0), ), @@ -69,7 +69,7 @@ class _VitalSignDetailsWidgetState extends State { Container( child: Container( decoration: BoxDecoration( - color: Hexcolor('#515B5D'), + color: HexColor('#515B5D'), borderRadius: BorderRadius.only( topRight: Radius.circular(10.0), ), diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart index 9586fb25..fb44772d 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -45,16 +45,22 @@ class VitalSignItem extends StatelessWidget { child: Text( des, style: TextStyle( - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Hexcolor('#B8382C'), - fontWeight: FontWeight.bold,), + fontSize: 1.7 * SizeConfig.textMultiplier, + color: HexColor('#B8382C'), + fontWeight: FontWeight.bold, + ), ), ), ), ), Expanded( flex: 1, - child: Container(child: Icon(icon,size: 40,),), + child: Container( + child: Icon( + icon, + size: 40, + ), + ), ) ], ), @@ -65,7 +71,7 @@ class VitalSignItem extends StatelessWidget { child: Align( alignment: Alignment.topRight, child: Container( - margin: EdgeInsets.only(left: 5,right: 5), + margin: EdgeInsets.only(left: 5, right: 5), child: RichText( text: TextSpan( style: TextStyle(color: Colors.black), @@ -74,7 +80,7 @@ class VitalSignItem extends StatelessWidget { TextSpan( text: unit, style: TextStyle( - color: Hexcolor('#B8382C'), + color: HexColor('#B8382C'), ), ), ]), diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 15a1f699..0d19045b 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -41,7 +41,7 @@ class PaymentService extends StatelessWidget { children: [ Texts( TranslationBase.of(context).payment, - color: Hexcolor('#B61422'), + color: HexColor('#B61422'), bold: true, ), Texts( @@ -73,11 +73,11 @@ class PaymentService extends StatelessWidget { children: [ Texts( TranslationBase.of(context).onlineCheckIn, - color: Hexcolor('#B61422'), + color: HexColor('#B61422'), bold: true, ), Texts( - TranslationBase.of(context).appointment, + TranslationBase.of(context).appointment, fontSize: 14, fontWeight: FontWeight.normal, ), @@ -115,7 +115,7 @@ class PaymentService extends StatelessWidget { children: [ Texts( 'My Balances', - color: Hexcolor('#B61422'), + color: HexColor('#B61422'), bold: true, ), Texts( diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 74f134ae..38fdd008 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -226,7 +226,7 @@ class _RateAppointmentClinicState extends State { child: Texts( 'Later', decoration: TextDecoration.underline, - color: Hexcolor('#151DFE'), + color: HexColor('#151DFE'), fontSize: 18, ), ) diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 1583f033..83674906 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -177,7 +177,9 @@ class _RateAppointmentDoctorState extends State { }, ), ), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Container( width: double.infinity, child: Column( @@ -222,7 +224,7 @@ class _RateAppointmentDoctorState extends State { child: Texts( 'Later', decoration: TextDecoration.underline, - color: Hexcolor('#151DFE'), + color: HexColor('#151DFE'), fontSize: 18, ), ) diff --git a/lib/services/robo_search/search_provider.dart b/lib/services/robo_search/search_provider.dart index 5a192d74..82c32f91 100644 --- a/lib/services/robo_search/search_provider.dart +++ b/lib/services/robo_search/search_provider.dart @@ -14,7 +14,7 @@ class SearchProvider with ChangeNotifier { static var sessionID = new DateTime.now().millisecondsSinceEpoch; Future getBotPages(request) async { try { - request['SessionID'] = sessionID; + request['SessionID'] = '123'; await BaseAppClient().post(SEARCH_BOT, onSuccess: (dynamic response, int statusCode) { pageData = response; diff --git a/lib/widgets/buttons/button.dart b/lib/widgets/buttons/button.dart index f8aff960..b6ae08b1 100644 --- a/lib/widgets/buttons/button.dart +++ b/lib/widgets/buttons/button.dart @@ -105,7 +105,7 @@ class _ButtonState extends State