added RSG env

faiz_dev_tools_imp
faizatflutter 1 week ago
parent 17c45e1656
commit afeb28f219

@ -8,3 +8,7 @@ org.gradle.parallel=true
org.gradle.configureondemand=true org.gradle.configureondemand=true
android.useAndroidX=true android.useAndroidX=true
android.enableImpeller=false 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

@ -149,6 +149,22 @@ class ApiConsts {
symptomsCheckerUsername = 'guest_user'; symptomsCheckerUsername = 'guest_user';
symptomsCheckerPassword = '123456'; 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; break;
} }
} }

@ -42,7 +42,7 @@ enum OTPTypeEnum { sms, whatsapp, faceIDFingerprint }
enum LoginTypeEnum { sms, whatsapp, face, fingerprint } 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 } enum FamilyFileEnum { active, inactive, blocked, deleted, pending, rejected }
@ -94,22 +94,22 @@ extension HealthCalculatorExtenshion on HealthCalculatorsTypeEnum {
case HealthCalculatorsTypeEnum.triglycerides: case HealthCalculatorsTypeEnum.triglycerides:
return isArabic ? "الدهون الثلاثية في الدم" : "Triglycerides Fat Blood"; return isArabic ? "الدهون الثلاثية في الدم" : "Triglycerides Fat Blood";
} }
} }
String get title {
AppState appState = getIt.get<AppState>();
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 { case HealthCalculatorsTypeEnum.calories:
AppState appState = getIt.get<AppState>(); return isArabic ? "مؤشر كتلة الجسم" : "BMI";
bool isArabic = appState.getLanguageID() == 1 ? true : false; default:
switch (this) { return "Your ${this.name.toCamelCase}";
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}";
}
} }
static LoginTypeEnum? fromValue(int value) { static LoginTypeEnum? fromValue(int value) {
@ -485,6 +485,3 @@ extension QuestionTypeEnumExtension on QuestionTypeEnum {
} }
} }
} }

