From c3538ebdb6c03783ebc93cef138b888c6b51bd12 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 25 May 2022 13:10:08 +0300 Subject: [PATCH] Updates & fixes --- lib/analytics/google-analytics.dart | 82 ++-- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 4 +- lib/core/service/client/base_app_client.dart | 4 +- .../NewHomeHealthCare/location_page.dart | 261 ++++++++---- .../ancillaryOrdersDetails.dart | 2 +- lib/pages/Blood/advance_payment_page.dart | 397 ------------------ .../covid-payment-details.dart | 23 +- .../notification_details_page.dart | 4 +- lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/ToDoList/payment_method_select.dart | 262 ++++++------ lib/pages/feedback/send_feedback_page.dart | 28 +- .../fragments/home_page_fragment2.dart | 3 +- lib/pages/landing/landing_page.dart | 5 + lib/pages/landing/widgets/services_view.dart | 1 - lib/pages/livecare/incoming_call.dart | 5 - .../livecare/live_care_payment_page.dart | 20 +- lib/pages/livecare/widgets/clinic_list.dart | 4 +- .../medical/balance/confirm_payment_page.dart | 2 +- .../livecare_services/livecare_provider.dart | 2 +- lib/uitl/push-notification-handler.dart | 93 ++-- lib/widgets/app_map/google_huawei_map.dart | 4 + lib/widgets/in_app_browser/InAppBrowser.dart | 22 +- lib/widgets/otp/sms-popup.dart | 2 +- pubspec.yaml | 3 +- 25 files changed, 502 insertions(+), 735 deletions(-) delete mode 100644 lib/pages/Blood/advance_payment_page.dart diff --git a/lib/analytics/google-analytics.dart b/lib/analytics/google-analytics.dart index 2a70d4e4..18353c1e 100644 --- a/lib/analytics/google-analytics.dart +++ b/lib/analytics/google-analytics.dart @@ -9,7 +9,7 @@ import 'package:diplomaticquarterapp/analytics/flows/offers_promotions.dart'; import 'package:diplomaticquarterapp/analytics/flows/todo_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:firebase_analytics/firebase_analytics.dart'; @@ -22,86 +22,78 @@ import 'package:geolocator/geolocator.dart'; import 'flows/app_nav.dart'; import 'flows/hmg_services.dart'; - -typedef GALogger = Function(String name, {Map parameters}); +typedef GALogger = Function(String name, {Map parameters}); var _analytics = FirebaseAnalytics(); -_logger(String name, {Map parameters}) async { + +_logger(String name, {Map parameters}) async { if (name != null && name.isNotEmpty) { - if(name.contains(' ')) - name = name.replaceAll(' ','_'); - + if (name.contains(' ')) name = name.replaceAll(' ', '_'); + // To LowerCase - if(parameters != null && parameters.isNotEmpty) + if (parameters != null && parameters.isNotEmpty) parameters = parameters.map((key, value) { final key_ = key.toLowerCase(); var value_ = value; - if(value is String) - value_ = value.toLowerCase(); + if (value is String) value_ = value.toLowerCase(); return MapEntry(key_, value_); }); - try{ - _analytics - .logEvent(name: name.trim().toLowerCase(), parameters: parameters) - .then((value) { + try { + _analytics.logEvent(name: name.trim().toLowerCase(), parameters: parameters).then((value) { debugPrint('SUCCESS: Google analytics event "$name" sent with parameters $parameters'); }).catchError((error) { debugPrint('ERROR: Google analytics event "$name" sent failed'); }); - }catch(e){ + } catch (e) { print(e); } } } - class GAnalytics { static String TREATMENT_TYPE; static String APPOINTMENT_DETAIL_FLOW_TYPE; static String PAYMENT_TYPE; - setUser(AuthenticatedUser user) async{ - try{ + setUser(AuthenticatedUser user) async { + try { _analytics.setUserProperty(name: 'user_language', value: user.preferredLanguage == '1' ? 'arabic' : 'english'); _analytics.setUserProperty(name: 'userid', value: Utils.generateMd5Hash(user.emailAddress)); _analytics.setUserProperty(name: 'login_status', value: user == null ? 'guest' : 'loggedin'); - final location = await Geolocator.getCurrentPosition(); - if(location != null && !location.isMocked){ - final places = await placemarkFromCoordinates(location.latitude, location.longitude, localeIdentifier: 'en_US'); - final countryCode = places.first.isoCountryCode; - _analytics.setUserProperty(name: 'user_country', value: countryCode); + if (await PermissionService.isLocationEnabled()) { + final location = await Geolocator.getCurrentPosition(); + if (location != null && !location.isMocked) { + final places = await placemarkFromCoordinates(location.latitude, location.longitude, localeIdentifier: 'en_US'); + final countryCode = places.first.isoCountryCode; + _analytics.setUserProperty(name: 'user_country', value: countryCode); + } + } else { + _analytics.setUserProperty(name: 'user_country', value: "N/A"); } - }catch(e){ - - } + } catch (e) {} } - + NavObserver navObserver() => NavObserver(); - final hamburgerMenu = HamburgerMenu(_logger); - final bottomTabNavigation = AppNav(_logger); - final hmgServices = HMGServices(_logger); - final loginRegistration = LoginRegistration(_logger); - final appointment = Appointment(_logger); - final liveCare = LiveCare(_logger); - final todoList = TodoList(_logger); - final advancePayments = AdvancePayments(_logger); - final offerPackages = OfferAndPromotion(_logger); - final errorTracking = ErrorTracking(_logger); + final hamburgerMenu = HamburgerMenu(_logger); + final bottomTabNavigation = AppNav(_logger); + final hmgServices = HMGServices(_logger); + final loginRegistration = LoginRegistration(_logger); + final appointment = Appointment(_logger); + final liveCare = LiveCare(_logger); + final todoList = TodoList(_logger); + final advancePayments = AdvancePayments(_logger); + final offerPackages = OfferAndPromotion(_logger); + final errorTracking = ErrorTracking(_logger); } - - // adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android class NavObserver extends RouteObserver> { _sendScreenView(PageRoute route) async { log(String className) { var event = AnalyticEvents.get(className); if (event.active != null) { - _analytics - .setCurrentScreen( - screenName: event.flutterName(), screenClassOverride: className) - .catchError( + _analytics.setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className).catchError( (Object error) { print('$FirebaseAnalyticsObserver: $error'); }, @@ -112,9 +104,7 @@ class NavObserver extends RouteObserver> { } } - if (route.settings.name != null && - route.settings.name.isNotEmpty && - route.settings.name != "null") { + if (route.settings.name != null && route.settings.name.isNotEmpty && route.settings.name != "null") { var class_ = routes[route.settings.name](0); if (class_ != null) log(class_.toStringShort()); } else if (route is FadePage) { diff --git a/lib/config/config.dart b/lib/config/config.dart index a9aacb75..f31e1290 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -395,7 +395,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 = 7.7; +var VERSION_ID = 7.8; var SETUP_ID = '91877'; var LANGUAGE = 2; var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ac845410..58be0568 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -268,7 +268,7 @@ const Map localizedValues = { "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'}, "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, - "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'الصيدلية االلكترونية'}, + "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'الصيدلية الإلكترونية'}, "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع الإلكتروني'}, "OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'}, @@ -545,7 +545,7 @@ const Map localizedValues = { "emergency": {"en": "Emergency", "ar": "الطوارئ"}, "erservices": {"en": "Emergency", "ar": "الطوارئ"}, "services2": {"en": "Services", "ar": "خدمات"}, - "cantSeeProfile": {"en": "To view your medical profile, please log in or register now", "ar": "للتصفح ملفك الطبي الرجاء تسجيل الدخول أو التسجيل االن"}, + "cantSeeProfile": {"en": "To view your medical profile, please log in or register now", "ar": "للتصفح ملفك الطبي الرجاء تسجيل الدخول أو التسجيل الآن"}, "loginRegisterNow": {"en": "Login or Register Now", "ar": "تسجيل الدخول أو التسجيل الآن"}, "HMGPharmacy": {"en": "HMG Pharmacy", "ar": "صيدلية HMG"}, "ecommerceSolution": {"en": "Ecommerce Solution", "ar": "حل التجارة الإلكترونية"}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8e864293..96832b3e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -137,11 +137,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (BASE_URL == "https://uat.hmgwebservices.com/") { + // if (BASE_URL == "https://uat.hmgwebservices.com/") { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index a3fce7b4..09e0e19e 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -1,11 +1,15 @@ import 'dart:async'; +import 'dart:io'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -16,6 +20,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; @@ -63,7 +68,8 @@ class _LocationPageState extends State { currentPostion = LatLng(widget.latitude, widget.longitude); latitude = widget.latitude; longitude = widget.longitude; - setMap(); + _getUserLocation(); + // setMap(); setState(() {}); }, onCameraIdle: () async { @@ -139,83 +145,193 @@ class _LocationPageState extends State { // ], // ), - PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - }, - selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(0.0), - child: state == SearchingState.Searching - ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer - : DefaultButton(TranslationBase.of(context).addNewAddress, () async { - AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( - customer: Customer(addresses: [ - Addresses( - address1: selectedPlace.formattedAddress, - address2: selectedPlace.formattedAddress, - customerAttributes: "", - createdOnUtc: "", - id: "0", - faxNumber: "", - phoneNumber: projectViewModel.user.mobileNumber, - countryId: 69, - latLong: "$latitude,$longitude", - email: projectViewModel.user.emailAddress) - // Addresses( - // address1: selectedPlace.formattedAddress, - // address2: selectedPlace.formattedAddress, - // customerAttributes: "", - // city: "", - // createdOnUtc: "", - // id: "0", - // latLong: "${selectedPlace.geometry.location}", - // email: "") - ]), - ); - - selectedPlace.addressComponents.forEach((e) { - if (e.types.contains("country")) { - addNewAddressRequestModel.customer.addresses[0].country = e.longName; - } - if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; - } - if (e.types.contains("locality")) { - addNewAddressRequestModel.customer.addresses[0].city = e.longName; - } - }); + // PlacePicker( + // apiKey: GOOGLE_API_KEY, + // enableMyLocationButton: true, + // automaticallyImplyAppBarLeading: false, + // autocompleteOnTrailingWhitespace: true, + // selectInitialPosition: true, + // autocompleteLanguage: projectViewModel.currentLanguage, + // enableMapTypeButton: true, + // searchForInitialValue: false, + // onPlacePicked: (PickResult result) { + // print(result.adrAddress); + // }, + // selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { + // return isSearchBarFocused + // ? Container() + // : FloatingCard( + // bottomPosition: 0.0, + // leftPosition: 0.0, + // rightPosition: 0.0, + // width: 500, + // borderRadius: BorderRadius.circular(0.0), + // child: state == SearchingState.Searching + // ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer + // : DefaultButton(TranslationBase.of(context).addNewAddress, () async { + // AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( + // customer: Customer(addresses: [ + // Addresses( + // address1: selectedPlace.formattedAddress, + // address2: selectedPlace.formattedAddress, + // customerAttributes: "", + // createdOnUtc: "", + // id: "0", + // faxNumber: "", + // phoneNumber: projectViewModel.user.mobileNumber, + // countryId: 69, + // latLong: "$latitude,$longitude", + // email: projectViewModel.user.emailAddress) + // // Addresses( + // // address1: selectedPlace.formattedAddress, + // // address2: selectedPlace.formattedAddress, + // // customerAttributes: "", + // // city: "", + // // createdOnUtc: "", + // // id: "0", + // // latLong: "${selectedPlace.geometry.location}", + // // email: "") + // ]), + // ); + // + // selectedPlace.addressComponents.forEach((e) { + // if (e.types.contains("country")) { + // addNewAddressRequestModel.customer.addresses[0].country = e.longName; + // } + // if (e.types.contains("postal_code")) { + // addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; + // } + // if (e.types.contains("locality")) { + // addNewAddressRequestModel.customer.addresses[0].city = e.longName; + // } + // }); + // + // await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); + // if (model.state == ViewState.ErrorLocal) { + // Utils.showErrorToast(model.error); + // } else { + // AppToast.showSuccessToast(message: "Address Added Successfully"); + // } + // Navigator.of(context).pop(addNewAddressRequestModel); + // }).insideContainer); + // }, + // initialPosition: LatLng(latitude, longitude), + // useCurrentLocation: showCurrentLocation, + // ), - await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - AppToast.showSuccessToast(message: "Address Added Successfully"); - } - Navigator.of(context).pop(addNewAddressRequestModel); - }).insideContainer); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: showCurrentLocation, + Expanded( + child: Stack( + alignment: Alignment.center, + children: [ + if (appMap != null) appMap, + Container( + margin: EdgeInsets.only(bottom: 50.0), + child: Icon( + Icons.place, + color: CustomColors.accentColor, + size: 50, + ), + ), + // FloatingCard( + // bottomPosition: 0.0, + // leftPosition: 0.0, + // rightPosition: 0.0, + // width: 500, + // borderRadius: BorderRadius.circular(0.0), + // // child: state == SearchingState.Searching + // // ? SizedBox(height: 43, child: Center(child: CircularProgressIndicator())).insideContainer + // // : + // child: DefaultButton(TranslationBase.of(context).addNewAddress, () async { + // AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( + // customer: Customer(addresses: [ + // // Addresses( + // // address1: selectedPlace.formattedAddress, + // // address2: selectedPlace.formattedAddress, + // // customerAttributes: "", + // // createdOnUtc: "", + // // id: "0", + // // faxNumber: "", + // // phoneNumber: projectViewModel.user.mobileNumber, + // // countryId: 69, + // // latLong: "$latitude,$longitude", + // // email: projectViewModel.user.emailAddress) + // + // // Addresses( + // // address1: selectedPlace.formattedAddress, + // // address2: selectedPlace.formattedAddress, + // // customerAttributes: "", + // // city: "", + // // createdOnUtc: "", + // // id: "0", + // // latLong: "${selectedPlace.geometry.location}", + // // email: "") + // ]), + // ); + // + // // selectedPlace.addressComponents.forEach((e) { + // // if (e.types.contains("country")) { + // // addNewAddressRequestModel.customer.addresses[0].country = e.longName; + // // } + // // if (e.types.contains("postal_code")) { + // // addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; + // // } + // // if (e.types.contains("locality")) { + // // addNewAddressRequestModel.customer.addresses[0].city = e.longName; + // // } + // // }); + // + // await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); + // if (model.state == ViewState.ErrorLocal) { + // Utils.showErrorToast(model.error); + // } else { + // AppToast.showSuccessToast(message: "Address Added Successfully"); + // } + // Navigator.of(context).pop(addNewAddressRequestModel); + // }).insideContainer), + ], + ), ), ), ); } + void _getUserLocation() async { + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + var lat = await this.sharedPref.getDouble(USER_LAT); + var long = await this.sharedPref.getDouble(USER_LONG); + latitude = lat; + longitude = long; + currentPostion = LatLng(lat, long); + setMap(); + } else { + if (await PermissionService.isLocationEnabled()) { + Geolocator.getLastKnownPosition().then((value) { + latitude = value.latitude; + longitude = value.longitude; + currentPostion = LatLng(latitude, longitude); + setMap(); + }); + } else { + if (Platform.isAndroid) { + Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { + Geolocator.getLastKnownPosition().then((value) { + latitude = value.latitude; + longitude = value.longitude; + currentPostion = LatLng(latitude, longitude); + setMap(); + }); + }); + } else { + Geolocator.getLastKnownPosition().then((value) { + latitude = value.latitude; + longitude = value.longitude; + setMap(); + }); + } + } + } + } + setMap() { setState(() { _kGooglePlex = CameraPosition( @@ -227,6 +343,7 @@ class _LocationPageState extends State { } void _updatePosition(CameraPosition _position) { + print(_position); latitude = _position.target.latitude; longitude = _position.target.longitude; } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 4798b533..5354ff35 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -382,7 +382,7 @@ class _AnicllaryOrdersState extends State with SingleTic makePayment() { showDraggableDialog(context, PaymentMethod( - onSelectedMethod: (String method) { + onSelectedMethod: (String method, [String selectedInstallmentPlan]) { selectedPaymentMethod = method; print(selectedPaymentMethod); openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null); diff --git a/lib/pages/Blood/advance_payment_page.dart b/lib/pages/Blood/advance_payment_page.dart deleted file mode 100644 index dd3ea666..00000000 --- a/lib/pages/Blood/advance_payment_page.dart +++ /dev/null @@ -1,397 +0,0 @@ -// import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -// import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -// import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -// import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; -// import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; -// import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; -// import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -// import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; -// import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; -// import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -// import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.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/buttons/secondary_button.dart'; -// import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -// import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -// import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:smart_progress_bar/smart_progress_bar.dart'; -// -// //import '../../../core/model/my_balance/AdvanceModel.dart'; -// import 'confirm_payment_page.dart'; -// import 'dialogs/SelectBeneficiaryDialog.dart'; -// import 'dialogs/SelectPatientFamilyDialog.dart'; -// import 'dialogs/SelectPatientInfoDialog.dart'; -// import 'new_text_Field.dart'; -// -// enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } -// -// class AdvancePaymentPage extends StatefulWidget { -// @override -// _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); -// } -// -// class _AdvancePaymentPageState extends State { -// TextEditingController _fileTextController = TextEditingController(); -// TextEditingController _notesTextController = TextEditingController(); -// BeneficiaryType beneficiaryType = BeneficiaryType.NON; -// HospitalsModel _selectedHospital; -// String amount = ""; -// String email; -// PatientInfo _selectedPatientInfo; -// AuthenticatedUser authenticatedUser; -// GetAllSharedRecordsByStatusList selectedPatientFamily; -// AdvanceModel advanceModel = AdvanceModel(); -// -// AppSharedPreferences sharedPref = AppSharedPreferences(); -// AuthenticatedUser authUser; -// -// @override -// void initState() { -// super.initState(); -// getAuthUser(); -// } -// -// @override -// Widget build(BuildContext context) { -// return BaseView( -// onModelReady: (model) => model.getHospitals(), -// builder: (_, model, w) => AppScaffold( -// isShowAppBar: true, -// appBarTitle: TranslationBase.of(context).advancePayment, -// body: SingleChildScrollView( -// physics: ScrollPhysics(), -// child: Container( -// margin: EdgeInsets.all(12), -// child: Column( -// crossAxisAlignment: CrossAxisAlignment.start, -// children: [ -// Texts( -// TranslationBase.of(context).advancePaymentLabel, -// textAlign: TextAlign.center, -// ), -// SizedBox( -// height: 12, -// ), -// InkWell( -// onTap: () => confirmSelectBeneficiaryDialog(model), -// child: Container( -// padding: EdgeInsets.all(12), -// width: double.infinity, -// height: 65, -// decoration: BoxDecoration( -// borderRadius: BorderRadius.circular(12), -// color: Colors.white), -// child: Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// Texts(getBeneficiaryType()), -// Icon(Icons.arrow_drop_down) -// ], -// ), -// ), -// ), -// if (beneficiaryType == BeneficiaryType.MyFamilyFiles) -// SizedBox( -// height: 12, -// ), -// if (beneficiaryType == BeneficiaryType.MyFamilyFiles) -// InkWell( -// onTap: () { -// model.getFamilyFiles().then((value) { -// confirmSelectFamilyDialog(model -// .getAllSharedRecordsByStatusResponse -// .getAllSharedRecordsByStatusList); -// }).showProgressBar( -// text: "Loading", -// backgroundColor: Colors.blue.withOpacity(0.6)); -// }, -// child: Container( -// padding: EdgeInsets.all(12), -// width: double.infinity, -// height: 65, -// decoration: BoxDecoration( -// borderRadius: BorderRadius.circular(12), -// color: Colors.white), -// child: Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// Texts(getFamilyMembersName()), -// Icon(Icons.arrow_drop_down) -// ], -// ), -// ), -// ), -// SizedBox( -// height: 12, -// ), -// NewTextFields( -// hintText: TranslationBase.of(context).fileNumber, -// controller: _fileTextController, -// ), -// if (beneficiaryType == BeneficiaryType.OtherAccount) -// SizedBox( -// height: 12, -// ), -// if (beneficiaryType == BeneficiaryType.OtherAccount) -// InkWell( -// onTap: () { -// if (_fileTextController.text.isNotEmpty) -// model -// .getPatientInfoByPatientID( -// id: _fileTextController.text) -// .then((value) { -// confirmSelectPatientDialog(model.patientInfoList); -// }).showProgressBar( -// text: "Loading", -// backgroundColor: -// Colors.blue.withOpacity(0.6)); -// else -// AppToast.showErrorToast( -// message: 'Please Enter The File Number'); -// }, -// child: Container( -// padding: EdgeInsets.all(12), -// width: double.infinity, -// height: 65, -// decoration: BoxDecoration( -// borderRadius: BorderRadius.circular(12), -// color: Colors.white), -// child: Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// Texts(getPatientName()), -// Icon(Icons.arrow_drop_down) -// ], -// ), -// ), -// ), -// SizedBox( -// height: 12, -// ), -// InkWell( -// onTap: () => confirmSelectHospitalDialog(model.hospitals), -// child: Container( -// padding: EdgeInsets.all(12), -// width: double.infinity, -// height: 65, -// decoration: BoxDecoration( -// borderRadius: BorderRadius.circular(12), -// color: Colors.white), -// child: Row( -// mainAxisAlignment: MainAxisAlignment.spaceBetween, -// children: [ -// Texts(getHospitalName()), -// Icon(Icons.arrow_drop_down) -// ], -// ), -// ), -// ), -// SizedBox( -// height: 12, -// ), -// NewTextFields( -// hintText: TranslationBase.of(context).amount, -// keyboardType: TextInputType.number, -// onChanged: (value) { -// setState(() { -// amount = value; -// }); -// }, -// ), -// SizedBox( -// height: 12, -// ), -// NewTextFields( -// hintText: TranslationBase.of(context).depositorEmail, -// initialValue: model.user.emailAddress, -// onChanged: (value) { -// email = value; -// }, -// ), -// SizedBox( -// height: 12, -// ), -// NewTextFields( -// hintText: TranslationBase.of(context).notes, -// controller: _notesTextController, -// ), -// SizedBox( -// height: MediaQuery.of(context).size.height * 0.15, -// ) -// ], -// ), -// ), -// ), -// bottomSheet: Container( -// height: MediaQuery.of(context).size.height * 0.1, -// width: double.infinity, -// padding: EdgeInsets.all(12), -// child: SecondaryButton( -// textColor: Colors.white, -// label: TranslationBase.of(context).submit, -// disabled: amount.isEmpty || -// _fileTextController.text.isEmpty || -// _selectedHospital == null, -// onTap: () { -// advanceModel.fileNumber = _fileTextController.text; -// advanceModel.hospitalsModel = _selectedHospital; -// advanceModel.note = _notesTextController.text; -// advanceModel.email = email ?? model.user.emailAddress; -// advanceModel.amount = amount; -// -// model.getPatientInfoByPatientIDAndMobileNumber().then((value) { -// if (model.state != ViewState.Error && -// model.state != ViewState.ErrorLocal) { -// Utils.hideKeyboard(context); -// Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => PaymentMethod())).then( -// (value) { -// Navigator.push( -// context, -// FadePage( -// page: ConfirmPaymentPage( -// advanceModel: advanceModel, -// selectedPaymentMethod: value, -// patientInfoAndMobileNumber: -// model.patientInfoAndMobileNumber, -// authenticatedUser: authUser, -// ), -// ), -// ); -// }, -// ); -// } -// }).showProgressBar( -// text: "Loading", -// backgroundColor: Colors.blue.withOpacity(0.6)); -// }, -// ), -// )), -// ); -// } -// -// void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { -// showDialog( -// context: context, -// child: SelectBeneficiaryDialog( -// beneficiaryType: beneficiaryType, -// onValueSelected: (value) { -// setState(() { -// if (value == BeneficiaryType.MyAccount) { -// _fileTextController.text = model.user.patientID.toString(); -// advanceModel.depositorName = -// model.user.firstName + " " + model.user.lastName; -// } else -// _fileTextController.text = ""; -// -// beneficiaryType = value; -// }); -// }, -// ), -// ); -// } -// -// void confirmSelectHospitalDialog(List hospitals) { -// showDialog( -// context: context, -// child: SelectHospitalDialog( -// hospitals: hospitals, -// selectedHospital: _selectedHospital, -// onValueSelected: (value) { -// setState(() { -// _selectedHospital = value; -// }); -// }, -// ), -// ); -// } -// -// void confirmSelectPatientDialog(List patientInfoList) { -// showDialog( -// context: context, -// child: SelectPatientInfoDialog( -// patientInfoList: patientInfoList, -// selectedPatientInfo: _selectedPatientInfo, -// onValueSelected: (value) { -// setState(() { -// advanceModel.depositorName = value.fullName; -// _selectedPatientInfo = value; -// }); -// }, -// ), -// ); -// } -// -// void confirmSelectFamilyDialog( -// List getAllSharedRecordsByStatusList) { -// showDialog( -// context: context, -// child: SelectPatientFamilyDialog( -// getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, -// selectedPatientFamily: selectedPatientFamily, -// onValueSelected: (value) { -// setState(() { -// selectedPatientFamily = value; -// _fileTextController.text = -// selectedPatientFamily.patientID.toString(); -// advanceModel.depositorName = value.patientName; -// }); -// }, -// ), -// ); -// } -// -// String getBeneficiaryType() { -// switch (beneficiaryType) { -// case BeneficiaryType.MyAccount: -// return TranslationBase.of(context).myAccount; -// case BeneficiaryType.MyFamilyFiles: -// return TranslationBase.of(context).myFamilyFiles; -// break; -// case BeneficiaryType.OtherAccount: -// return TranslationBase.of(context).otherAccount; -// break; -// case BeneficiaryType.NON: -// return TranslationBase.of(context).selectBeneficiary; -// } -// return TranslationBase.of(context).selectBeneficiary; -// } -// -// String getHospitalName() { -// if (_selectedHospital != null) -// return _selectedHospital.name; -// else -// return TranslationBase.of(context).selectHospital; -// } -// -// String getPatientName() { -// if (_selectedPatientInfo != null) -// return _selectedPatientInfo.fullName; -// else -// return TranslationBase.of(context).selectPatientName; -// } -// -// getAuthUser() async { -// if (await this.sharedPref.getObject(USER_PROFILE) != null) { -// var data = AuthenticatedUser.fromJson( -// await this.sharedPref.getObject(USER_PROFILE)); -// setState(() { -// authUser = data; -// }); -// } -// } -// -// String getFamilyMembersName() { -// if (selectedPatientFamily != null) -// return selectedPatientFamily.patientName; -// else -// return TranslationBase.of(context).selectFamilyPatientName; -// } -// } diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 7f2ba582..0f8b1dc7 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -7,11 +7,13 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da import 'package:diplomaticquarterapp/theme/colors.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'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class CovidPaymentDetails extends StatefulWidget { CovidPaymentInfoResponse covidPaymentInfoResponse; @@ -193,14 +195,19 @@ class _CovidPaymentDetailsState extends State { ), ), mWidth(3), - Text( - TranslationBase.of(context).termsConditoins, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - color: CustomColors.accentColor, - fontWeight: FontWeight.w600, - decoration: TextDecoration.underline, + InkWell( + onTap: () { + launch("https://hmg.com/en/Pages/Privacy.aspx"); + }, + child: Text( + TranslationBase.of(context).termsConditoins, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + color: CustomColors.accentColor, + fontWeight: FontWeight.w600, + decoration: TextDecoration.underline, + ), ), ), ], diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index ed31b3fc..4c5144ef 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -33,6 +33,7 @@ class NotificationsDetailsPage extends StatelessWidget { isShowAppBar: true, showNewAppBar: true, showNewAppBarTitle: true, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).notificationDetails, body: ListView( physics: BouncingScrollPhysics(), @@ -49,7 +50,6 @@ class NotificationsDetailsPage extends StatelessWidget { letterSpacing: -0.64, ), ), - if (notification.messageTypeData.length != 0) Padding( padding: const EdgeInsets.only(top: 18), @@ -64,7 +64,6 @@ class NotificationsDetailsPage extends StatelessWidget { ); }, fit: BoxFit.fill), ), - SizedBox(height: 18), Text( notification.message.trim(), @@ -75,7 +74,6 @@ class NotificationsDetailsPage extends StatelessWidget { letterSpacing: -0.48, ), ), - ], ), ); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 1dfe7110..0c71a2ea 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -214,7 +214,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { borderRadius: BorderRadius.circular(6), ), child: Text( - getNextActionText(widget.appoList[index].nextAction), + getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), ), ), diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index b76ac855..44836124 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/core/model/my_balance/tamara_installment_details.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class PaymentMethod extends StatefulWidget { Function onSelectedMethod; @@ -27,6 +29,7 @@ class _PaymentMethodState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).paymentMethod, isShowAppBar: true, @@ -45,153 +48,156 @@ class _PaymentMethodState extends State { margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0), child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), ), - Container( - width: double.infinity, - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("MADA"); - }, - child: Card( - elevation: 0.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - children: [ - Container( - width: 24, - height: 24, - decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "MADA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), - ), - mWidth(12), - Container( - height: 70.0, - width: 70.0, - padding: EdgeInsets.all(7.0), - child: Image.asset("assets/images/new/payment/Mada.png"), - ), - mFlex(1), - if (selectedPaymentMethod == "MADA") + if (projectViewModel.havePrivilege(86)) + Container( + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("MADA"); + }, + child: Card( + elevation: 0.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "MADA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + children: [ Container( - decoration: containerRadius(CustomColors.green, 200), - padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), - child: Text( - TranslationBase.of(context).paymentSelected, - style: TextStyle( - color: Colors.white, - fontSize: 11, + width: 24, + height: 24, + decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "MADA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), + ), + mWidth(12), + Container( + height: 70.0, + width: 70.0, + padding: EdgeInsets.all(7.0), + child: Image.asset("assets/images/new/payment/Mada.png"), + ), + mFlex(1), + if (selectedPaymentMethod == "MADA") + Container( + decoration: containerRadius(CustomColors.green, 200), + padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), + child: Text( + TranslationBase.of(context).paymentSelected, + style: TextStyle( + color: Colors.white, + fontSize: 11, + ), ), ), - ), - ], + ], + ), ), ), ), ), - ), - Container( - width: double.infinity, - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("VISA"); - }, - child: Card( - elevation: 0.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - children: [ - Container( - width: 24, - height: 24, - decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "VISA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), - ), - mWidth(12), - Container( - height: 60.0, - padding: EdgeInsets.all(7.0), - width: 60, - child: Image.asset("assets/images/new/payment/visa.png"), - ), - mFlex(1), - if (selectedPaymentMethod == "VISA") + if (projectViewModel.havePrivilege(87)) + Container( + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("VISA"); + }, + child: Card( + elevation: 0.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "VISA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + children: [ + Container( + width: 24, + height: 24, + decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "VISA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), + ), + mWidth(12), Container( - decoration: containerRadius(CustomColors.green, 200), - padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), - child: Text( - TranslationBase.of(context).paymentSelected, - style: TextStyle( - color: Colors.white, - fontSize: 11, + height: 60.0, + padding: EdgeInsets.all(7.0), + width: 60, + child: Image.asset("assets/images/new/payment/visa.png"), + ), + mFlex(1), + if (selectedPaymentMethod == "VISA") + Container( + decoration: containerRadius(CustomColors.green, 200), + padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), + child: Text( + TranslationBase.of(context).paymentSelected, + style: TextStyle( + color: Colors.white, + fontSize: 11, + ), ), ), - ), - ], + ], + ), ), ), ), ), - ), - Container( - width: double.infinity, - child: InkWell( - onTap: () { - updateSelectedPaymentMethod("MASTERCARD"); - }, - child: Card( - elevation: 0.0, - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), - ), - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - children: [ - Container( - width: 24, - height: 24, - decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "MASTERCARD" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), - ), - mWidth(12), - Container( - height: 60.0, - padding: EdgeInsets.all(7.0), - width: 60, - child: Image.asset("assets/images/new/payment/Mastercard.png"), - ), - mFlex(1), - if (selectedPaymentMethod == "MASTERCARD") + if (projectViewModel.havePrivilege(88)) + Container( + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("MASTERCARD"); + }, + child: Card( + elevation: 0.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "MASTERCARD" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + children: [ + Container( + width: 24, + height: 24, + decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "MASTERCARD" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), + ), + mWidth(12), Container( - decoration: containerRadius(CustomColors.green, 200), - padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), - child: Text( - TranslationBase.of(context).paymentSelected, - style: TextStyle( - color: Colors.white, - fontSize: 11, + height: 60.0, + padding: EdgeInsets.all(7.0), + width: 60, + child: Image.asset("assets/images/new/payment/Mastercard.png"), + ), + mFlex(1), + if (selectedPaymentMethod == "MASTERCARD") + Container( + decoration: containerRadius(CustomColors.green, 200), + padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), + child: Text( + TranslationBase.of(context).paymentSelected, + style: TextStyle( + color: Colors.white, + fontSize: 11, + ), ), ), - ), - ], + ], + ), ), ), ), ), - ), // Container( // width: double.infinity, // child: InkWell( @@ -241,7 +247,7 @@ class _PaymentMethodState extends State { // ), // ), // ), - if (widget.isShowInstallments) + if (widget.isShowInstallments && projectViewModel.havePrivilege(91)) Container( width: double.infinity, child: InkWell( @@ -292,7 +298,7 @@ class _PaymentMethodState extends State { ), ), ), - Platform.isIOS + (Platform.isIOS && projectViewModel.havePrivilege(89)) ? Container( width: double.infinity, child: InkWell( diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 6e879612..be91c099 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -6,19 +6,18 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.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/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'; import 'package:flutter/cupertino.dart'; @@ -32,6 +31,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class SendFeedbackPage extends StatefulWidget { final AppoitmentAllHistoryResultList appointment; final MessageType messageType; + const SendFeedbackPage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); @override @@ -93,11 +93,11 @@ class _SendFeedbackPageState extends State { this.messageType = widget.messageType; this.appointHistory = widget.appointment; }); - requestPermissions(); + // requestPermissions(); event.controller.stream.listen((p) { if (p['isIOSFeedback'] == 'true') { if (this.mounted) { - this.titleController.value = p['data']; + this.titleController.value = p['data']; } } }); @@ -217,8 +217,18 @@ class _SendFeedbackPageState extends State { ), inputWidget(TranslationBase.of(context).subject, "", titleController), SizedBox(height: 12), - inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () { - openSpeechReco(); + inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async { + if (Platform.isAndroid) { + if (await PermissionService.isMicrophonePermissionEnabled()) { + openSpeechReco(); + } else { + Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { + openSpeechReco(); + }); + } + } else { + openSpeechReco(); + } }), SizedBox(height: 12), InkWell( @@ -536,7 +546,6 @@ class _SendFeedbackPageState extends State { Map statuses = await [ Permission.microphone, ].request(); - print(statuses); } void resultListener(result) { @@ -548,7 +557,6 @@ class _SendFeedbackPageState extends State { messageController.text += reconizedWord + '\n'; RoboSearch.closeAlertDialog(context); speech.stop(); - }); } } @@ -558,4 +566,4 @@ class _SendFeedbackPageState extends State { print(hasSpeech); if (!mounted) return; } -} \ No newline at end of file +} diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 7e9ed25c..87666a90 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -290,7 +290,7 @@ class _HomePageFragment2State extends State { onTap: () { projectViewModel.analytics.offerPackages.log(); AuthenticatedUser user = projectViewModel.user; - if(projectViewModel.havePrivilege(82)) + // if(projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); }, child: Stack( @@ -305,7 +305,6 @@ class _HomePageFragment2State extends State { Container( width: double.infinity, height: double.infinity, - // color: Color(0xFF2B353E), decoration: containerRadius(Color(0xFF2B353E), 20), ), Container( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 5b4a6bd1..e8037806 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -39,6 +39,8 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_app_icon_badge/flutter_app_icon_badge.dart'; + import '../../locator.dart'; import '../../routes.dart'; @@ -236,6 +238,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _requestIOSPermissions(); pageController = PageController(keepPage: true); + _firebaseMessaging.setAutoInitEnabled(true); // locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); @@ -248,6 +251,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // for now commented to reduce this call will enable it when needed HMGNetworkConnectivity(context).start(); + _firebaseMessaging.getToken().then((String token) { print("Firebase Token: " + token); sharedPref.setString(PUSH_TOKEN, token); @@ -530,6 +534,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); } }), }); diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index da40b985..9903835f 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -281,7 +281,6 @@ class ServicesView extends StatelessWidget { showCovidDialog(BuildContext context) { if (Platform.isAndroid) { - // Utils.showPermissionConsentDialog(context, "", () {}); showDialog( context: context, builder: (cxt) => CovidConsentDialog( diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index 7f264712..de5af441 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -43,11 +43,6 @@ class _IncomingCallState extends State with SingleTickerProviderSt isCameraReady = false; WidgetsBinding.instance.addPostFrameCallback((_) => _runAnimation()); - // - // print(widget.incomingCallData.doctorname); - // print(widget.incomingCallData.clinicname); - // print(widget.incomingCallData.speciality); - super.initState(); } diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index 54aeffbf..7aed9a3b 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class LiveCarePatmentPage extends StatefulWidget { GetERAppointmentFeesList getERAppointmentFeesList; @@ -226,13 +227,18 @@ class _LiveCarePatmentPageState extends State { ), ), mWidth(4), - Text( - TranslationBase.of(context).termsConditoins, - style: new TextStyle( - fontSize: 12.0, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - color: CustomColors.accentColor, + InkWell( + onTap: () { + launch("https://hmg.com/en/Pages/Privacy.aspx"); + }, + child: Text( + TranslationBase.of(context).termsConditoins, + style: new TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: CustomColors.accentColor, + ), ), ), ], diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index b7978ea2..7f3359f5 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -193,7 +193,7 @@ class _clinic_listState extends State { askVideoCallPermission().then((value) { if (value) { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { - showLiveCareInfoDialog(getERAppointmentFeesList); + addNewCallForPatientER(projectViewModel.user.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString()); } else { navigateToPaymentMethod(getERAppointmentFeesList, context); } @@ -294,7 +294,7 @@ class _clinic_listState extends State { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0], - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString(), "", "", "", "", paymentMethod[1]); + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, "", "", "", "", paymentMethod[1]); } onBrowserLoadStart(String url) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 3a7ef839..5954b420 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -348,7 +348,7 @@ class _ConfirmPaymentPageState extends State { transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber)); browser.openPaymentBrowser(amount, "Advance Payment", transID, widget.advanceModel.hospitalsModel.iD.toString(), widget.advanceModel.email, paymentMethod, - widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", "", "", "", "", "", widget.installmentPlan); + widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, authenticatedUser, browser, false, "3", "0", "", "", "", "", widget.installmentPlan); } onBrowserLoadStart(String url) { diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 7d4950a9..0abfb7be 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -216,7 +216,7 @@ class LiveCareService extends BaseService { "ClientRequestID": clientRequestID, "DeviceToken": deviceToken, "VoipToken": "", - // "IsFlutter": true, + "IsFlutter": true, "Latitude": await this.sharedPref.getDouble(USER_LAT), "Longitude": await this.sharedPref.getDouble(USER_LONG), "DeviceType": Platform.isIOS ? 'iOS' : 'Android', diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 76399a1a..8108e8e2 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -1,35 +1,49 @@ import 'dart:convert'; import 'dart:io'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; +import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/uitl/app-permissions.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:huawei_push/huawei_push.dart' as h_push; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart' as fir; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; -import 'package:shared_preferences/shared_preferences.dart'; +import 'package:huawei_push/huawei_push.dart' as h_push; import 'app_shared_preferences.dart'; import 'navigation_service.dart'; // |--> Push Notification Background Future backgroundMessageHandler(dynamic message) async { + print("Firebase backgroundMessageHandler!!!"); fir.RemoteMessage message_; if (message is h_push.RemoteMessage) { // if huawei remote message convert it to Firebase Remote Message message_ = toFirebaseRemoteMessage(message); + h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"}); } if (message.data != null && message.data['is_call'] == 'true') { _incomingCall(message.data); return; + } else { + GetNotificationsResponseModel notification = new GetNotificationsResponseModel(); + + notification.createdOn = DateUtil.convertDateToString(DateTime.now()); + notification.messageTypeData = message.data['picture']; + notification.message = message.data['message']; + + await NavigationService.navigateToPage(NotificationsDetailsPage( + notification: notification, + )); } - h_push.Push.localNotification({h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"}); } // Push Notification Background <--| @@ -90,39 +104,44 @@ class PushNotificationHandler { static PushNotificationHandler getInstance() => _instance; init() async { + final fcmToken = await FirebaseMessaging.instance.getToken(); + if (fcmToken != null) onToken(fcmToken); if (Platform.isIOS) { final permission = await FirebaseMessaging.instance.requestPermission(); if (permission.authorizationStatus == AuthorizationStatus.denied) return; } - if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) { - // 'Android HMS' (Handle Huawei Push_Kit Streams) - - h_push.Push.enableLogger(); - final result = await h_push.Push.setAutoInitEnabled(true); - - h_push.Push.onNotificationOpenedApp.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.onMessageReceivedStream.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.getTokenStream.listen((token) { - onToken(token); - }, onError: (e) => print(e.toString())); - await h_push.Push.getToken(''); - - h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); - } else { + // if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) { + // // 'Android HMS' (Handle Huawei Push_Kit Streams) + // + // h_push.Push.enableLogger(); + // final result = await h_push.Push.setAutoInitEnabled(true); + // + // h_push.Push.onNotificationOpenedApp.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.onMessageReceivedStream.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.getTokenStream.listen((token) { + // onToken(token); + // }, onError: (e) => print(e.toString())); + // await h_push.Push.getToken(''); + // + // h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); + // } else { // 'Android GMS or iOS' (Handle Firebase Messaging Streams) + print("Firebase onMessage!!!--------------------"); FirebaseMessaging.onMessage.listen((RemoteMessage message) async { + print("Firebase onMessage!!!"); newMessage(message); }); FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) { + print("Firebase onMessageOpenedApp!!!"); newMessage(message); }); @@ -131,14 +150,24 @@ class PushNotificationHandler { }); FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); - - final fcmToken = await FirebaseMessaging.instance.getToken(); - if (fcmToken != null) onToken(fcmToken); - } + // } } - newMessage(RemoteMessage remoteMessage) { - if (remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) _incomingCall(remoteMessage.data); + newMessage(RemoteMessage remoteMessage) async { + print("Remote Message: " + remoteMessage.data.toString()); + if (remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) { + _incomingCall(remoteMessage.data); + } else { + GetNotificationsResponseModel notification = new GetNotificationsResponseModel(); + + notification.createdOn = DateUtil.convertDateToString(DateTime.now()); + notification.messageTypeData = remoteMessage.data['picture']; + notification.message = remoteMessage.data['message']; + + await NavigationService.navigateToPage(NotificationsDetailsPage( + notification: notification, + )); + } } onToken(String token) async { diff --git a/lib/widgets/app_map/google_huawei_map.dart b/lib/widgets/app_map/google_huawei_map.dart index 0e9b4936..2ff86acd 100644 --- a/lib/widgets/app_map/google_huawei_map.dart +++ b/lib/widgets/app_map/google_huawei_map.dart @@ -88,6 +88,10 @@ class AppMapState extends State { _huaweiMapControllerComp.complete(controller); widget.onMapCreated(); }, + onCameraIdle: () { + print("onCameraIdle"); + widget.onCameraIdle(); + }, ); } } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 2a8721ae..a55bcd08 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -32,13 +32,13 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; @@ -155,28 +155,28 @@ class MyInAppBrowser extends InAppBrowser { ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest(); applePayInsertRequest.clientRequestID = transactionID; - applePayInsertRequest.clinicID = clinicID != null ? clinicID : 0; + applePayInsertRequest.clinicID = (clinicID != null && clinicID != "") ? clinicID : 0; applePayInsertRequest.currency = authenticatedUser.outSA == 1 ? "AED" : "SAR"; applePayInsertRequest.customerEmail = emailId; applePayInsertRequest.customerID = authenticatedUser.patientID; applePayInsertRequest.customerName = authenticatedUser.firstName; applePayInsertRequest.deviceToken = deviceToken; - applePayInsertRequest.doctorID = doctorID != null ? doctorID : 0; + applePayInsertRequest.doctorID = (doctorID != null && doctorID != "") ? doctorID : 0; applePayInsertRequest.projectID = projId; applePayInsertRequest.serviceID = servID; applePayInsertRequest.channelID = 3; applePayInsertRequest.patientID = authenticatedUser.patientID; applePayInsertRequest.patientTypeID = authenticatedUser.patientType; applePayInsertRequest.patientOutSA = authenticatedUser.outSA; - applePayInsertRequest.appointmentDate = appoDate != null ? appoDate : null; - applePayInsertRequest.appointmentNo = appoNo != null ? appoNo : 0; + applePayInsertRequest.appointmentDate = (appoDate != null && appoDate != "") ? appoDate : null; + applePayInsertRequest.appointmentNo = (appoNo != null && appoNo != "") ? appoNo : 0; applePayInsertRequest.orderDescription = orderDesc; - applePayInsertRequest.liveServiceID = LiveServID; + applePayInsertRequest.liveServiceID = LiveServID.toString() == "" ? "0" : LiveServID.toString(); applePayInsertRequest.latitude = this.lat.toString(); applePayInsertRequest.longitude = this.long.toString(); applePayInsertRequest.amount = amount.toString(); applePayInsertRequest.isSchedule = "0"; - applePayInsertRequest.language = await getLanguageID() == 'ar' ? 'AR' : 'EN'; + applePayInsertRequest.language = await getLanguageID() == 'ar' ? 'ar' : 'en'; applePayInsertRequest.userName = authenticatedUser.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; @@ -258,7 +258,7 @@ class MyInAppBrowser extends InAppBrowser { if (servID != null) { form = form.replaceFirst('SERV_ID', servID); - form = form.replaceFirst('LIVE_SERVICE_ID', LiveServID); + form = form.replaceFirst('LIVE_SERVICE_ID', LiveServID.toString()); } else { form = form.replaceFirst('SERV_ID', "2"); form = form.replaceFirst('LIVE_SERVICE_ID', "2"); diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index afb27530..0eae15e4 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -128,7 +128,7 @@ class SMSOTP { pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition, pinTextAnimatedSwitcherDuration: Duration(milliseconds: 300), pinBoxRadius: 10, - keyboardType: TextInputType.number, + keyboardType: TextInputType.numberWithOptions(), ), ), ), diff --git a/pubspec.yaml b/pubspec.yaml index ceccf36e..77001583 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.4.3+1 +version: 4.4.6+40406 environment: sdk: ">=2.7.0 <3.0.0" @@ -180,6 +180,7 @@ dependencies: in_app_review: ^2.0.3 badges: ^2.0.1 + flutter_app_icon_badge: ^2.0.0 syncfusion_flutter_sliders: ^19.3.55 searchable_dropdown: ^1.1.3 dropdown_search: 0.4.9