From afeb28f2196c13bcfe20f5b9caa0ef679adf2128 Mon Sep 17 00:00:00 2001 From: faizatflutter Date: Tue, 21 Jul 2026 16:21:09 +0300 Subject: [PATCH] added RSG env --- android/gradle.properties | 4 + lib/core/api_consts.dart | 16 ++ lib/core/enums.dart | 35 ++- .../dev_tools/environment_config_service.dart | 99 +++++++- .../dev_tools/environment_config_sheet.dart | 239 ++++++++++++++++-- lib/presentation/home/landing_page.dart | 37 +++ .../profile_settings/profile_settings.dart | 22 -- pubspec.lock | 94 ++++++- 8 files changed, 468 insertions(+), 78 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index f47e3b3a..5e4be6c5 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -8,3 +8,7 @@ org.gradle.parallel=true org.gradle.configureondemand=true android.useAndroidX=true android.enableImpeller=false +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 5fd71e7c..4bcdcb28 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -149,6 +149,22 @@ class ApiConsts { symptomsCheckerUsername = 'guest_user'; symptomsCheckerPassword = '123456'; + case AppEnvironmentTypeEnum.rsg: + baseUrl = "https://uat.hmgwebservices.com/"; + payFortEnvironment = FortEnvironment.production; + payFortEnvironmentType = EnvironmentType.production; + applePayMerchantId = "merchant.com.rsgwebservices.hmg.redseahealth"; + SERVICE_URL = 'https://rsgwebservices.hmg.com/Payment/pages/RsgSendPayFortRequest.aspx'; + TAMARA_URL = "https://mdlaboratories.com/tamaralive/Home/Checkout"; + GET_TAMARA_INSTALLMENTS_URL = "https://mdlaboratories.com/tamaralive/Home/GetInstallments"; + GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid='; + rcBaseUrl = 'https://rsgrequestcenter.hmg.com/'; + QLINE_URL = "https://qline.hmg.com/api/PatientCall/PatientInQueue_Detail"; + CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId="; + symptomsCheckerApi = symptomsCheckerApiUAT; + symptomsCheckerUsername = 'guest_user'; + symptomsCheckerPassword = '123456'; + break; } } diff --git a/lib/core/enums.dart b/lib/core/enums.dart index 4ac919e7..df8637eb 100644 --- a/lib/core/enums.dart +++ b/lib/core/enums.dart @@ -42,7 +42,7 @@ enum OTPTypeEnum { sms, whatsapp, faceIDFingerprint } enum LoginTypeEnum { sms, whatsapp, face, fingerprint } -enum AppEnvironmentTypeEnum { dev, uat, preProd, qa, staging, prod } +enum AppEnvironmentTypeEnum { dev, uat, preProd, qa, staging, prod, rsg } enum FamilyFileEnum { active, inactive, blocked, deleted, pending, rejected } @@ -94,22 +94,22 @@ extension HealthCalculatorExtenshion on HealthCalculatorsTypeEnum { case HealthCalculatorsTypeEnum.triglycerides: return isArabic ? "الدهون الثلاثية في الدم" : "Triglycerides Fat Blood"; } - } + } + + String get title { + AppState appState = getIt.get(); + bool isArabic = appState.getLanguageID() == 1 ? true : false; + switch (this) { + case HealthCalculatorsTypeEnum.crabsProteinFat: + return isArabic ? "نتيجة المغذيات" : "Nutrient Results"; + case HealthCalculatorsTypeEnum.calories: + return isArabic ? "سعراتك الحرارية" : "Calories"; - String get title { - AppState appState = getIt.get(); - bool isArabic = appState.getLanguageID() == 1 ? true : false; - switch (this) { - case HealthCalculatorsTypeEnum.crabsProteinFat: - return isArabic ? "نتيجة المغذيات" : "Nutrient Results"; - case HealthCalculatorsTypeEnum.calories: - return isArabic ? "سعراتك الحرارية" : "Calories"; - - case HealthCalculatorsTypeEnum.calories: - return isArabic ? "مؤشر كتلة الجسم" : "BMI"; - default: - return "Your ${this.name.toCamelCase}"; - } + case HealthCalculatorsTypeEnum.calories: + return isArabic ? "مؤشر كتلة الجسم" : "BMI"; + default: + return "Your ${this.name.toCamelCase}"; + } } static LoginTypeEnum? fromValue(int value) { @@ -485,6 +485,3 @@ extension QuestionTypeEnumExtension on QuestionTypeEnum { } } } - - - diff --git a/lib/features/dev_tools/environment_config_service.dart b/lib/features/dev_tools/environment_config_service.dart index 8483162a..2fc0f437 100644 --- a/lib/features/dev_tools/environment_config_service.dart +++ b/lib/features/dev_tools/environment_config_service.dart @@ -100,14 +100,36 @@ const List kEnvironmentPresets = [ symptomsCheckerUsername: 'guest_user', symptomsCheckerPassword: '123456', ), + AppEnvironmentPreset( + label: 'RSG', + environmentType: AppEnvironmentTypeEnum.rsg, + baseUrl: 'https://rsgwebservices.hmg.com/', + rcBaseUrl: 'https://rsgrequestcenter.hmg.com/', + hmgPharmacyApiBaseUrl: 'https://hmgpharmacyapi.hmg.com/', + tamaraUrl: 'https://mdlaboratories.com/tamaralive/Home/Checkout', + getTamaraInstallmentsUrl: 'https://mdlaboratories.com/tamaralive/Home/GetInstallments', + getTamaraPaymentStatus: 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=', + qlineUrl: 'https://qline.hmg.com/api/PatientCall/PatientInQueue_Detail', + chatUrl: 'https://chat.hmg.com/geneysChat/Index.aspx?RequestedId=', + serviceUrl: 'https://rsgwebservices.hmg.com/Payment/pages/RsgSendPayFortRequest.aspx', + payFortEnvironment: FortEnvironment.production, + payFortEnvironmentType: EnvironmentType.production, + applePayMerchantId: 'merchant.com.rsgwebservices.hmg.redseahealth', + symptomsCheckerUsername: 'mobile_user', + symptomsCheckerPassword: '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', + ), ]; // Keys for SharedPreferences const String envStoredEnvironmentKey = 'dev_tools_stored_environment'; +const String envCustomBaseUrlKey = 'dev_tools_custom_base_url'; +const String envCustomRcBaseUrlKey = 'dev_tools_custom_rc_base_url'; +const String envCustomPaymentUrlKey = 'dev_tools_custom_payment_url'; /// Service to manage environment configuration class EnvironmentConfigService { static final EnvironmentConfigService instance = EnvironmentConfigService._internal(); + EnvironmentConfigService._internal(); final CacheService _cacheService = getIt.get(); @@ -117,6 +139,19 @@ class EnvironmentConfigService { final storedEnvLabel = _cacheService.getString(key: envStoredEnvironmentKey); if (storedEnvLabel != null && storedEnvLabel.isNotEmpty) { + if (storedEnvLabel == 'Custom') { + // Load and apply custom URLs + final customUrls = getCustomUrls(); + if (customUrls['baseUrl'] != null && customUrls['rcBaseUrl'] != null && customUrls['paymentUrl'] != null) { + await applyCustomUrls( + baseUrl: customUrls['baseUrl']!, + rcBaseUrl: customUrls['rcBaseUrl']!, + paymentUrl: customUrls['paymentUrl']!, + ); + return; + } + } + try { final preset = kEnvironmentPresets.firstWhere((p) => p.label == storedEnvLabel); _applyPresetToApiConsts(preset); @@ -158,6 +193,69 @@ class EnvironmentConfigService { } } + /// Save custom URLs + Future saveCustomUrls({ + required String baseUrl, + required String rcBaseUrl, + required String paymentUrl, + }) async { + await _cacheService.saveString(key: envCustomBaseUrlKey, value: baseUrl); + await _cacheService.saveString(key: envCustomRcBaseUrlKey, value: rcBaseUrl); + await _cacheService.saveString(key: envCustomPaymentUrlKey, value: paymentUrl); + await _cacheService.saveString(key: envStoredEnvironmentKey, value: 'Custom'); + } + + /// Get saved custom URLs + Map getCustomUrls() { + return { + 'baseUrl': _cacheService.getString(key: envCustomBaseUrlKey), + 'rcBaseUrl': _cacheService.getString(key: envCustomRcBaseUrlKey), + 'paymentUrl': _cacheService.getString(key: envCustomPaymentUrlKey), + }; + } + + /// Check if custom environment is active + bool isCustomEnvironment() { + return getCurrentEnvironment() == 'Custom'; + } + + /// Apply custom URLs + Future applyCustomUrls({ + required String baseUrl, + required String rcBaseUrl, + required String paymentUrl, + }) async { + await saveCustomUrls( + baseUrl: baseUrl, + rcBaseUrl: rcBaseUrl, + paymentUrl: paymentUrl, + ); + + // Apply custom URLs to ApiConsts + ApiConsts.appEnvironmentType = AppEnvironmentTypeEnum.dev; + ApiConsts.baseUrl = baseUrl; + ApiConsts.rcBaseUrl = rcBaseUrl; + ApiConsts.SERVICE_URL = paymentUrl; + + // Use sandbox for custom environment + ApiConsts.payFortEnvironment = FortEnvironment.test; + ApiConsts.payFortEnvironmentType = EnvironmentType.sandbox; + + // Use UAT defaults for other URLs + final uatPreset = kEnvironmentPresets.firstWhere((p) => p.label == 'UAT'); + ApiConsts.hmgPharmacyApiBaseUrl = uatPreset.hmgPharmacyApiBaseUrl; + ApiConsts.symptomsCheckerApi = '${uatPreset.hmgPharmacyApiBaseUrl}symptomsapi_live/api/SymptomChecker'; + ApiConsts.symptomsCheckerScheduleAppointment = '${ApiConsts.symptomsCheckerApi}/ScheduleAppointment'; + ApiConsts.TAMARA_URL = uatPreset.tamaraUrl; + ApiConsts.GET_TAMARA_INSTALLMENTS_URL = uatPreset.getTamaraInstallmentsUrl; + ApiConsts.GET_TAMARA_PAYMENT_STATUS = uatPreset.getTamaraPaymentStatus; + ApiConsts.QLINE_URL = uatPreset.qlineUrl; + ApiConsts.CHAT_URL = uatPreset.chatUrl; + ApiConsts.applePayMerchantId = uatPreset.applePayMerchantId; + ApiConsts.symptomsCheckerUsername = uatPreset.symptomsCheckerUsername; + ApiConsts.symptomsCheckerPassword = uatPreset.symptomsCheckerPassword; + } + void _applyPresetToApiConsts(AppEnvironmentPreset preset) { ApiConsts.appEnvironmentType = preset.environmentType; ApiConsts.baseUrl = preset.baseUrl; @@ -183,4 +281,3 @@ class EnvironmentConfigService { _applyPresetToApiConsts(kEnvironmentPresets[0]); } } - diff --git a/lib/presentation/dev_tools/environment_config_sheet.dart b/lib/presentation/dev_tools/environment_config_sheet.dart index 2b7ea10e..49851ee5 100644 --- a/lib/presentation/dev_tools/environment_config_sheet.dart +++ b/lib/presentation/dev_tools/environment_config_sheet.dart @@ -20,6 +20,12 @@ class EnvironmentConfigSheet extends StatefulWidget { class _EnvironmentConfigSheetState extends State { AppEnvironmentPreset? _selectedPreset; bool _isLoading = true; + bool _isCustomMode = false; + + // Text controllers for custom URLs + final TextEditingController _baseUrlController = TextEditingController(); + final TextEditingController _rcBaseUrlController = TextEditingController(); + final TextEditingController _paymentUrlController = TextEditingController(); @override void initState() { @@ -27,12 +33,36 @@ class _EnvironmentConfigSheetState extends State { _loadCurrentEnvironment(); } + @override + void dispose() { + _baseUrlController.dispose(); + _rcBaseUrlController.dispose(); + _paymentUrlController.dispose(); + super.dispose(); + } + Future _loadCurrentEnvironment() async { - final currentPreset = EnvironmentConfigService.instance.getCurrentPreset(); - setState(() { - _selectedPreset = currentPreset; - _isLoading = false; - }); + final isCustom = EnvironmentConfigService.instance.isCustomEnvironment(); + + if (isCustom) { + final customUrls = EnvironmentConfigService.instance.getCustomUrls(); + _baseUrlController.text = customUrls['baseUrl'] ?? ''; + _rcBaseUrlController.text = customUrls['rcBaseUrl'] ?? ''; + _paymentUrlController.text = customUrls['paymentUrl'] ?? ''; + + setState(() { + _isCustomMode = true; + _selectedPreset = null; + _isLoading = false; + }); + } else { + final currentPreset = EnvironmentConfigService.instance.getCurrentPreset(); + setState(() { + _selectedPreset = currentPreset; + _isCustomMode = false; + _isLoading = false; + }); + } } @override @@ -116,7 +146,9 @@ class _EnvironmentConfigSheetState extends State { ), SizedBox(height: 4.h), Text( - _selectedPreset?.label ?? LocaleKeys.production.tr(context: context), + _isCustomMode + ? 'Custom' + : (_selectedPreset?.label ?? LocaleKeys.production.tr(context: context)), style: TextStyle(fontSize: 12.f, color: AppColors.blackBgColor), ), ], @@ -135,53 +167,185 @@ class _EnvironmentConfigSheetState extends State { Wrap( spacing: 8.w, runSpacing: 8.h, - children: kEnvironmentPresets.map((preset) { - final isSelected = _selectedPreset?.label == preset.label; - return InkWell( + children: [ + // Preset environment chips + ...kEnvironmentPresets.map((preset) { + final isSelected = !_isCustomMode && _selectedPreset?.label == preset.label; + return InkWell( + onTap: () { + setState(() { + _selectedPreset = preset; + _isCustomMode = false; + }); + }, + borderRadius: BorderRadius.circular(20.r), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h), + decoration: BoxDecoration( + color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor, + borderRadius: BorderRadius.circular(20.r), + border: Border.all( + color: isSelected ? AppColors.primaryRedColor : AppColors.greyInfoTextColor.withValues(alpha: 0.3), + ), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (isSelected) + Icon( + Icons.check_circle, + size: 18.w, + color: Colors.white, + ), + if (isSelected) SizedBox(width: 6.w), + Text( + preset.label, + style: TextStyle( + fontSize: 14.f, + color: isSelected ? Colors.white : AppColors.blackBgColor, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ), + ); + }).toList(), + + // Custom chip + InkWell( onTap: () { setState(() { - _selectedPreset = preset; + _isCustomMode = true; + _selectedPreset = null; }); }, borderRadius: BorderRadius.circular(20.r), child: Container( padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h), decoration: BoxDecoration( - color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor, + color: _isCustomMode ? AppColors.infoColor : AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r), border: Border.all( - color: isSelected ? AppColors.primaryRedColor : AppColors.greyInfoTextColor.withValues(alpha: 0.3), + color: _isCustomMode ? AppColors.infoColor : AppColors.greyInfoTextColor.withValues(alpha: 0.3), ), ), child: Row( mainAxisSize: MainAxisSize.min, children: [ - if (isSelected) + if (_isCustomMode) Icon( Icons.check_circle, size: 18.w, color: Colors.white, ), - if (isSelected) SizedBox(width: 6.w), + if (_isCustomMode) SizedBox(width: 6.w), + Icon( + Icons.edit_outlined, + size: 16.w, + color: _isCustomMode ? Colors.white : AppColors.blackBgColor, + ), + SizedBox(width: 4.w), Text( - preset.label, + 'Custom', style: TextStyle( fontSize: 14.f, - color: isSelected ? Colors.white : AppColors.blackBgColor, - fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + color: _isCustomMode ? Colors.white : AppColors.blackBgColor, + fontWeight: _isCustomMode ? FontWeight.bold : FontWeight.normal, ), ), ], ), ), - ); - }).toList(), + ), + ], ), SizedBox(height: 24.h), + // Custom URL Input Fields + if (_isCustomMode) ...[ + Text('Custom URLs', style: TextStyle(fontSize: 16.f, fontWeight: FontWeight.bold)), + SizedBox(height: 12.h), + + // Base URL + TextField( + controller: _baseUrlController, + decoration: InputDecoration( + labelText: 'Base URL', + hintText: 'https://example.com/', + prefixIcon: Icon(Icons.link, size: 20.w), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12.r), + ), + filled: true, + fillColor: AppColors.whiteColor, + ), + style: TextStyle(fontSize: 14.f), + ), + SizedBox(height: 12.h), + + // RC Base URL + TextField( + controller: _rcBaseUrlController, + decoration: InputDecoration( + labelText: 'RC Base URL', + hintText: 'https://rc.example.com/', + prefixIcon: Icon(Icons.link, size: 20.w), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12.r), + ), + filled: true, + fillColor: AppColors.whiteColor, + ), + style: TextStyle(fontSize: 14.f), + ), + SizedBox(height: 12.h), + + // Payment URL + TextField( + controller: _paymentUrlController, + decoration: InputDecoration( + labelText: 'Payment URL', + hintText: 'https://example.com/payment/SendPayFortRequest.aspx', + prefixIcon: Icon(Icons.payment, size: 20.w), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(12.r), + ), + filled: true, + fillColor: AppColors.whiteColor, + ), + style: TextStyle(fontSize: 14.f), + ), + SizedBox(height: 24.h), + ], + // Environment Details - if (_selectedPreset != null) ...[ + if (_isCustomMode && _baseUrlController.text.isNotEmpty) ...[ + Text(LocaleKeys.environmentDetails.tr(context: context), style: TextStyle(fontSize: 16.f, fontWeight: FontWeight.bold)), + SizedBox(height: 12.h), + Container( + padding: EdgeInsets.all(16.w), + decoration: BoxDecoration( + color: AppColors.whiteColor, + borderRadius: BorderRadius.circular(12.r), + border: Border.all( + color: AppColors.greyInfoTextColor.withValues(alpha: 0.2), + ), + ), + child: Column( + children: [ + _buildDetailRow(LocaleKeys.baseUrl.tr(context: context), _baseUrlController.text), + Divider(height: 20.h), + _buildDetailRow(LocaleKeys.rcUrl.tr(context: context), _rcBaseUrlController.text), + Divider(height: 20.h), + _buildDetailRow('Payment URL', _paymentUrlController.text), + Divider(height: 20.h), + _buildDetailRow(LocaleKeys.payfortMode.tr(context: context), LocaleKeys.sandbox.tr(context: context)), + ], + ), + ), + ] else if (_selectedPreset != null) ...[ Text(LocaleKeys.environmentDetails.tr(context: context), style: TextStyle(fontSize: 16.f, fontWeight: FontWeight.bold)), SizedBox(height: 12.h), Container( @@ -199,7 +363,7 @@ class _EnvironmentConfigSheetState extends State { Divider(height: 20.h), _buildDetailRow(LocaleKeys.rcUrl.tr(context: context), _selectedPreset!.rcBaseUrl), Divider(height: 20.h), - _buildDetailRow(LocaleKeys.pharmacyApi.tr(context: context), _selectedPreset!.hmgPharmacyApiBaseUrl), + _buildDetailRow('Payment URL', _selectedPreset!.serviceUrl), Divider(height: 20.h), _buildDetailRow( LocaleKeys.payfortMode.tr(context: context), @@ -273,7 +437,7 @@ class _EnvironmentConfigSheetState extends State { text: LocaleKeys.saveAndRestart.tr(context: context), icon: AppAssets.confirm, iconSize: 20.w, - onPressed: _selectedPreset != null ? _saveAndRestart : null, + onPressed: (_selectedPreset != null || _isCustomMode) ? _saveAndRestart : null, ), ), ], @@ -323,10 +487,35 @@ class _EnvironmentConfigSheetState extends State { } Future _saveAndRestart() async { - if (_selectedPreset == null) return; - try { - await EnvironmentConfigService.instance.applyPreset(_selectedPreset!); + if (_isCustomMode) { + // Validate custom URLs + if (_baseUrlController.text.trim().isEmpty || + _rcBaseUrlController.text.trim().isEmpty || + _paymentUrlController.text.trim().isEmpty) { + Utils.showToast('Please enter all custom URLs'); + return; + } + + // Ensure URLs end properly (payment URL should NOT have trailing /) + String baseUrl = _baseUrlController.text.trim(); + String rcBaseUrl = _rcBaseUrlController.text.trim(); + String paymentUrl = _paymentUrlController.text.trim(); + + if (!baseUrl.endsWith('/')) baseUrl += '/'; + if (!rcBaseUrl.endsWith('/')) rcBaseUrl += '/'; + + await EnvironmentConfigService.instance.applyCustomUrls( + baseUrl: baseUrl, + rcBaseUrl: rcBaseUrl, + paymentUrl: paymentUrl, + ); + } else if (_selectedPreset != null) { + await EnvironmentConfigService.instance.applyPreset(_selectedPreset!); + } else { + return; + } + Navigator.pop(context, true); // Return true to indicate app should restart Utils.showToast(LocaleKeys.envUpdateSuccess.tr(context: context)); } catch (e) { diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 85f1e972..4fd8b8cc 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -61,6 +61,8 @@ import 'package:hmg_patient_app_new/presentation/rate_appointment/rate_appointme import 'package:hmg_patient_app_new/presentation/todo_section/ancillary_procedures_details_page.dart'; import 'package:hmg_patient_app_new/presentation/todo_section/todo_page.dart'; import 'package:hmg_patient_app_new/presentation/todo_section/widgets/ancillary_orders_list.dart'; +import 'package:hmg_patient_app_new/presentation/dev_tools/api_log_screen.dart'; +import 'package:hmg_patient_app_new/presentation/dev_tools/environment_config_sheet.dart'; import 'package:hmg_patient_app_new/routes/app_routes.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; @@ -379,6 +381,41 @@ class _LandingPageState extends State { ); }), + // Dev Tools Icons (API Logger) + SizedBox(width: 24.w), + Icon( + Icons.bug_report_outlined, + size: 24.h, + color: AppColors.primaryRedColor, + ).onPress(() { + Navigator.of(context).push( + CustomPageRoute( + page: ApiLogScreen(), + ), + ); + }), + + // Dev Tools Icons (Environment Config) + SizedBox(width: 12.w), + Icon( + Icons.settings_applications_outlined, + size: 24.h, + color: AppColors.primaryRedColor, + ).onPress(() async { + final shouldRestart = await showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: Colors.transparent, + builder: (context) => const EnvironmentConfigSheet(), + ); + + if (shouldRestart == true && mounted) { + // Show restart message + Utils.showToast('App will restart to apply changes'); + // You might want to implement actual app restart logic here + } + }), + // Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 24.h, width: 24.h).onPress(() { // showCommonBottomSheetWithoutHeight( // context, diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index 17f485bd..38f9cfae 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -22,8 +22,6 @@ import 'package:hmg_patient_app_new/features/medical_file/models/family_file_res import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart'; -import 'package:hmg_patient_app_new/presentation/dev_tools/api_log_screen.dart'; -import 'package:hmg_patient_app_new/presentation/dev_tools/environment_config_sheet.dart'; import 'package:hmg_patient_app_new/presentation/insurance/widgets/insurance_update_details_card.dart'; import 'package:hmg_patient_app_new/presentation/profile_settings/accessibility_page.dart'; import 'package:hmg_patient_app_new/presentation/profile_settings/widgets/profile_picture_widget.dart'; @@ -313,26 +311,6 @@ class ProfileSettingsState extends State { decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: false), child: Column( children: [ - // DevTools Menu Items (only shown if enabled) - if (ApiConsts.enableDevTools) ...[ - actionItem(AppAssets.document, LocaleKeys.apiLogs.tr(context: context), () { - Navigator.of(context).push(CustomPageRoute(page: const ApiLogScreen())); - }), - 1.divider, - actionItem(AppAssets.ic_filters, LocaleKeys.environmentConfig.tr(context: context), () async { - final shouldRestart = await showModalBottomSheet( - context: context, - isScrollControlled: true, - backgroundColor: Colors.transparent, - builder: (_) => const EnvironmentConfigSheet(), - ); - if (shouldRestart == true && mounted) { - // Restart app by navigating to splash screen - Navigator.pushNamedAndRemoveUntil(context, AppRoutes.initialRoute, (route) => false); - } - }), - 1.divider, - ], actionItem(AppAssets.call_fill, LocaleKeys.contactUs.tr(context: context), () { launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); }, trailingLabel: "92 006 6666", isEnglishOnly: true), diff --git a/pubspec.lock b/pubspec.lock index 4f2c35ac..3875497a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -117,10 +117,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" chewie: dependency: transitive description: @@ -145,6 +145,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + cloudflare_turnstile: + dependency: "direct main" + description: + name: cloudflare_turnstile + sha256: f04191fd1f9c658e98c11175356f34aaeca42b4ed91ee66d42fb250b3346160d + url: "https://pub.dev" + source: hosted + version: "3.8.0" collection: dependency: transitive description: @@ -499,6 +507,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_amazonpaymentservices: + dependency: "direct main" + description: + name: flutter_amazonpaymentservices + sha256: "23f45fd3b1e12a0933da3704d66cebd19c4c41e28a50d4fd458d3e3e6311f332" + url: "https://pub.dev" + source: hosted + version: "0.0.13" flutter_cache_manager: dependency: transitive description: @@ -720,6 +736,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.1" + flutter_screenshot_blocker: + dependency: "direct main" + description: + name: flutter_screenshot_blocker + sha256: "20e36b4aaca20259008dbb1403b77af6207d48cd8382a772b9c27619bc116849" + url: "https://pub.dev" + source: hosted + version: "1.0.4" flutter_staggered_animations: dependency: "direct main" description: @@ -1341,26 +1365,26 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" mime: dependency: transitive description: @@ -1641,6 +1665,54 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + screen_brightness: + dependency: "direct main" + description: + name: screen_brightness + sha256: "7d4ac84ae26b37c01d6f5db7123a72db7933e1f2a2a8c369a51e08f81b3178d8" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + screen_brightness_android: + dependency: transitive + description: + name: screen_brightness_android + sha256: "8c69d3ac475e4d625e7fa682a3a51a69ff59abe5b4a9e57f6ec7d830a6c69bd6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + screen_brightness_ios: + dependency: transitive + description: + name: screen_brightness_ios + sha256: f08f70ca1ac3e30719764b5cfb8b3fe1e28163065018a41b3e6f243ab146c2f1 + url: "https://pub.dev" + source: hosted + version: "1.0.1" + screen_brightness_macos: + dependency: transitive + description: + name: screen_brightness_macos + sha256: "70c2efa4534e22b927e82693488f127dd4a0f008469fccf4f0eefe9061bbdd6a" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + screen_brightness_platform_interface: + dependency: transitive + description: + name: screen_brightness_platform_interface + sha256: "9f3ebf7f22d5487e7676fe9ddaf3fc55b6ff8057707cf6dc0121c7dfda346a16" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + screen_brightness_windows: + dependency: transitive + description: + name: screen_brightness_windows + sha256: c8e12a91cf6dd912a48bd41fcf749282a51afa17f536c3460d8d05702fb89ffa + url: "https://pub.dev" + source: hosted + version: "1.0.1" scrollable_positioned_list: dependency: "direct main" description: @@ -1890,10 +1962,10 @@ packages: dependency: transitive description: name: test_api - sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.7" + version: "0.7.11" time: dependency: transitive description: @@ -2175,5 +2247,5 @@ packages: source: hosted version: "1.2.0" sdks: - dart: ">=3.9.0 <4.0.0" + dart: ">=3.10.0-0 <4.0.0" flutter: ">=3.35.0"