diff --git a/google-services_old.json b/google-services_old.json new file mode 100644 index 00000000..5806fa5f --- /dev/null +++ b/google-services_old.json @@ -0,0 +1,47 @@ +{ + "project_info": { + "project_number": "815750722565", + "firebase_url": "https://api-project-815750722565.firebaseio.com", + "project_id": "api-project-815750722565", + "storage_bucket": "api-project-815750722565.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", + "android_client_info": { + "package_name": "com.ejada.hmg" + } + }, + "oauth_client": [ + { + "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "815750722565-0cq9366orvsk5ipivq6lijcj56u03fr7.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.void.demo" + } + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index d826c0c7..ebaa3e1a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -599,7 +599,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.93; + MARKETING_VERSION = 4.5.95; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -749,7 +749,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.93; + MARKETING_VERSION = 4.5.95; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -791,7 +791,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.93; + MARKETING_VERSION = 4.5.95; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index 2b75fe23..063ad690 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -33,7 +33,7 @@ var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'http://10.50.100.198:4422/'; -// Pharmacy UAT URLs +// Pharmacy UAT URLs` // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -344,7 +344,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 15.9; +var VERSION_ID = 16.3; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -668,10 +668,10 @@ var GET_DENTAL_INSTRUCTIONS = 'Services/OUTPs.svc/Rest/getProcedureNotification' //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; -var payFortEnvironment = FortEnvironment.production; -var applePayMerchantId = "merchant.com.hmgwebservices"; -// var payFortEnvironment = FortEnvironment.test; -// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +// var payFortEnvironment = FortEnvironment.production; +// var applePayMerchantId = "merchant.com.hmgwebservices"; +var payFortEnvironment = FortEnvironment.test; +var applePayMerchantId = "merchant.com.hmgwebservices.uat"; class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ed4755c1..95d7dd8f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1977,4 +1977,5 @@ const Map localizedValues = { "wecare": {"en": "We Care", "ar": "نحن نهتم"}, "myinstructions": {"en": "My Instructions", "ar": "تعليماتي"}, "clinicLocation": {"en": "Clinic Location", "ar": "موقع العيادة"}, + "searchClinic": {"en": "Search Clinic", "ar": "بحث العيادة"}, }; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 398b3afe..7216da7b 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -30,7 +30,7 @@ class ProjectViewModel extends BaseViewModel { AppSharedPreferences sharedPref = AppSharedPreferences(); Locale _appLocale = Locale('ar'); String currentLanguage = 'ar'; - bool _isArabic = false; + bool _isArabic = true; bool isInternetConnection = true; bool isLoading = false; bool isError = false; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 8c6ad3f6..205909c9 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -41,6 +41,7 @@ class DoctorList { dynamic serviceID; String? setupID; List? speciality; + List? specialityN; dynamic workingHours; dynamic decimalDoctorRate; @@ -87,6 +88,7 @@ class DoctorList { this.serviceID, this.setupID, this.speciality, + this.specialityN, this.workingHours, this.decimalDoctorRate}); @@ -133,6 +135,7 @@ class DoctorList { serviceID = json['ServiceID']; setupID = json['SetupID']; if (json.containsKey('Speciality') && json['Speciality'] != null) speciality = json['Speciality'].cast(); + if (json.containsKey('SpecialityN') && json['SpecialityN'] != null) specialityN = json['SpecialityN'].cast(); workingHours = json['WorkingHours']; decimalDoctorRate = json['DecimalDoctorRate']; } @@ -180,6 +183,7 @@ class DoctorList { data['ServiceID'] = this.serviceID; data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; + data['SpecialityN'] = this.specialityN; data['WorkingHours'] = this.workingHours; data['DecimalDoctorRate'] = this.decimalDoctorRate; return data; diff --git a/lib/models/LiveCare/ERAppointmentFeesResponse.dart b/lib/models/LiveCare/ERAppointmentFeesResponse.dart index b8a88aba..3deaa05b 100644 --- a/lib/models/LiveCare/ERAppointmentFeesResponse.dart +++ b/lib/models/LiveCare/ERAppointmentFeesResponse.dart @@ -24,6 +24,8 @@ class GetERAppointmentFeesList { String? companyName; bool? isInsured; bool? isShowInsuranceUpdateModule; + bool? isCash; + bool? isEligible; String? tax; String? total; String? currency; @@ -41,6 +43,8 @@ class GetERAppointmentFeesList { amount = json['Amount']; companyName = json['CompanyName']; isInsured = json['IsInsured']; + isCash = json['IsCash']; + isEligible = json['IsEligible']; isShowInsuranceUpdateModule = json['IsShowInsuranceUpdateModule']; tax = json['Tax']; total = json['Total']; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart index 536af3cd..94379af8 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart @@ -100,7 +100,7 @@ class ConfirmDialog extends StatelessWidget { onClick(); Navigator.pop(context); }, - textColor: Theme.of(context).backgroundColor), + textColor: CustomColors.white), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart index b9eefe08..3b5d585e 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -367,11 +368,11 @@ class _EReferralConfirmSMSDialogState extends State { ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), ); } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart index 89091886..05b0d753 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -36,9 +37,7 @@ class HomeHealthCareIndexPage extends StatelessWidget { SizedBox( height: 22, ), - Center( - child: Image.asset( - 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + Center(child: Image.asset('assets/images/AlHabibMedicalService/Wifi-AR.png')), SizedBox( height: 77, ), @@ -53,13 +52,13 @@ class HomeHealthCareIndexPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( onTap: () => Navigator.push( - context, - FadePage( - page: HomeHealthCarePage(), - ), - ), + context, + FadePage( + page: HomeHealthCarePage(), + ), + ), label: TranslationBase.of(context).loginRegister, - textColor: Theme.of(context).backgroundColor), + textColor: CustomColors.white), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index d48247f8..cb1183ef 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -669,6 +669,7 @@ class _AnicllaryOrdersState extends State with SingleTic payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index df8d3cc8..a28c0d3e 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -57,9 +58,7 @@ class H2OPageIndexPage extends StatelessWidget { onTap: () => Navigator.push(context, FadePage(page: H2OPage())), label: "Water Tracker", - textColor: Theme - .of(context) - .backgroundColor), + textColor: CustomColors.white), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/my_web_view.dart b/lib/pages/AlHabibMedicalService/my_web_view.dart index 1779b127..bd824cd4 100644 --- a/lib/pages/AlHabibMedicalService/my_web_view.dart +++ b/lib/pages/AlHabibMedicalService/my_web_view.dart @@ -4,31 +4,57 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:webview_flutter/webview_flutter.dart'; -class MyWebView extends StatelessWidget { +class MyWebView extends StatefulWidget { final String title; final String selectedUrl; - final Completer _controller = Completer(); - MyWebView({ required this.title, required this.selectedUrl, }); @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: title, - isShowDecPage: false, - showNewAppBar: true, - showNewAppBarTitle: true, - body: WebView( - initialUrl: selectedUrl, - javascriptMode: JavascriptMode.unrestricted, - onWebViewCreated: (WebViewController webViewController) { - _controller.complete(webViewController); + State createState() => _MyWebViewState(); +} + +class _MyWebViewState extends State { + // final Completer _controller = Completer(); + late final WebViewController _controller; + + @override + void initState() { + super.initState(); + _controller = WebViewController() + ..setJavaScriptMode(JavaScriptMode.unrestricted) + ..setNavigationDelegate( + NavigationDelegate( + onProgress: (int progress) { + // Update loading bar. }, - )); + onPageStarted: (String url) {}, + onPageFinished: (String url) {}, + onHttpError: (HttpResponseError error) {}, + onWebResourceError: (WebResourceError error) {}, + onNavigationRequest: (NavigationRequest request) { + if (request.url.startsWith('https://www.youtube.com/')) { + return NavigationDecision.prevent; + } + return NavigationDecision.navigate; + }, + ), + ) + ..loadRequest(Uri.parse(widget.selectedUrl)); + } + + @override + Widget build(BuildContext context) { + return AppScaffold(isShowAppBar: true, appBarTitle: widget.title, isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, body: WebViewWidget(controller: _controller) + // WebView( + // initialUrl: widget.selectedUrl, + // javascriptMode: JavascriptMode.unrestricted, + // onWebViewCreated: (WebViewController webViewController) { + // _controller.complete(webViewController); + // }, + ); } } diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 20cfd88f..edf3d0e5 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -290,7 +290,6 @@ class ConfirmPaymentPage extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - print(res); navigateToHome(AppGlobal.context); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); diff --git a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart index 2be812d6..40ef3240 100644 --- a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +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/widgets/buttons/secondary_button.dart'; @@ -350,11 +351,11 @@ class _ConfirmSMSDialogState extends State { ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), ); } diff --git a/lib/pages/Blood/new_text_Field.dart b/lib/pages/Blood/new_text_Field.dart index e6431f1f..61a97eb8 100644 --- a/lib/pages/Blood/new_text_Field.dart +++ b/lib/pages/Blood/new_text_Field.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -183,7 +184,8 @@ class _NewTextFieldsState extends State { validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + // style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: TextStyle(color: Colors.black, letterSpacing: 0.6, fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ FilteringTextInputFormatter.digitsOnly, @@ -193,8 +195,8 @@ class _NewTextFieldsState extends State { decoration: InputDecoration( labelText: widget.hintText, labelStyle: TextStyle(color: Colors.black), - errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), + errorBorder: OutlineInputBorder(borderSide: BorderSide(color: CustomColors.accentColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: CustomColors.accentColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index b2ccf085..b075d013 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -316,6 +316,7 @@ class _BookConfirmState extends State { } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 9c448fd6..61bcb977 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -711,6 +711,7 @@ class _BookSuccessState extends State { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 747dcb92..849a0afc 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,6 +1,8 @@ import "dart:collection"; +import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -73,7 +75,7 @@ class _SearchByClinicState extends State { super.initState(); } - void checkPVM(){ + void checkPVM() { if (context.read().isLogin) { if (radioValue == null) { if (context.read().user.gender == 1) { @@ -89,7 +91,6 @@ class _SearchByClinicState extends State { ageController.text = context.read().isLogin ? context.read().user!.age.toString() : ""; ageController.selection = TextSelection.fromPosition(TextPosition(offset: ageController.text.length)); } - } @override @@ -209,7 +210,18 @@ class _SearchByClinicState extends State { }); }, ), - Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)), + AutoSizeText( + TranslationBase.of(context).nearestAppo.trim(), + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.4, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), + ), + // Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)), ], ), ), @@ -327,7 +339,18 @@ class _SearchByClinicState extends State { items: projectsList.map((HospitalsModel item) { return DropdownMenuItem( value: item, - child: Text('${item.name!}'), + child: AutoSizeText( + item.name!, + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.6, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), + ), + // Text('${item.name!}'), ); }).toList(), onChanged: (HospitalsModel? newValue) async { @@ -650,7 +673,7 @@ class _SearchByClinicState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err, localContext: context); }); } diff --git a/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart b/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart index c68db13a..ecbe1003 100644 --- a/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart +++ b/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart @@ -1,4 +1,7 @@ +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -79,7 +82,7 @@ class _ClickListDialogState extends State { }, decoration: InputDecoration( hintStyle: TextStyle(fontSize: 17), - hintText: 'Search Clinic', + hintText: TranslationBase.of(context).searchClinic, suffixIcon: Icon(Icons.search), border: InputBorder.none, contentPadding: EdgeInsets.all(12), @@ -99,7 +102,19 @@ class _ClickListDialogState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded(child: Text(tempClinicsList[index].clinicDescription!.trim())), + Expanded( + child: AutoSizeText( + tempClinicsList[index].clinicDescription!.trim(), + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.4, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), + ), + ), tempClinicsList[index].isLiveCareClinicAndOnline! ? SvgPicture.asset( 'assets/images/new-design/video_icon_green_right.svg', diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 42c5f052..3e27f9ba 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -36,7 +36,7 @@ class DoctorView extends StatefulWidget { DoctorView( {required this.doctor, - this.isLiveCareAppointment, + this.isLiveCareAppointment, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, this.isContinueDentalPlan = false, @@ -50,7 +50,6 @@ class DoctorView extends StatefulWidget { } class _DoctorViewState extends State with AutomaticKeepAliveClientMixin { - late ProjectViewModel projectViewModel; @override @@ -99,10 +98,12 @@ class _DoctorViewState extends State with AutomaticKeepAliveClientMi style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), - widget.isShowDate ? Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctor.date)), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ) : Container(), + widget.isShowDate + ? Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctor.date)), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ) + : Container(), ], ), if (widget.doctor.doctorTitle != null) SizedBox(height: 6), @@ -123,12 +124,20 @@ class _DoctorViewState extends State with AutomaticKeepAliveClientMi children: [ if (widget.doctor.clinicName != null) MyRichText(TranslationBase.of(context).clinic + ":", widget.doctor.clinicName!, context.read().isArabic), if (widget.doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, widget.doctor.projectName!, context.read().isArabic), - if (widget.doctor.speciality != null && widget.doctor.speciality!.length > 0) - Text( - this.widget.doctor.speciality![0].trim(), - // getDoctorSpeciality(this.doctor.speciality).trim(), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), - ), + if (!projectViewModel.isArabic) + if (widget.doctor.speciality != null && widget.doctor.speciality!.length > 0) + Text( + this.widget.doctor.speciality![0].trim(), + // getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), + if (projectViewModel.isArabic) + if (widget.doctor.specialityN != null && widget.doctor.specialityN!.length > 0) + Text( + this.widget.doctor.specialityN![0].trim(), + // getDoctorSpeciality(this.doctor.speciality).trim(), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), + ), if (widget.doctor.nearestFreeSlot != null) Text( getDate(widget.doctor.nearestFreeSlot), @@ -147,9 +156,18 @@ class _DoctorViewState extends State with AutomaticKeepAliveClientMi itemSize: 20, ignoreGestures: true, ratingWidget: RatingWidget( - full: Icon(Icons.star, color: CustomColors.accentColor,), - half: Icon(Icons.star_half, color: CustomColors.accentColor,), - empty: Icon(Icons.star, color: CustomColors.accentColor,), + full: Icon( + Icons.star, + color: CustomColors.accentColor, + ), + half: Icon( + Icons.star_half, + color: CustomColors.accentColor, + ), + empty: Icon( + Icons.star, + color: CustomColors.accentColor, + ), ), tapOnlyMode: true, itemPadding: EdgeInsets.symmetric(horizontal: 4.0), @@ -267,8 +285,14 @@ class _DoctorViewState extends State with AutomaticKeepAliveClientMi } void next(BuildContext context) { - Navigator.push(context, - FadePage(page: ObGyneTimeSlots(projectID: widget.doctor.projectID!, selectedClinicID: widget.doctor.clinicID!, selectedDoctorID: widget.doctor.doctorID!, obGyneProcedureListResponse: widget.obGyneProcedureListResponse!))); + Navigator.push( + context, + FadePage( + page: ObGyneTimeSlots( + projectID: widget.doctor.projectID!, + selectedClinicID: widget.doctor.clinicID!, + selectedDoctorID: widget.doctor.doctorID!, + obGyneProcedureListResponse: widget.obGyneProcedureListResponse!))); } Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo, bool isContinueDentalPlan = false}) async { diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index a9a2af78..384b2422 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -420,7 +420,6 @@ class _CovidPaymentSummaryState extends State { addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID) { DoctorsListService service = new DoctorsListService(); service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) { - print(res); getAppoQR(context); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index c279a9ab..d2bd25c3 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -405,6 +405,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid Widget _appointmentExpandableList(List _patientAppointmentList) { return ListView.separated( + addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index a7747ceb..4a863890 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1024,6 +1024,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } @@ -1493,6 +1494,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index ebe6e67b..6fe004fc 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -22,8 +22,7 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; -import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' - as family; +import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; @@ -76,8 +75,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); - AppointmentRateViewModel appointmentRateViewModel = - locator(); + AppointmentRateViewModel appointmentRateViewModel = locator(); int currentTab = 0; late PageController pageController; @@ -94,8 +92,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { bool _showBottomNavigationBar = true; ///inject the user data - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final authService = new AuthProvider(); @@ -122,22 +119,17 @@ class _LandingPageState extends State with WidgetsBindingObserver { "appointmentdate": "2022-01-19", "appointmenttime": "12:10", "PatientName": "Testing", - "session_id": - "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", + "session_id": "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", "token": "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9OGMyY2IyYWFiZmZmMzI4ZmEwMjgxNDdmMGFhZGI0N2JiZjdmZWY4MjpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTBOekkxTmpZeE5ESTJPWDV5U1hobFZqWmphbTEzUkZkTVZtZGxlV1ZzU0RoelFreC1mZyZjcmVhdGVfdGltZT0xNjQ3MjU2NjE0Jm5vbmNlPTAuMjgzNDgyNjM1NDczNjQ2OCZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjQ3MjU4NDE0JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", - "DoctorImageURL": - "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", + "DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", "callerID": "9920", "PatientID": "1231755", "is_call": "true" }; void _requestIOSPermissions() { - flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - IOSFlutterLocalNotificationsPlugin>() - ?.requestPermissions( + flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions( alert: true, badge: true, sound: true, @@ -153,8 +145,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { return Future.value(false); } else { DateTime now = DateTime.now(); - if (currentBackPressTime == null || - now.difference(currentBackPressTime!) > Duration(seconds: 2)) { + if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) { currentBackPressTime = now; AppToast.showToast(message: TranslationBase.of(context).pressAgain); return Future.value(false); @@ -169,18 +160,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { List imagesInfo = []; imagesInfo.add( ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), ); imagesInfo.add( ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), ); Navigator.push( @@ -199,11 +186,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { } if (tab == 4) { List imagesInfo = []; - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); + imagesInfo.add( + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); Navigator.push( context, @@ -248,8 +232,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { }); }); - projectViewModel.analytics.bottomTabNavigation - .log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); + projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); } getToDoCount() { @@ -260,11 +243,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); - toDoProvider.setState( - res['AppointmentActiveNumber'], - res['AncillaryOrderListCount'], - true, - toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -303,10 +282,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { - int languageID = - Provider.of(context, listen: false).isArabic - ? 1 - : 2; + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; familyFileProvider.getSharedRecordByStatus(languageID); } // Future.delayed(Duration(seconds: 3)).then((result) async { @@ -322,31 +298,34 @@ class _LandingPageState extends State with WidgetsBindingObserver { // HMGNetworkConnectivity(context).start(); _firebaseMessaging.getToken().then((String? token) { - print("Firebase Token: " + token!); - sharedPref.setString(PUSH_TOKEN, token!); - if (Platform.isIOS) { - FirebaseMessaging.instance.getAPNSToken().then((value) { - print("Push APNS getToken: " + value!); - AppSharedPreferences().setString(APNS_TOKEN, value); - AppSharedPreferences().setString(ONESIGNAL_APNS_TOKEN, value); - }); - // voIPKit.getVoIPToken().then((value) { - // print('🎈 example: getVoIPToken: $value'); - // AppSharedPreferences().setString(APNS_TOKEN, value!); - // // getOneSignalVOIPToken(value); - // }); - } + // print("Firebase Token: " + token!); + sharedPref.setString(PUSH_TOKEN, token!); + if (Platform.isIOS) { + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value!); + AppSharedPreferences().setString(APNS_TOKEN, value); + AppSharedPreferences().setString(ONESIGNAL_APNS_TOKEN, value); + }); + // voIPKit.getVoIPToken().then((value) { + // print('🎈 example: getVoIPToken: $value'); + // AppSharedPreferences().setString(APNS_TOKEN, value!); + // // getOneSignalVOIPToken(value); + // }); + } if (token != null) { DEVICE_TOKEN = token; if (!projectViewModel.isLoginChild) { checkUserStatus(token); } } + }).catchError((err) { + print(err); }); startZoom(); // HMG_Geofencing(context).loadZones().then((instance) => instance.init()); } - void startZoom(){ + + void startZoom() { var zoom = ZoomVideoSdk(); InitConfig initConfig = InitConfig( domain: "zoom.us", @@ -476,20 +455,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { getNotificationCount(token) async { if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { authService.getDashboard().then((value) => { if (value != null) { setState(() { - notificationCount = value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] > - 99 - ? '99+' - : value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] - .toString(); + notificationCount = + value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) @@ -519,11 +492,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { getText(currentTab).toUpperCase(), style: TextStyle( fontWeight: FontWeight.bold, - color: currentTab == 0 - ? CustomColors.backgroudGreyColor - : Theme.of(context).textTheme.headline1!.color, - fontFamily: - projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + color: currentTab == 0 ? CustomColors.backgroudGreyColor : CustomColors.accentColor, + // : Theme.of(context).textTheme.headline1!.color, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // bold: true, ), leading: Builder( @@ -532,14 +503,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { children: [ currentTab == 0 ? IconButton( - icon: SvgPicture.asset( - "assets/images/new/menu.svg"), - color: Theme.of(context) - .textTheme - .headline1! - .color, - onPressed: () => - Scaffold.of(context).openDrawer(), + icon: SvgPicture.asset("assets/images/new/menu.svg"), + // color: Theme.of(context).textTheme.headline1!.color, + color: CustomColors.white, + onPressed: () => Scaffold.of(context).openDrawer(), ) : IconButton( icon: Icon(Icons.arrow_back), @@ -550,9 +517,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(0); }, ), - projectViewModel.isLogin && - model.notificationsCount != null && - !projectViewModel.isLoginChild + projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild ? Positioned( right: projectViewModel.isArabic ? 35 : 0, top: 5, @@ -570,8 +535,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { model.notificationsCount.toString(), style: TextStyle( color: Colors.white, - fontSize: - projectViewModel.isArabic ? 8 : 9, + fontSize: projectViewModel.isArabic ? 8 : 9, ), textAlign: TextAlign.center, ), @@ -655,16 +619,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { index: currentTab, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: - (projectViewModel.havePrivilege(34) && currentTab == 0) - ? FloatingButton( - elevation: true, - onTap: () { - changeCurrentTab(2); - projectViewModel.analytics.appointment.book_appointment(); - }, - ) - : null); + floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) + ? FloatingButton( + elevation: true, + onTap: () { + changeCurrentTab(2); + projectViewModel.analytics.appointment.book_appointment(); + }, + ) + : null); } triggerRobot() { @@ -692,22 +655,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { await PushNotificationHandler.getInstance().requestPermissions(); // authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService - .registeredAuthenticatedUser(data, token, 0, 0) - .then((res) => {}); + authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); authService.getDashboard().then((value) async { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] > - 99 - ? '99+' - : value['List_PatientDashboard'][0] - ['UnreadPatientNotificationCount'] - .toString(); + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index b6c0561d..a1bb6cb1 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -2,6 +2,8 @@ import 'dart:io'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; @@ -13,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.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:flutter_svg/flutter_svg.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -282,53 +285,87 @@ class _LiveCarePatmentPageState extends State { Container( padding: EdgeInsets.all(12), color: Colors.white, - child: Flex( - direction: Axis.horizontal, - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).cancel, - () { - if (widget.isPharmaLiveCare) cancelAPI(); - Navigator.pop(context, false); - }, - ), - ), - mWidth(12), - Expanded( - child: DefaultButton( - TranslationBase.of(context).next, - () { - if (_selected == 0) { - AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); - } else { - if (widget.isPharmaLiveCare) { - Navigator.pop(context, true); - } else { - askVideoCallPermission().then((value) async { - if (value == true) { - locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); - locationUtils.getCurrentLocation(callBack: (value) { - print(value); - }); - if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { - await drawOverAppsMessageDialog(context).then((value) { - return false; - }); - } else { - Navigator.pop(context, true); - projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); - } + child: Column( + children: [ + Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).cancel, + () { + if (widget.isPharmaLiveCare) cancelAPI(); + Navigator.pop(context, false); + }, + ), + ), + mWidth(12), + Expanded( + child: DefaultButton( + TranslationBase.of(context).next, + () { + if (_selected == 0) { + AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); + } else { + if (widget.isPharmaLiveCare) { + Navigator.pop(context, true); } else { - openPermissionsDialog(); + askVideoCallPermission().then((value) async { + if (value == true) { + locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); + locationUtils.getCurrentLocation(callBack: (value) { + print(value); + }); + if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { + await drawOverAppsMessageDialog(context).then((value) { + return false; + }); + } else { + Navigator.pop(context, true); + projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); + } + } else { + openPermissionsDialog(); + } + }); } - }); - } - } - }, - color: CustomColors.green, - ), + } + }, + color: CustomColors.green, + ), + ), + ], ), + widget.getERAppointmentFeesList.isCash! + ? Column( + children: [ + mHeight(10.0), + Text( + TranslationBase.of(context).cashAmountUpdateInsurance, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + ), + ), + mHeight(5.0), + DefaultButton( + TranslationBase.of(context).updateInsuranceText, + () { + Navigator.pop(context, null); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + color: Color(0xffEAA118), + textColor: Colors.white, + ), + ], + ) + : Container(), ], ), ), diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 4c14eeb2..6381ce8a 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -171,7 +171,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt }); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err, localContext: context); print(err); }); } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 0ab1e1c6..44ad58b0 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart'; @@ -196,11 +197,39 @@ class _clinic_listState extends State { getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { int languageID = projectViewModel.isArabic ? 1 : 2; + String errorMsg = ""; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); + + // getERAppointmentFeesList.isCash = false; + // getERAppointmentFeesList.isInsured = true; + // getERAppointmentFeesList.isEligible = false; + + if (getERAppointmentFeesList.isCash!) { + showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); + } else { + if (getERAppointmentFeesList.isInsured! && getERAppointmentFeesList.isEligible!) { + showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); + } else { + if (getERAppointmentFeesList.isInsured! && !getERAppointmentFeesList.isEligible!) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: TranslationBase.of(context).updateInsuranceText, + cancelText: TranslationBase.of(context).continueCash, + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash()}); + dialog.showAlertDialog(context); + } + } + // showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -208,6 +237,28 @@ class _clinic_listState extends State { }); } + void continueAsCash() { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.convertPatientToCash(BASE_URL.contains("uat.") ? 15 : 12).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res["MessageStatus"] == 1) { + startLiveCare(); + } else { + AppToast.showErrorToast(message: res["ErrorEndUserMessage"]); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + void openUpdateInsurance() { + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + } + showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { navigateTo( context, @@ -413,28 +464,28 @@ class _clinic_listState extends State { service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async { if (res["MessageStatus"] == 1) { await localContext!.read().initiateApplePayWithPayfort( - customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, - // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, - customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", - orderDescription: "LiveCare Payment", - orderAmount: double.parse(amount), - merchantReference: transID, - payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, - currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", - onFailed: (failureResult) async { - log("failureResult: ${failureResult.toString()}"); - GifLoaderDialogUtils.hideDialog(localContext!); - AppToast.showErrorToast(message: failureResult.toString()); - }, - onSuccess: (successResult) async { - GifLoaderDialogUtils.hideDialog(localContext!); - log("Payfort: ${successResult.responseMessage}"); - await localContext!.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); - checkPaymentStatus(appo); - }, - projectId: appo.projectID, - serviceTypeEnum: ServiceTypeEnum.appointmentPayment, - ); + customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com", + orderDescription: "LiveCare Payment", + orderAmount: double.parse(amount), + merchantReference: transID, + payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, + currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR", + onFailed: (failureResult) async { + log("failureResult: ${failureResult.toString()}"); + GifLoaderDialogUtils.hideDialog(localContext!); + AppToast.showErrorToast(message: failureResult.toString()); + }, + onSuccess: (successResult) async { + GifLoaderDialogUtils.hideDialog(localContext!); + log("Payfort: ${successResult.responseMessage}"); + await localContext!.read().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult); + checkPaymentStatus(appo); + }, + projectId: appo.projectID, + serviceTypeEnum: ServiceTypeEnum.appointmentPayment, + ); } else { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: "An error occurred while processing your request"); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 608943ac..f984d093 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -41,7 +41,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; -import 'package:local_auth_ios/types/auth_messages_ios.dart'; +// import 'package:local_auth_ios/types/auth_messages_ios.dart'; class ConfirmLogin extends StatefulWidget { final Function? changePageViewIndex; @@ -552,11 +552,11 @@ class _ConfirmLogin extends State { stickyAuth: true, ), authMessages: [ - IOSAuthMessages( - cancelButton: 'cancel', - goToSettingsButton: 'settings', - goToSettingsDescription: 'Please set up your Touch ID.', - lockOut: 'Please reenable your Touch ID'), + // IOSAuthMessages( + // cancelButton: 'cancel', + // goToSettingsButton: 'settings', + // goToSettingsDescription: 'Please set up your Touch ID.', + // lockOut: 'Please reenable your Touch ID'), ], ); } on PlatformException catch (e) { diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index 7207e602..529d0b8f 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -1,4 +1,6 @@ +import 'package:cloudflare_turnstile/cloudflare_turnstile.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; @@ -27,6 +29,23 @@ class _ForgotPassword extends State { String mobileNo = ""; var con; + final TurnstileController _controller = TurnstileController(); + final TurnstileOptions _options = TurnstileOptions( + size: TurnstileSize.normal, + theme: TurnstileTheme.light, + refreshExpired: TurnstileRefreshExpired.manual, + language: 'en', + retryAutomatically: false, + ); + + String? _token; + + @override + void dispose() { + super.dispose(); + _controller.dispose(); + } + @override Widget build(BuildContext context) { con = context; @@ -66,6 +85,25 @@ class _ForgotPassword extends State { countryCode = value; }); }), + const SizedBox(height: 12.0), + CloudFlareTurnstile( + siteKey: '0x4AAAAAAAkmbvEy63pcxBBt', + baseUrl: BASE_URL, + options: _options, + controller: _controller, + onTokenRecived: (token) { + setState(() { + print("Cloudflare token: $token"); + _token = token; + }); + }, + onTokenExpired: () {}, + mode: TurnstileMode.managed, + errorBuilder: (context, error) { + return Text(error.message); + }, + ), + const SizedBox(height: 48.0), ], ), ), diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index e2b7db20..cbff3f9b 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -450,7 +450,7 @@ class _RegisterInfo extends State { else request = getTempUserRequest(); - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false); dynamic res; this .authService @@ -480,7 +480,7 @@ class _RegisterInfo extends State { sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, - sharedPref.setString(BLOOD_TYPE, result.patientBloodType), + sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? ""), authenticatedUserObject.user = result.list, projectViewModel.setPrivilege(privilegeList: res), sharedPref.setObject(MAIN_USER, result.list), diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 1081ef52..ab032541 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -40,6 +40,7 @@ class AskDoctorPage extends StatelessWidget { Widget _appointmentExpandableList(List _patientDoctorAppointmentList, model) { return ListView.separated( + addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 8b567556..da9570f2 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -329,6 +329,7 @@ class _ConfirmPaymentPageState extends State { payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", onFailed: (failureResult) async { + GifLoaderDialogUtils.hideDialog(context); log("failureResult: ${failureResult.toString()}"); AppToast.showErrorToast(message: failureResult.toString()); }, @@ -528,7 +529,6 @@ class _ConfirmPaymentPageState extends State { addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { - print(res); GifLoaderDialogUtils.hideDialog(AppGlobal.context); navigateToHome(AppGlobal.context); }).catchError((err) { diff --git a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart index ce69e8c0..de22c7af 100644 --- a/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/medical/balance/dialogs/ConfirmSMSDialog.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +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/widgets/buttons/secondary_button.dart'; @@ -363,11 +364,11 @@ class _ConfirmSMSDialogState extends State { ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(5.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), ); } diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart index b00e4274..fb9d8bed 100644 --- a/lib/pages/medical/balance/new_text_Field.dart +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -184,7 +185,8 @@ class _NewTextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + // style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: TextStyle(color: Colors.black, letterSpacing: 0.6, fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ FilteringTextInputFormatter.digitsOnly, @@ -194,9 +196,9 @@ class _NewTextFieldsState extends State { decoration: InputDecoration( labelText: widget.hintText, counterText: widget.counterText, - labelStyle: TextStyle(color: Theme.of(context).textTheme.bodyText1!.color), - errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder(borderSide: BorderSide(color: CustomColors.accentColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: CustomColors.accentColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)), focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)), enabledBorder: OutlineInputBorder( diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 698e34d5..69f4b10e 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -53,6 +53,7 @@ class _LaboratoryResultPageState extends State { child: Column( children: [ ListView.builder( + addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), shrinkWrap: true, padding: EdgeInsets.only(bottom: 12), diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index b78617f3..7998b558 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -17,7 +17,7 @@ import 'package:provider/provider.dart'; import 'laboratory_result_page.dart'; class LabsHomePage extends StatelessWidget { - List imagesInfo =[]; + List imagesInfo = []; @override Widget build(BuildContext context) { @@ -50,6 +50,7 @@ class LabsHomePage extends StatelessWidget { child: FractionallySizedBox( widthFactor: 1.0, child: ListView.separated( + addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 0c24c66f..e550e1b0 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -26,6 +26,7 @@ class PrescriptionsPage extends StatelessWidget { return AppScaffold( baseViewModel: prescriptionsViewModel, body: ListView.separated( + addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 09e443e5..fb60d5da 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -54,6 +54,7 @@ class RadiologyHomePage extends StatelessWidget { child: FractionallySizedBox( widthFactor: 1.0, child: ListView.separated( + addAutomaticKeepAlives: true, physics: BouncingScrollPhysics(), padding: EdgeInsets.only(top: 12), separatorBuilder: (context, index) { diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 1878a658..1255e8cb 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -71,9 +71,9 @@ class PaymentService extends StatelessWidget { projectViewModel!.analytics.advancePayments.payment_services(service_type: 'payment service'); }, child: MedicalProfileItem( - title: TranslationBase.of(context).payment, + title: TranslationBase.of(context).onlinePayment, imagePath: 'assets/images/new-design/online_payment_icon.png', - subTitle: TranslationBase.of(context).paymentOnline, + subTitle: TranslationBase.of(context).onlinePaymentSubtitle, isPngImage: true, width: 65.0, height: 55.0, @@ -182,19 +182,24 @@ class PaymentService extends StatelessWidget { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service - .getInPatientAdvancePaymentRequests(projectViewModel.inPatientProjectID, projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo! : 0, - projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo! : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo!, context) + .getInPatientAdvancePaymentRequests( + projectViewModel.inPatientProjectID, + projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionNo! : 0, + projectViewModel.isPatientAdmitted ? projectViewModel.getAdmissionInfoResponseModel.admissionRequestNo! : projectViewModel.getAdmissionRequestInfoResponseModel.admissionRequestNo!, + context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["MessageStatus"] == 1) { if (res['responseInpatient'] != null) { inPatientAdvanceResponseModel = InPatientAdvanceResponseModel.fromJson(res["responseInpatient"]); - Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); + Navigator.push(context, + FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); } else { AppToast.showErrorToast(message: TranslationBase.of(context).noData); } } else { - Navigator.push(context, FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); + Navigator.push(context, + FadePage(page: InPatientAdvancePayment(isHasData: inPatientAdvanceResponseModel.responseInpatientAdvanceInfo != null, inPatientAdvanceResponseModel: inPatientAdvanceResponseModel))); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 3f61f3e9..44484373 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -95,7 +95,7 @@ class _RateAppointmentClinicState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - MyRichText(TranslationBase.of(context).clinic + ":", model.appointmentDetails.projectName, projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).clinic + ":", model.appointmentDetails.projectName ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).date + ":", DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)), projectViewModel.isArabic), ], diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 82e52ae7..dc494a61 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -52,7 +52,7 @@ class ClinicListService extends BaseService { Future getProjectsList(int languageID, context) async { Map request = {}; - request = {"LanguageID": languageID}; + // request = {"LanguageID": languageID}; dynamic localRes; diff --git a/lib/services/payfort_services/payfort_service.dart b/lib/services/payfort_services/payfort_service.dart index 469a5d5c..64a015cd 100644 --- a/lib/services/payfort_services/payfort_service.dart +++ b/lib/services/payfort_services/payfort_service.dart @@ -161,7 +161,7 @@ class PayfortService extends BaseService { ); if (sdkTokenResponse != null && sdkTokenResponse.sdkToken == null) { - onFailed!(sdkTokenResponse.responseMessage ?? ''); + onFailed!((sdkTokenResponse.responseMessage ?? '') as PayFortFailureResult); return; } @@ -176,6 +176,7 @@ class PayfortService extends BaseService { merchantReference: merchantReference!, currency: currency, customerIp: (await _info.getWifiIP() ?? ''), + language: 'en' ); _payfort.callPayFortForApplePay( @@ -188,7 +189,7 @@ class PayfortService extends BaseService { ), ); } catch (e) { - onFailed!(e.toString()); + onFailed!(e.toString() as PayFortFailureResult); } } } diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index 5cf871ab..4fd06d9c 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -27,22 +27,22 @@ defaultTheme({fontName}) { ), hintColor: Colors.grey[400], disabledColor: Colors.grey[300], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffF8F8F8), canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff515A5D), - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)), - primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)), + // primaryTextTheme: TextTheme(bodyText2: TextStyle(color: Colors.white)), iconTheme: IconThemeData(), textTheme: TextTheme( - bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6), - headline1: TextStyle(color: Colors.white, letterSpacing: 0.6), - headline2: TextStyle(color: Colors.white, letterSpacing: 0.6), + // bodyText1: TextStyle(color: Colors.black, letterSpacing: 0.6), + // headline1: TextStyle(color: Colors.white, letterSpacing: 0.6), + // headline2: TextStyle(color: Colors.white, letterSpacing: 0.6), ), floatingActionButtonTheme: FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), @@ -71,16 +71,16 @@ invertThemes({fontName}) { }, ), hintColor: Colors.grey[400], - textTheme: TextTheme(bodyText1: TextStyle(color: Colors.white), headline1: TextStyle(color: Colors.white), headline2: TextStyle(color: Colors.white)), + // textTheme: TextTheme(bodyText1: TextStyle(color: Colors.white), headline1: TextStyle(color: Colors.white), headline2: TextStyle(color: Colors.white)), disabledColor: Colors.grey[800], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xff000000), canvasColor: Colors.black, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff515A5D), - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)), iconTheme: IconThemeData(), @@ -113,24 +113,24 @@ bwThemes({fontName}) { hintColor: Colors.grey[400], textTheme: TextTheme( - bodyText1: TextStyle(color: Colors.red[900]), - headline1: TextStyle(color: Colors.red[900]), - headline2: TextStyle(color: Colors.white), - bodyText2: TextStyle(color: Colors.red[900]), - subtitle1: TextStyle(color: Colors.red[900]), + // bodyText1: TextStyle(color: Colors.red[900]), + // headline1: TextStyle(color: Colors.red[900]), + // headline2: TextStyle(color: Colors.white), + // bodyText2: TextStyle(color: Colors.red[900]), + // subtitle1: TextStyle(color: Colors.red[900]), ), tabBarTheme: TabBarTheme(labelColor: Colors.red[900]), disabledColor: Colors.grey[800], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffffffe4), canvasColor: Colors.black, - backgroundColor: Color(0xffffffe4), + // backgroundColor: Color(0xffffffe4), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xfffffff4), - toggleableActiveColor: secondaryColor, + // toggleableActiveColor: secondaryColor, indicatorColor: secondaryColor, bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xFFE0E0E0)), iconTheme: IconThemeData(), @@ -160,10 +160,10 @@ dimTheme({fontName}) { ), hintColor: Colors.grey[400], disabledColor: Colors.grey[300], - errorColor: Color.fromRGBO(235, 80, 60, 1.0), + // errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffEEEEEE), canvasColor: Colors.white, - backgroundColor: Color.fromRGBO(255, 255, 255, 1), + // backgroundColor: Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, primaryColor: Color(0xff40ACC9), diff --git a/lib/uitl/app_shared_preferences.dart b/lib/uitl/app_shared_preferences.dart index 2d5fa774..4ecd1b91 100644 --- a/lib/uitl/app_shared_preferences.dart +++ b/lib/uitl/app_shared_preferences.dart @@ -76,7 +76,8 @@ class AppSharedPreferences { final SharedPreferences prefs = await _prefs; await prefs.reload(); String value = prefs.getString(key).toString(); - return value == null ? defaultVal : value; + return (value == null) || (value == "null") ? defaultVal : value; + // return value == null ? defaultVal : value; } /// Get List of String [key] the key was saved diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index ecf09b28..5bf073b3 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -357,6 +357,8 @@ class PushNotificationHandler { FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String? token) { print("Push Notification getToken: " + token!); onToken(token!); + }).catchError((err) { + print(err); }); FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) { @@ -430,7 +432,7 @@ class PushNotificationHandler { } onToken(String token) async { - print("Push Notification Token: " + token); + // print("Push Notification Token: " + token); await AppSharedPreferences().setString(PUSH_TOKEN, token); DEVICE_TOKEN = token; } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 18cf8bae..59604293 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2964,6 +2964,7 @@ class TranslationBase { String get wecare => localizedValues["wecare"][locale.languageCode]; String get myinstructions => localizedValues["myinstructions"][locale.languageCode]; String get clinicLocation => localizedValues["clinicLocation"][locale.languageCode]; + String get searchClinic => localizedValues["searchClinic"][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 42b25b55..01779851 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -831,7 +831,8 @@ class Utils { children: [ SizedBox(height: 12), Text( - isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, + // isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, + text, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), diff --git a/lib/widgets/LoadingButton.dart b/lib/widgets/LoadingButton.dart index 8f94cdde..6a497198 100644 --- a/lib/widgets/LoadingButton.dart +++ b/lib/widgets/LoadingButton.dart @@ -138,14 +138,15 @@ class _AnimatedButtonState extends State /// sets width and size animation void _updateWidth() { final theme = Theme.of(context); - final fontSize = theme.textTheme.button!.fontSize; + // final fontSize = theme.textTheme.button!.fontSize; + final fontSize = 12.0; final renderParagraph = RenderParagraph( TextSpan( text: widget.text, style: TextStyle( fontSize: fontSize, - fontWeight: theme.textTheme.button!.fontWeight, - letterSpacing: theme.textTheme.button!.letterSpacing, + fontWeight: FontWeight.normal, + letterSpacing: 0.6, ), ), textDirection: TextDirection.ltr, diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index 3a49f3d8..135a9731 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -122,7 +123,7 @@ class _BottomSheet extends StatelessWidget { Widget build(BuildContext context) { return Container( padding: EdgeInsets.symmetric(vertical: 12.0), - decoration: BoxDecoration(color: Theme.of(context).backgroundColor, borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), topRight: Radius.circular(16.0))), child: SafeArea( top: false, child: Column( @@ -165,14 +166,14 @@ class _BottomSheetItem extends StatelessWidget { if (icon != null) Icon( icon, - color: color == ITEM_COLOR.error ? Theme.of(context).errorColor : Theme.of(context).primaryColor, + color: color == ITEM_COLOR.error ? CustomColors.accentColor : Theme.of(context).primaryColor, size: 18.0, ), if (icon != null) SizedBox(width: 24.0), Texts( title ?? "", style: "bodyText2", - color: color == ITEM_COLOR.error ? Theme.of(context).errorColor : null, + color: color == ITEM_COLOR.error ? CustomColors.accentColor : null, ), ], ), diff --git a/lib/widgets/buttons/BottomButton.dart b/lib/widgets/buttons/BottomButton.dart index f4aafdb4..1746ee13 100644 --- a/lib/widgets/buttons/BottomButton.dart +++ b/lib/widgets/buttons/BottomButton.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; @@ -23,18 +24,7 @@ class BottomButton extends StatelessWidget { final Widget? child; final bool disabledPadding; - BottomButton( - {Key? key, - this.loading = false, - this.disabled = false, - this.label, - this.icon, - this.color, - this.textColor, - this.disabledPadding = false, - this.borderColor, - this.onTap, - this.child}) + BottomButton({Key? key, this.loading = false, this.disabled = false, this.label, this.icon, this.color, this.textColor, this.disabledPadding = false, this.borderColor, this.onTap, this.child}) : super(key: key); @override @@ -44,17 +34,7 @@ class BottomButton extends StatelessWidget { children: [ Container( decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - stops: [ - 0.0, - 0.9 - ], - colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0) - ]), + gradient: LinearGradient(begin: Alignment.bottomCenter, end: Alignment.topCenter, stops: [0.0, 0.9], colors: [CustomColors.white, CustomColors.white.withOpacity(0)]), ), alignment: Alignment.center, child: SafeArea( @@ -63,46 +43,19 @@ class BottomButton extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Container( - margin: child != null - ? EdgeInsets.only( - left: 14.0, right: 14.0, top: 14.0, bottom: 14) - : EdgeInsets.only( - left: 30.0, right: 30.0, top: 14.0, bottom: 14), + margin: child != null ? EdgeInsets.only(left: 14.0, right: 14.0, top: 14.0, bottom: 14) : EdgeInsets.only(left: 30.0, right: 30.0, top: 14.0, bottom: 14), decoration: BoxDecoration( - color: child != null - ? Theme.of(context).backgroundColor - : null, - border: child != null - ? Border.all( - color: Theme.of(context).dividerColor, width: 2.0) - : Border.all(color: Colors.transparent, width: 0.0), - borderRadius: child != null - ? BorderRadius.circular(16.0) - : BorderRadius.circular(0.0), - boxShadow: child != null - ? [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.04), - spreadRadius: -0.0, - offset: Offset(0, 4.0), - blurRadius: 18.0) - ] - : []), + color: child != null ? CustomColors.white : null, + border: child != null ? Border.all(color: Theme.of(context).dividerColor, width: 2.0) : Border.all(color: Colors.transparent, width: 0.0), + borderRadius: child != null ? BorderRadius.circular(16.0) : BorderRadius.circular(0.0), + boxShadow: child != null ? [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.04), spreadRadius: -0.0, offset: Offset(0, 4.0), blurRadius: 18.0)] : []), child: Column( children: [ if (child != null) Padding( padding: disabledPadding - ? EdgeInsets.only( - left: 0.0, - right: 0.0, - top: 14.0, - bottom: label != null ? 0.0 : 14) - : EdgeInsets.only( - left: 18.0, - right: 18.0, - top: 14.0, - bottom: label != null ? 0.0 : 14), + ? EdgeInsets.only(left: 0.0, right: 0.0, top: 14.0, bottom: label != null ? 0.0 : 14) + : EdgeInsets.only(left: 18.0, right: 18.0, top: 14.0, bottom: label != null ? 0.0 : 14), child: child, ), if (child != null) @@ -114,10 +67,7 @@ class BottomButton extends StatelessWidget { label == null ? SizedBox(height: 50.0) : Padding( - padding: child != null - ? EdgeInsets.only( - bottom: 16.0, left: 16.0, right: 16.0) - : EdgeInsets.zero, + padding: child != null ? EdgeInsets.only(bottom: 16.0, left: 16.0, right: 16.0) : EdgeInsets.zero, child: SecondaryButton( borderColor: borderColor, onTap: () { @@ -135,8 +85,7 @@ class BottomButton extends StatelessWidget { ), if (label == null && child == null) Padding( - padding: EdgeInsets.only( - left: 30.0, right: 30.0, top: 14.0, bottom: 14), + padding: EdgeInsets.only(left: 30.0, right: 30.0, top: 14.0, bottom: 14), ), ], ), diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart index 8f374ca3..63053401 100644 --- a/lib/widgets/data_display/list/flexible_container.dart +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:flutter/material.dart'; /// Flexible container widget /// [widthFactor] If non-null, the fraction of the incoming width given to the child. @@ -33,7 +34,7 @@ class FlexibleContainer extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(8.0), child: Material( - color: Theme.of(context).backgroundColor, + color: CustomColors.white, child: Container( padding: padding, width: double.infinity, diff --git a/lib/widgets/data_display/services)contaniner.dart b/lib/widgets/data_display/services)contaniner.dart index e18507f4..246fad78 100644 --- a/lib/widgets/data_display/services)contaniner.dart +++ b/lib/widgets/data_display/services)contaniner.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; @@ -15,7 +16,8 @@ class ServicesContainer extends StatelessWidget { height: 60, margin: EdgeInsets.all(8), decoration: BoxDecoration( - color: Theme.of(context).textTheme.headline2!.color, + // color: Theme.of(context).textTheme.headline2!.color, + color: CustomColors.white, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 498e5e48..8a5b5954 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -26,30 +27,31 @@ class Texts extends StatefulWidget { final TextDecoration? decoration; final double? heightFactor; - Texts(this.text, - {Key? key, - this.variant, - this.color, - this.bold, - this.regular, - this.medium, - this.allowExpand = true, - this.italic= false, - this.textAlign, - this.maxLength = 60, - this.maxLines, - this.readMore = false, - this.style, - this.fontSize, - this.fontWeight, - this.margin, - this.marginBottom, - this.marginLeft, - this.marginRight, - this.marginTop, - this.decoration, - this.heightFactor,}) - : super(key: key); + Texts( + this.text, { + Key? key, + this.variant, + this.color, + this.bold, + this.regular, + this.medium, + this.allowExpand = true, + this.italic = false, + this.textAlign, + this.maxLength = 60, + this.maxLines, + this.readMore = false, + this.style, + this.fontSize, + this.fontWeight, + this.margin, + this.marginBottom, + this.marginLeft, + this.marginRight, + this.marginTop, + this.decoration, + this.heightFactor, + }) : super(key: key); @override _TextsState createState() => _TextsState(); @@ -172,27 +174,28 @@ class _TextsState extends State { TextStyle? _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.headline2; + // return Theme.of(context).textTheme.headline2; + return TextStyle(color: Colors.white); case "headline3": - return Theme.of(context).textTheme.headline3; + return TextStyle(color: Colors.white); case "headline4": - return Theme.of(context).textTheme.headline4; + return TextStyle(color: Colors.white); case "headline5": - return Theme.of(context).textTheme.headline5; + return TextStyle(color: Colors.white); case "headline6": - return Theme.of(context).textTheme.headline6; + return TextStyle(color: Colors.white); case "bodyText2": - return Theme.of(context).textTheme.bodyText2; + return TextStyle(color: Colors.white); case "bodyText_15": - return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0); + return TextStyle(color: Colors.white, fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyText1; + return TextStyle(color: Colors.white); case "caption": - return Theme.of(context).textTheme.caption; + return TextStyle(color: Colors.white); case "overline": - return Theme.of(context).textTheme.overline; + return TextStyle(color: Colors.white); case "button": - return Theme.of(context).textTheme.button; + return TextStyle(color: Colors.white); default: return TextStyle(); } @@ -205,39 +208,25 @@ class _TextsState extends State { Stack( children: [ Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength! - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null - ? ((widget.maxLines! > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) - : null, + overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null ? _getFontStyle()!.copyWith( fontStyle: widget.italic! ? FontStyle.italic : null, - color: widget.color != null - ? widget.color - : Theme.of(context).textTheme.bodyText1!.color, + color: widget.color != null ? widget.color : Colors.black, fontWeight: widget.fontWeight ?? _getFontWeight(), ) : TextStyle( height: widget.heightFactor, decoration: widget.decoration, fontStyle: widget.italic! ? FontStyle.italic : null, - color: widget.color ?? - Theme.of(context).textTheme.bodyText1!.color, + color: widget.color ?? Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1 : null, fontWeight: widget.fontWeight ?? _getFontWeight(), - fontFamily: - projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), ), if (widget.readMore! && text.length > widget.maxLength! && hidden) Positioned( @@ -247,8 +236,8 @@ class _TextsState extends State { child: Container( decoration: BoxDecoration( gradient: LinearGradient(colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), + CustomColors.white, + CustomColors.white.withOpacity(0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter), ), height: 30.0, @@ -256,9 +245,7 @@ class _TextsState extends State { ) ], ), - if (widget.allowExpand! && - widget.readMore! && - text.length > widget.maxLength!) + if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 1b525e21..0db27626 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,4 +1,5 @@ import 'dart:io' show Platform; +import 'package:auto_size_text/auto_size_text.dart'; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; @@ -144,17 +145,30 @@ class _AppDrawerState extends State { (user != null && projectProvider!.isLogin) ? user!.firstName! + ' ' + user!.lastName! : TranslationBase.of(context).cantSeeProfile, style: TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.bold, fontSize: 20, letterSpacing: -1.2, height: 35 / 20), ), - Text( + AutoSizeText( (user != null && projectProvider!.isLogin) ? TranslationBase.of(context).fileNumber + ": " + user!.patientID.toString() : TranslationBase.of(context).loginRegisterNow, + maxLines: 1, + minFontSize: 10, style: TextStyle( - color: Color(0xff2E303A), - fontSize: 16, - letterSpacing: -0.96, - height: 1, + fontSize: SizeConfig.textMultiplier! * 1.6, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, ), ), + // Text( + // (user != null && projectProvider!.isLogin) + // ? TranslationBase.of(context).fileNumber + ": " + user!.patientID.toString() + // : TranslationBase.of(context).loginRegisterNow, + // style: TextStyle( + // color: Color(0xff2E303A), + // fontSize: 16, + // letterSpacing: -0.96, + // height: 1, + // ), + // ), mHeight(20.0), (user != null && projectProvider!.isLogin) ? Image.network("https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${user!.patientID.toString()}", fit: BoxFit.fill, height: 73.5, width: 73.5) @@ -204,8 +218,8 @@ class _AppDrawerState extends State { child: DrawerItem(TranslationBase.of(context).family, SvgPicture.asset("assets/images/new/family_files.svg"), isImageIcon: true, bottomLine: false, - textColor: Theme.of(context).textTheme.bodyText1!.color, - iconColor: Theme.of(context).textTheme.bodyText1!.color, + textColor: CustomColors.black, + iconColor: CustomColors.black, sideArrow: true, letterSpacing: -0.84, projectProvider: projectProvider), diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index af0d81e9..2af437e4 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -1,7 +1,9 @@ import 'dart:ui'; +import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -52,7 +54,7 @@ class _DrawerItemState extends State { ? widget.icon : Icon( widget.icon, - color: widget.iconColor == null ? Theme.of(context).textTheme.bodyText1?.color : widget.iconColor, + color: widget.iconColor == null ? CustomColors.black : widget.iconColor, size: SizeConfig.imageSizeMultiplier! * 5, )), Expanded( @@ -60,13 +62,24 @@ class _DrawerItemState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ - AppText( + AutoSizeText( widget.title!, - fontWeight: FontWeight.w600, - fontSize: widget.fontSize, - height: widget.fontHeight, - letterSpacing: widget.letterSpacing, + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.6, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), ), + // AppText( + // widget.title!, + // fontWeight: FontWeight.w600, + // fontSize: widget.fontSize, + // height: widget.fontHeight, + // letterSpacing: widget.letterSpacing, + // ), widget.count ?? SizedBox(), ], ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f353eec2..9ffec736 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -38,9 +38,9 @@ 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/PayFortWebLive/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 SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index be6c9989..db467112 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -1,10 +1,10 @@ +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -26,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -63,7 +62,7 @@ class TextFields extends StatefulWidget { this.borderOnlyError = false, this.onSaved, this.onSuffixTap, - this.readOnly= false, + this.readOnly = false, this.maxLength, this.prefixIcon, this.bare = false, @@ -164,19 +163,14 @@ class _TextFieldsState extends State { view = true; }); }, - child: Icon(Icons.remove_red_eye_sharp, - size: 24.0, color: Colors.grey[500]), + child: Icon(Icons.remove_red_eye_sharp, size: 24.0, color: Colors.grey[500]), ), ); default: if (widget.suffixIcon != null) return InkWell( onTap: widget.onSuffixTap, - child: Icon(widget.suffixIcon, - size: 22.0, - color: widget.suffixIconColor != null - ? widget.suffixIconColor - : Colors.grey[500]), + child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500]), ); else return SizedBox(); @@ -203,10 +197,7 @@ class _TextFieldsState extends State { // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // offset: Offset(0.0, 13.0), // blurRadius: focus ? 34.0 : 12.0) - BoxShadow( - color: Color.fromRGBO(110, 68, 80, focus! ? 0.20 : 0), - offset: Offset(0.0, 13.0), - blurRadius: focus! ? 34.0 : 12.0) + BoxShadow(color: Color.fromRGBO(110, 68, 80, focus! ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus! ? 34.0 : 12.0) ]), child: TextFormField( keyboardAppearance: Theme.of(context).brightness, @@ -234,10 +225,11 @@ class _TextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context) - .textTheme - .bodyText1! - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + // style: Theme.of(context) + // .textTheme + // .bodyText1! + // .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: TextStyle(color: Colors.black, letterSpacing: 0.6, fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ FilteringTextInputFormatter.digitsOnly, @@ -252,41 +244,18 @@ class _TextFieldsState extends State { fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), - contentPadding: widget.padding != null - ? widget.padding - : EdgeInsets.symmetric( - vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, - horizontal: 16.0), + contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric(vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, horizontal: 16.0), filled: true, - fillColor: widget.bare! - ? Colors.transparent - : Theme.of(context).backgroundColor, + fillColor: widget.bare! ? Colors.transparent : CustomColors.white, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, - errorStyle: TextStyle( - fontSize: 14.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError! ? 0.0 : null), + errorStyle: TextStyle(fontSize: 14.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError! ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare! ? 0.0 : 0.5), - width: 1.0), - borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), + borderSide: BorderSide(color: CustomColors.accentColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare! ? 0.0 : 0.5), - width: 1.0), - borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), + borderSide: BorderSide(color: CustomColors.accentColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), + focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), + disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0)), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : 8.0), diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 883e2de3..1103b31b 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -494,7 +494,8 @@ class AppBarWidgetState extends State { // headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), // ), title: Text(widget.authenticatedUserObject.isLogin || !widget.isShowDecPage ? widget.appBarTitle!.toUpperCase() : TranslationBase.of(context).serviceInformationTitle, - style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + // style: TextStyle(fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), + style: TextStyle(fontWeight: FontWeight.bold, color: CustomColors.white, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack( diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 063878bb..6389ba00 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -125,207 +125,207 @@ class _NotAutPageState extends State { ), ); - Scaffold( - backgroundColor: Color(0xfff8f8f8), - resizeToAvoidBottomInset: false, - appBar: AppBar( - backgroundColor: Colors.transparent, - leading: IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Color(0xff2B353E), - onPressed: () => Navigator.pop(context), - ), - ), - body: Padding( - padding: EdgeInsets.only(bottom: 20, left: 21, right: 21), - child: Column(children: [ - Expanded( - child: ListView( - padding: EdgeInsets.zero, - physics: BouncingScrollPhysics(), - children: [ - SizedBox(height: 12), - if (widget.icon != null) - Align( - alignment: Alignment.centerLeft, - child: SvgPicture.asset( - widget.icon!, - height: 35, - width: 35, - ), - ), - SizedBox(height: 16), - Text( - widget.title, - style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), - ), - Text( - widget.description!, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), - ), - SizedBox( - height: 14, - ), - if (!projectViewModel.isInternetConnection) - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'), - ), - ), - if (projectViewModel.isInternetConnection && widget.imagesInfo != null) - CarouselSlider( - items: widget.imagesInfo?.map((image) { - return Builder( - builder: (BuildContext context) { - return SizedBox( - width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); - }, - ); - }).toList(), - options: CarouselOptions( - height: MediaQuery.of(context).size.height * 0.55, - autoPlay: widget.imagesInfo!.length > 1, - viewportFraction: 1.0, - ), - ), - ], - ), - ), - SizedBox( - height: 43, - width: double.infinity, - child: TextButton( - onPressed: () { - loginCheck(context); - }, - child: Text( - TranslationBase.of(context).loginregister, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), - ), - style: TextButton.styleFrom( - backgroundColor: Color(0xffD02127), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), - )), - ), - ]), - ), - ); - - return Scaffold( - body: SingleChildScrollView( - padding: EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - widget.title ?? 'Service', - fontWeight: FontWeight.w800, - fontSize: 25, - bold: true, - color: Color(0xff60686b), - ), - SizedBox( - height: 12, - ), - Texts( - widget.description ?? 'Description', - fontWeight: FontWeight.normal, - fontSize: 17, - ), - if (widget.infoList != null) - SizedBox( - height: 12, - ), - if (widget.infoList != null) - ...List.generate( - widget.infoList!.length, - (index) => Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: 40, - height: 40, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), - child: Center( - child: Texts( - '${index + 1}', - color: Colors.white, - ), - ), - ), - SizedBox( - width: 6, - ), - Expanded(child: Texts('${widget.infoList![index]}')) - ], - ), - SizedBox( - height: 12, - ), - ], - ), - ), - ), - SizedBox( - height: 22, - ), - if (!projectViewModel.isInternetConnection) - Center( - child: SizedBox( - height: MediaQuery.of(context).size.height * 0.55, - width: MediaQuery.of(context).size.width * 0.50, - child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'), - ), - ), - if (projectViewModel.isInternetConnection && widget.imagesInfo != null) - CarouselSlider( - items: widget.imagesInfo!.map((image) { - return Builder( - builder: (BuildContext context) { - return SizedBox( - width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); - }, - ); - }).toList(), - options: CarouselOptions( - height: MediaQuery.of(context).size.height * 0.55, - autoPlay: widget.imagesInfo!.length > 1, - viewportFraction: 1.0, - ), - ), - SizedBox( - height: 77, - ), - ], - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - onTap: () { - loginCheck(context); - }, - label: TranslationBase.of(context).serviceInformationButton, - textColor: Theme.of(context).backgroundColor), - ), - ], - ), - ), - ); + // Scaffold( + // backgroundColor: Color(0xfff8f8f8), + // resizeToAvoidBottomInset: false, + // appBar: AppBar( + // backgroundColor: Colors.transparent, + // leading: IconButton( + // icon: Icon(Icons.arrow_back_ios), + // color: Color(0xff2B353E), + // onPressed: () => Navigator.pop(context), + // ), + // ), + // body: Padding( + // padding: EdgeInsets.only(bottom: 20, left: 21, right: 21), + // child: Column(children: [ + // Expanded( + // child: ListView( + // padding: EdgeInsets.zero, + // physics: BouncingScrollPhysics(), + // children: [ + // SizedBox(height: 12), + // if (widget.icon != null) + // Align( + // alignment: Alignment.centerLeft, + // child: SvgPicture.asset( + // widget.icon!, + // height: 35, + // width: 35, + // ), + // ), + // SizedBox(height: 16), + // Text( + // widget.title, + // style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), + // ), + // Text( + // widget.description!, + // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), + // ), + // SizedBox( + // height: 14, + // ), + // if (!projectViewModel.isInternetConnection) + // Center( + // child: SizedBox( + // height: MediaQuery.of(context).size.height * 0.55, + // width: MediaQuery.of(context).size.width * 0.50, + // child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'), + // ), + // ), + // if (projectViewModel.isInternetConnection && widget.imagesInfo != null) + // CarouselSlider( + // items: widget.imagesInfo?.map((image) { + // return Builder( + // builder: (BuildContext context) { + // return SizedBox( + // width: MediaQuery.of(context).size.width * 0.50, + // child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); + // }, + // ); + // }).toList(), + // options: CarouselOptions( + // height: MediaQuery.of(context).size.height * 0.55, + // autoPlay: widget.imagesInfo!.length > 1, + // viewportFraction: 1.0, + // ), + // ), + // ], + // ), + // ), + // SizedBox( + // height: 43, + // width: double.infinity, + // child: TextButton( + // onPressed: () { + // loginCheck(context); + // }, + // child: Text( + // TranslationBase.of(context).loginregister, + // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + // ), + // style: TextButton.styleFrom( + // backgroundColor: Color(0xffD02127), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(6), + // ), + // )), + // ), + // ]), + // ), + // ); + // + // return Scaffold( + // body: SingleChildScrollView( + // padding: EdgeInsets.all(12), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts( + // widget.title ?? 'Service', + // fontWeight: FontWeight.w800, + // fontSize: 25, + // bold: true, + // color: Color(0xff60686b), + // ), + // SizedBox( + // height: 12, + // ), + // Texts( + // widget.description ?? 'Description', + // fontWeight: FontWeight.normal, + // fontSize: 17, + // ), + // if (widget.infoList != null) + // SizedBox( + // height: 12, + // ), + // if (widget.infoList != null) + // ...List.generate( + // widget.infoList!.length, + // (index) => Container( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Row( + // children: [ + // Container( + // width: 40, + // height: 40, + // decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), + // child: Center( + // child: Texts( + // '${index + 1}', + // color: Colors.white, + // ), + // ), + // ), + // SizedBox( + // width: 6, + // ), + // Expanded(child: Texts('${widget.infoList![index]}')) + // ], + // ), + // SizedBox( + // height: 12, + // ), + // ], + // ), + // ), + // ), + // SizedBox( + // height: 22, + // ), + // if (!projectViewModel.isInternetConnection) + // Center( + // child: SizedBox( + // height: MediaQuery.of(context).size.height * 0.55, + // width: MediaQuery.of(context).size.width * 0.50, + // child: Image.asset(projectViewModel.isArabic ? 'assets/images/Wifi-AR.png' : 'assets/images/wifi-EN.png'), + // ), + // ), + // if (projectViewModel.isInternetConnection && widget.imagesInfo != null) + // CarouselSlider( + // items: widget.imagesInfo!.map((image) { + // return Builder( + // builder: (BuildContext context) { + // return SizedBox( + // width: MediaQuery.of(context).size.width * 0.50, + // child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); + // }, + // ); + // }).toList(), + // options: CarouselOptions( + // height: MediaQuery.of(context).size.height * 0.55, + // autoPlay: widget.imagesInfo!.length > 1, + // viewportFraction: 1.0, + // ), + // ), + // SizedBox( + // height: 77, + // ), + // ], + // ), + // ), + // bottomSheet: Container( + // height: MediaQuery.of(context).size.height * 0.10, + // width: double.infinity, + // child: Column( + // children: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.9, + // child: SecondaryButton( + // onTap: () { + // loginCheck(context); + // }, + // label: TranslationBase.of(context).serviceInformationButton, + // textColor: Theme.of(context).backgroundColor), + // ), + // ], + // ), + // ), + // ); } loginCheck(context) async { diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index c87dceeb..b6a89573 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; @@ -211,12 +212,12 @@ class SMSOTP { errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Theme.of(context).errorColor), + borderSide: BorderSide(color: CustomColors.accentColor), ), ); } diff --git a/lib/widgets/text/app_texts_widget.dart b/lib/widgets/text/app_texts_widget.dart index 01dce651..0d1e6477 100644 --- a/lib/widgets/text/app_texts_widget.dart +++ b/lib/widgets/text/app_texts_widget.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -62,7 +63,7 @@ class _AppTextState extends State { overflow: TextOverflow.clip, style: TextStyle( - color: widget.color == null ? Theme.of(context).textTheme.bodyText1!.color : widget.color, + color: widget.color == null ? CustomColors.black : widget.color, fontWeight: widget.fontWeight, fontSize: widget.fontSize ?? (SizeConfig.textMultiplier! * 2), height: widget.height, diff --git a/pubspec.yaml b/pubspec.yaml index 0e9b2bd6..151d3e8d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.061+4050061 +version: 4.5.063+4050063 environment: sdk: ">=3.0.0 <3.13.0" @@ -13,9 +13,11 @@ dependencies: # Localizations flutter_localizations: sdk: flutter - intl: ^0.18.1 +# intl: ^0.18.1 + intl: ^0.19.0 - webview_flutter: ^2.0.4 +# webview_flutter: ^2.0.4 + webview_flutter: ^4.8.0 # http client http: ^0.13.4 @@ -97,7 +99,8 @@ dependencies: flutter_rating_bar: ^4.0.1 # Calendar - syncfusion_flutter_calendar: ^23.1.42 +# syncfusion_flutter_calendar: ^23.1.42 + syncfusion_flutter_calendar: ^24.1.47 # SVG Images flutter_svg: ^2.0.8 @@ -174,6 +177,8 @@ dependencies: flutter_zoom_videosdk: ^1.10.11 dart_jsonwebtoken: ^2.14.0 + cloudflare_turnstile: ^2.0.1 + dependency_overrides: dev_dependencies: