From f1e0bcf86eea105ff5dcca857998be2e4661cb51 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 31 Aug 2020 17:54:03 +0300 Subject: [PATCH 01/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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/23] 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 79502de6823fc195558212c2bb839e9f7871597b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 28 Sep 2020 09:50:06 +0300 Subject: [PATCH 16/23] 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 5c859034d610a6b87c69e682bcd9d9ad04640009 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 4 Oct 2020 12:58:43 +0300 Subject: [PATCH 17/23] 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 zcmV+g1^W7lP)V;^%5U;ff5j^(Ux zf0>!x+1b6B^Ye2^OM|L02LN@t=IE;XzW#tNR2N^Hj(w2UJthi-09XLfple>SsUgAH z!JkP2N(9KDY9NF)0C>#a_snVUojV@e|`(8jsUGzCx*p_RAkA04PrAT-a&`_QVQC7MhI zD$r#pZv4o3$8@z~I`)pgjW7$@$aPnE6zDn^fY9(%L|5^vObO|PF1XB~Y8(_Skj80o ze8FkLLdZHU6AbWM$%KV)TF2~zdvN_u4Thh;!k>Mcqe-|{GobwNKKwmBh2LA-ENzl1 zUS@pNdxw_&SYTA1Sa9?08~62%<|_PpwyF&UVcdGR4OeDo-QTa*YH;-8702xYEqA&D zNy+!7w$L&>7%1!jb_6@5DnATV<>`tGn@KIN85al*KP(Hv=q7&YKna53Dd;^#&C}d# zWFZZ%mN90aj|bhnER-l1sI$F&t$XzeL&gY*#nmdt3XB=LP~u=5J%0(OU%s*2Gid?{ zn}q-a6cHH5A1=(gb>%LU&-52>WBfSgZauDJ2rFpx$q0t0=nqlqWogiuu_Dng|qQ5e9KC95bk3z320DGMkFgk>vIltd<7 zKOb3aS+a(DB`Q@WCeaxvSC*`)lSF~YPRDZqrRy#-CsBIP$xT$UWF}R-pvpSZ=q73z zSxO&Q-r0e0Wvv-NaT$0(*yhMsH{nXu;-KJnG0NQ$-~yo{%_okw!xny3bCW12qDi8F z4!un@;}bI$E5U_d?EJWN6SW{H$L~LKR_{hP=PzZRaP1}YN||UeT&v>=mNG{LZ$FSc z?@mri9n-N#RZD*^vq2lvE|Vsz{}VtcxL$_cL!LVR!$@I!%r3*G8T5p@A4pjG&$1IB z=UNXssul=@cKdD?7{;#Y*ny!Tbb-ip>=qrdD4K>*#r?PyGpm53jumyVC=v+ySffBt znsJ-|W7kw^j^B#=+!UxOa;#Nok(nB5799pC9xdt6&|Wf@!0Vq2LWbsyKD zYAjGHZKVvR6PA~#i2ZRHWHD=WCG|{zLs}GWb3aQY=?ALRDF9mxhm!g< \ No newline at end of file diff --git a/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 227731f8f8c3ac9f9f39aee709acf5a80a0a35a7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 6 Oct 2020 12:16:51 +0300 Subject: [PATCH 18/23] 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 8f18d1025ac4a043157a073edc942a23c08c201d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 7 Oct 2020 15:11:52 +0300 Subject: [PATCH 19/23] 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 20/23] 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 3ad928902bedf0df8ad065261fc55fbffe1084ce Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 12 Oct 2020 11:44:32 +0300 Subject: [PATCH 21/23] 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