@ -100,14 +100,36 @@ const List<AppEnvironmentPreset> kEnvironmentPresets = [
symptomsCheckerUsername: 'guest_user', symptomsCheckerUsername: 'guest_user',
symptomsCheckerPassword: '123456', 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 // Keys for SharedPreferences
const String envStoredEnvironmentKey = 'dev_tools_stored_environment'; 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 /// Service to manage environment configuration
class EnvironmentConfigService { class EnvironmentConfigService {
static final EnvironmentConfigService instance = EnvironmentConfigService._internal(); static final EnvironmentConfigService instance = EnvironmentConfigService._internal();
EnvironmentConfigService._internal(); EnvironmentConfigService._internal();
final CacheService _cacheService = getIt.get<CacheService>(); final CacheService _cacheService = getIt.get<CacheService>();
@ -117,6 +139,19 @@ class EnvironmentConfigService {
final storedEnvLabel = _cacheService.getString(key: envStoredEnvironmentKey); final storedEnvLabel = _cacheService.getString(key: envStoredEnvironmentKey);
if (storedEnvLabel != null && storedEnvLabel.isNotEmpty) { 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 { try {
final preset = kEnvironmentPresets.firstWhere((p) => p.label == storedEnvLabel); final preset = kEnvironmentPresets.firstWhere((p) => p.label == storedEnvLabel);
_applyPresetToApiConsts(preset); _applyPresetToApiConsts(preset);
@ -158,6 +193,69 @@ class EnvironmentConfigService {
} }
} }
/// Save custom URLs
Future<void> 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<String, String?> 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<void> 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) { void _applyPresetToApiConsts(AppEnvironmentPreset preset) {
ApiConsts.appEnvironmentType = preset.environmentType; ApiConsts.appEnvironmentType = preset.environmentType;
ApiConsts.baseUrl = preset.baseUrl; ApiConsts.baseUrl = preset.baseUrl;
@ -183,4 +281,3 @@ class EnvironmentConfigService {
_applyPresetToApiConsts(kEnvironmentPresets[0]); _applyPresetToApiConsts(kEnvironmentPresets[0]);
} }
} }

@ -20,6 +20,12 @@ class EnvironmentConfigSheet extends StatefulWidget {
class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> { class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
AppEnvironmentPreset? _selectedPreset; AppEnvironmentPreset? _selectedPreset;
bool _isLoading = true; bool _isLoading = true;
bool _isCustomMode = false;
// Text controllers for custom URLs
final TextEditingController _baseUrlController = TextEditingController();
final TextEditingController _rcBaseUrlController = TextEditingController();
final TextEditingController _paymentUrlController = TextEditingController();
@override @override
void initState() { void initState() {
@ -27,12 +33,36 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
_loadCurrentEnvironment(); _loadCurrentEnvironment();
} }
@override
void dispose() {
_baseUrlController.dispose();
_rcBaseUrlController.dispose();
_paymentUrlController.dispose();
super.dispose();
}
Future<void> _loadCurrentEnvironment() async { Future<void> _loadCurrentEnvironment() async {
final currentPreset = EnvironmentConfigService.instance.getCurrentPreset(); final isCustom = EnvironmentConfigService.instance.isCustomEnvironment();
setState(() {
_selectedPreset = currentPreset; if (isCustom) {
_isLoading = false; 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 @override
@ -116,7 +146,9 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
Text( 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), style: TextStyle(fontSize: 12.f, color: AppColors.blackBgColor),
), ),
], ],
@ -135,53 +167,185 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
Wrap( Wrap(
spacing: 8.w, spacing: 8.w,
runSpacing: 8.h, runSpacing: 8.h,
children: kEnvironmentPresets.map((preset) { children: [
final isSelected = _selectedPreset?.label == preset.label; // Preset environment chips
return InkWell( ...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: () { onTap: () {
setState(() { setState(() {
_selectedPreset = preset; _isCustomMode = true;
_selectedPreset = null;
}); });
}, },
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h), padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isSelected ? AppColors.primaryRedColor : AppColors.whiteColor, color: _isCustomMode ? AppColors.infoColor : AppColors.whiteColor,
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
border: Border.all( 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( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (isSelected) if (_isCustomMode)
Icon( Icon(
Icons.check_circle, Icons.check_circle,
size: 18.w, size: 18.w,
color: Colors.white, 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( Text(
preset.label, 'Custom',
style: TextStyle( style: TextStyle(
fontSize: 14.f, fontSize: 14.f,
color: isSelected ? Colors.white : AppColors.blackBgColor, color: _isCustomMode ? Colors.white : AppColors.blackBgColor,
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, fontWeight: _isCustomMode ? FontWeight.bold : FontWeight.normal,
), ),
), ),
], ],
), ),
), ),
); ),
}).toList(), ],
), ),
SizedBox(height: 24.h), 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 // 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)), Text(LocaleKeys.environmentDetails.tr(context: context), style: TextStyle(fontSize: 16.f, fontWeight: FontWeight.bold)),
SizedBox(height: 12.h), SizedBox(height: 12.h),
Container( Container(
@ -199,7 +363,7 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
Divider(height: 20.h), Divider(height: 20.h),
_buildDetailRow(LocaleKeys.rcUrl.tr(context: context), _selectedPreset!.rcBaseUrl), _buildDetailRow(LocaleKeys.rcUrl.tr(context: context), _selectedPreset!.rcBaseUrl),
Divider(height: 20.h), Divider(height: 20.h),
_buildDetailRow(LocaleKeys.pharmacyApi.tr(context: context), _selectedPreset!.hmgPharmacyApiBaseUrl), _buildDetailRow('Payment URL', _selectedPreset!.serviceUrl),
Divider(height: 20.h), Divider(height: 20.h),
_buildDetailRow( _buildDetailRow(
LocaleKeys.payfortMode.tr(context: context), LocaleKeys.payfortMode.tr(context: context),
@ -273,7 +437,7 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
text: LocaleKeys.saveAndRestart.tr(context: context), text: LocaleKeys.saveAndRestart.tr(context: context),
icon: AppAssets.confirm, icon: AppAssets.confirm,
iconSize: 20.w, iconSize: 20.w,
onPressed: _selectedPreset != null ? _saveAndRestart : null, onPressed: (_selectedPreset != null || _isCustomMode) ? _saveAndRestart : null,
), ),
), ),
], ],
@ -323,10 +487,35 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
} }
Future<void> _saveAndRestart() async { Future<void> _saveAndRestart() async {
if (_selectedPreset == null) return;
try { 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 Navigator.pop(context, true); // Return true to indicate app should restart
Utils.showToast(LocaleKeys.envUpdateSuccess.tr(context: context)); Utils.showToast(LocaleKeys.envUpdateSuccess.tr(context: context));
} catch (e) { } catch (e) {

@ -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/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/todo_page.dart';
import 'package:hmg_patient_app_new/presentation/todo_section/widgets/ancillary_orders_list.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/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
@ -379,6 +381,41 @@ class _LandingPageState extends State<LandingPage> {
); );
}), }),
// 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<bool>(
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(() { // Utils.buildSvgWithAssets(icon: AppAssets.contact_icon, height: 24.h, width: 24.h).onPress(() {
// showCommonBottomSheetWithoutHeight( // showCommonBottomSheetWithoutHeight(
// context, // context,

@ -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/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/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.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/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/accessibility_page.dart';
import 'package:hmg_patient_app_new/presentation/profile_settings/widgets/profile_picture_widget.dart'; import 'package:hmg_patient_app_new/presentation/profile_settings/widgets/profile_picture_widget.dart';
@ -313,26 +311,6 @@ class ProfileSettingsState extends State<ProfileSettings> {
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: false), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: false),
child: Column( child: Column(
children: [ 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<bool>(
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), () { actionItem(AppAssets.call_fill, LocaleKeys.contactUs.tr(context: context), () {
launchUrl(Uri.parse("tel://" + "+966 92 006 6666")); launchUrl(Uri.parse("tel://" + "+966 92 006 6666"));
}, trailingLabel: "92 006 6666", isEnglishOnly: true), }, trailingLabel: "92 006 6666", isEnglishOnly: true),

@ -117,10 +117,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.4.0" version: "1.4.1"
chewie: chewie:
dependency: transitive dependency: transitive
description: description:
@ -145,6 +145,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.2" 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: collection:
dependency: transitive dependency: transitive
description: description:
@ -499,6 +507,14 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" 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: flutter_cache_manager:
dependency: transitive dependency: transitive
description: description:
@ -720,6 +736,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.1" 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: flutter_staggered_animations:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1341,26 +1365,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.17" version: "0.12.19"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.11.1" version: "0.13.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.0" version: "1.18.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1641,6 +1665,54 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.0" 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: scrollable_positioned_list:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1890,10 +1962,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.7" version: "0.7.11"
time: time:
dependency: transitive dependency: transitive
description: description:
@ -2175,5 +2247,5 @@ packages:
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
sdks: sdks:
dart: ">=3.9.0 <4.0.0" dart: ">=3.10.0-0 <4.0.0"
flutter: ">=3.35.0" flutter: ">=3.35.0"

Loading…
Cancel
Save