From 106334c9cfa3ec82dbfb61a8bb81a4b08fbc2610 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 Sep 2022 17:29:07 +0300 Subject: [PATCH] updates & fixes --- lib/config/config.dart | 2 +- lib/core/service/client/base_app_client.dart | 46 +++++++++++++------ .../parmacyModule/parmacy_module_service.dart | 4 +- .../home_health_care_view_model.dart | 16 ++++--- lib/core/viewModels/er/rrt-view-model.dart | 4 +- lib/pages/BookAppointment/BookSuccess.dart | 2 + lib/pages/BookAppointment/Search.dart | 3 -- .../components/SearchByClinic.dart | 5 ++ .../AmbulanceRequestIndex.dart | 1 - .../PickupLocation.dart | 4 +- .../fragments/home_page_fragment2.dart | 2 +- lib/pages/livecare/livecare_home.dart | 2 + .../prescription_items_page.dart | 8 ++-- .../appointment_services/GetDoctorsList.dart | 3 -- .../clinic_services/get_clinic_service.dart | 4 -- lib/uitl/gif_loader_dialog_utils.dart | 2 +- lib/uitl/location_util.dart | 8 +--- lib/uitl/utils.dart | 23 +++++----- lib/widgets/Loader/gif_loader_container.dart | 21 ++++----- lib/widgets/app_map/google_huawei_map.dart | 6 ++- .../pickupLocation/PickupLocationFromMap.dart | 6 ++- 21 files changed, 93 insertions(+), 79 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 62d61c55..6a51a088 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -408,7 +408,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 9.1; +var VERSION_ID = 9.2; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 11640224..441916c5 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -92,21 +92,37 @@ class BaseAppClient { body['DeviceTypeID'] = Platform.isIOS ? 1 : 2; if (!body.containsKey('IsPublicRequest')) { - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null - ? body['PatientType'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE - : PATIENT_TYPE; - - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; + // if (!body.containsKey('PatientType')) { + if (user != null && user['PatientType'] != null) { + body['PatientType'] = user['PatientType']; + } else { + body['PatientType'] = PATIENT_TYPE; + } + // } + + // body['PatientType'] = body.containsKey('PatientType') + // ? body['PatientType'] != null + // ? body['PatientType'] + // : user['PatientType'] != null + // ? user['PatientType'] + // : PATIENT_TYPE + // : PATIENT_TYPE; + + // if (!body.containsKey('PatientTypeID')) { + if (user != null && user['PatientType'] != null) { + body['PatientTypeID'] = user['PatientType']; + } else { + body['PatientType'] = PATIENT_TYPE_ID; + } + // } + + // body['PatientTypeID'] = body.containsKey('PatientTypeID') + // ? body['PatientTypeID'] != null + // ? body['PatientTypeID'] + // : user['PatientType'] != null + // ? user['PatientType'] + // : PATIENT_TYPE_ID + // : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 297c8e53..01b59701 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -40,7 +40,7 @@ class PharmacyModuleService extends BaseService { } } - Future createUser() async { + Future createUser() async { var data = await sharedPref.getObject(USER_PROFILE); var languageID = await sharedPref.getString(APP_LANGUAGE); Map queryParams = { @@ -59,7 +59,6 @@ class PharmacyModuleService extends BaseService { await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId); await sharedPref.setObject(PHARMACY_CUSTOMER_GUID, response['customerDto']['customerGuid']); } - // await generatePharmacyToken(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -67,6 +66,7 @@ class PharmacyModuleService extends BaseService { } catch (error) { throw error; } + return Future.value(1); } Future generatePharmacyToken() async { diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index d48e214e..b8151788 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -1,11 +1,11 @@ -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'dart:async'; + import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; @@ -38,6 +38,7 @@ class HomeHealthCareViewModel extends BaseViewModel { GetCMCAllOrdersResponseModel pendingOrder; List patientERHHCInsertServicesList = List(); + dynamic get hhcResponse => _homeHealthCareService.hhcResponse; Future getHHCAllServices() async { @@ -107,7 +108,7 @@ class HomeHealthCareViewModel extends BaseViewModel { } } - Future getCustomerInfo() async { + Future getCustomerInfo() async { setState(ViewState.Busy); await _pharmacyModuleService.generatePharmacyToken(); @@ -116,16 +117,19 @@ class HomeHealthCareViewModel extends BaseViewModel { await _pharmacyModuleService.createUser(); setState(ViewState.ErrorLocal); } else { - await _pharmacyModuleService.createUser(); - await getCustomerAddresses(); + await _pharmacyModuleService.createUser().then((value) async { + if (!_pharmacyModuleService.hasError) await getCustomerAddresses(); + setState(ViewState.Idle); + }).catchError((err) {}); } + return Future.value(1); } Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async { setState(ViewState.Busy); // await _pharmacyModuleService.generatePharmacyToken().then((value) async { - await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); + await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); // }); if (_customerAddressesService.hasError) { diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index c63649cb..d615ef98 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -24,7 +24,7 @@ class _RRTServiceData { List completedOrders = []; ServicePrice servicePrice; - // RRTProcedureList rrtProcedureList; +// RRTProcedureList rrtProcedureList; } class RRTViewModel extends BaseViewModel { @@ -230,7 +230,7 @@ class RRTViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { await _pharmacy_service.createUser(); - await getCustomerAddresses(); + if (!_pharmacy_service.hasError) await getCustomerAddresses(); } // setState(ViewState.Busy); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index e2f4ad13..35a43f6e 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -550,6 +550,8 @@ class _BookSuccessState extends State { appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; + appo.appointmentDate = widget.patientShareResponse.appointmentDate; + appo.serviceID = widget.patientShareResponse.serviceID; Navigator.push( context, diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 3ede8373..c47d5aaa 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -25,13 +25,10 @@ class Search extends StatefulWidget { class _SearchState extends State with TickerProviderStateMixin { TabController _tabController; - LocationUtils locationUtils; @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); - locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); super.initState(); } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 7371eac6..b8f1a378 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -18,6 +18,7 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; @@ -63,8 +64,11 @@ class _SearchByClinicState extends State { String radioValue = null; + LocationUtils locationUtils; + @override void initState() { + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); super.initState(); } @@ -509,6 +513,7 @@ class _SearchByClinicState extends State { } else { isProjectLoaded = false; } + locationUtils.getCurrentLocation(); }) .catchError((err) {}) .catchError((err) { diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index aaba5d2a..9f461c7b 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 9919cab9..244ce647 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -501,12 +501,12 @@ class _PickupLocationState extends State { else setState(() { widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0; - if (widget.patientER_RC.transportationDetails.direction == 0) { + if (widget.patientER_RC.transportationDetails.direction == 0) { // From Hospital widget.patientER_RC.transportationDetails.dropoffLatitude = _result.lat.toStringAsFixed(6); widget.patientER_RC.transportationDetails.dropoffLongitude = _result.long.toStringAsFixed(6); widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude; widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude; - } else { + } else { // To Hospital widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude; widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude; widget.patientER_RC.transportationDetails.dropoffLatitude = _result.lat.toStringAsFixed(6); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index dd12a5cd..f5e4371c 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -155,7 +155,7 @@ class _HomePageFragment2State extends State { width: double.infinity, height: MediaQuery.of(context).size.width * 0.26, child: ListView.separated( - itemCount: 5, + itemCount: myMedicalList.length, padding: EdgeInsets.zero, scrollDirection: Axis.horizontal, physics: BouncingScrollPhysics(), diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 653a5fc8..f5e9bf53 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -164,6 +165,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index be7f2dd4..c772dc52 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -388,9 +388,9 @@ class PrescriptionItemsPage extends StatelessWidget { child: DefaultButton( TranslationBase.of(context).resendOrder, () { - // if (model.isMedDeliveryAllowed == false) { - // AppToast.showErrorToast(message: TranslationBase.of(context).prescriptionDeliveryError); - // } else { + if (model.isMedDeliveryAllowed == false) { + AppToast.showErrorToast(message: TranslationBase.of(context).prescriptionDeliveryError); + } else { Navigator.push( context, FadePage( @@ -401,7 +401,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), ), ); - // } + } }, color: model.isMedDeliveryAllowed == false ? Color(0xff575757) : Color(0xff359846), disabledColor: Color(0xff575757), diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 7faca2f0..f6033004 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -615,7 +615,6 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, @@ -647,7 +646,6 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, @@ -688,7 +686,6 @@ class DoctorsListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "DeviceTypeID": req.DeviceTypeID, diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 54c7cc24..afc053c6 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -27,7 +27,6 @@ class ClinicListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": 0, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": null @@ -83,7 +82,6 @@ class ClinicListService extends BaseService { "VersionID": req.VersionID, "Channel": req.Channel, "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": 0, "TokenID": "", "DeviceTypeID": req.DeviceTypeID, "SessionID": null @@ -121,7 +119,6 @@ class ClinicListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", - "PatientOutSA": 0, "SessionID": null, "isDentalAllowedBackend": true, "DeviceTypeID": 1, @@ -163,7 +160,6 @@ class ClinicListService extends BaseService { "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, - "PatientOutSA": 0, "SessionID": null, "isDentalAllowedBackend": true, "Latitude": lat != null ? lat.toString() : "0.0", diff --git a/lib/uitl/gif_loader_dialog_utils.dart b/lib/uitl/gif_loader_dialog_utils.dart index e0d2f1a3..eae84e38 100644 --- a/lib/uitl/gif_loader_dialog_utils.dart +++ b/lib/uitl/gif_loader_dialog_utils.dart @@ -4,7 +4,7 @@ import '../widgets/Loader/gif_loader_container.dart'; class GifLoaderDialogUtils { static showMyDialog(BuildContext context) { - showDialog(context: context, barrierDismissible: true, builder: (cxt) => GifLoaderContainer()); + showDialog(context: context, builder: (cxt) => GifLoaderContainer()); } static hideDialog(BuildContext context) { diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 60ef0cb1..1aea4172 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -25,7 +25,7 @@ class LocationUtils { BuildContext context; bool isHuawei; - LocationUtils({@required this.isShowConfirmDialog, @required this.context, @required this.isHuawei = false}); + LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); void getCurrentLocation({Function(LatLng) callBack}) async { if (Platform.isAndroid && isHuawei) { @@ -57,12 +57,6 @@ class LocationUtils { if (isShowConfirmDialog) showErrorLocationDialog(false); } } - // if(await Permission.location.request().isGranted) { - // getCurrentLocation(); - // } else { - // setZeroLocation(); - // if (isShowConfirmDialog) showErrorLocationDialog(false); - // } } }).catchError((err) { print(err); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index daa2dd01..439c1e55 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -654,16 +654,15 @@ class Utils { ), )); - if (projectViewModel.havePrivilege(10)) { - medical.add(InkWell( - onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).lab, - imagePath: 'lab_result.svg', - subTitle: TranslationBase.of(context).labSubtitle, - ), - )); - } + medical.add(InkWell( + onTap: () => projectViewModel.havePrivilege(10) ? Navigator.push(context, FadePage(page: LabsHomePage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).lab, + imagePath: 'lab_result.svg', + subTitle: TranslationBase.of(context).labSubtitle, + isEnable: projectViewModel.havePrivilege(10), + ), + )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, @@ -756,7 +755,9 @@ class Utils { children: [ SizedBox(height: 12), Text( - isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, maxLines: 2, overflow: TextOverflow.ellipsis, + isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, + maxLines: 2, + overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart index 4c2c40cf..75083d1a 100644 --- a/lib/widgets/Loader/gif_loader_container.dart +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -29,17 +29,14 @@ class _GifLoaderContainerState extends State with TickerProv @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async => false, - child: Center( - //progress-loading.gif - child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - controller: controller1, - image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )), - ); + return Center( + //progress-loading.gif + child: Container( + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } } diff --git a/lib/widgets/app_map/google_huawei_map.dart b/lib/widgets/app_map/google_huawei_map.dart index a0496091..57e23d81 100644 --- a/lib/widgets/app_map/google_huawei_map.dart +++ b/lib/widgets/app_map/google_huawei_map.dart @@ -1,8 +1,9 @@ import 'dart:async'; +import 'dart:io'; -import 'package:diplomaticquarterapp/services/pharmacy_services/writeReview_service.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; @@ -54,7 +55,8 @@ class AppMapState extends State { @override void initState() { hmsApiAvailability = HmsApiAvailability(); - checkIsHuawei(); + if (Platform.isAndroid) checkIsHuawei(); + super.initState(); } @override diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index 02ac135a..26f01a16 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -50,8 +50,10 @@ class _PickupLocationFromMapState extends State { @override void initState() { - hmsApiAvailability = HmsApiAvailability(); - if(Platform.isAndroid) checkIsHuawei(); + if(Platform.isAndroid) { + hmsApiAvailability = HmsApiAvailability(); + checkIsHuawei(); + } appMap = AppMap( kGooglePlex.toMap(),