From 631fabad23a46a964ff2f27803ecdc2b57448a31 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Mar 2026 14:12:41 +0300 Subject: [PATCH 1/9] updates --- lib/features/lab/lab_repo.dart | 3 ++- .../livecare/immediate_livecare_payment_details.dart | 2 +- .../todo_section/widgets/ancillary_orders_list.dart | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/features/lab/lab_repo.dart b/lib/features/lab/lab_repo.dart index 285c7322..10839b12 100644 --- a/lib/features/lab/lab_repo.dart +++ b/lib/features/lab/lab_repo.dart @@ -249,7 +249,8 @@ class LabRepoImp implements LabRepo { GenericApiModel? apiResponse; Failure? failure; await apiClient.post( - Utils.isVidaPlusProject(int.parse(labOrder.projectID!)) ? SEND_LAB_RESULT_EMAIL : SEND_LAB_RESULT_EMAIL_NEW, + // Utils.isVidaPlusProject(int.parse(labOrder.projectID!)) ? SEND_LAB_RESULT_EMAIL : SEND_LAB_RESULT_EMAIL_NEW, + SEND_LAB_RESULT_EMAIL_NEW, body: mapDevice, onFailure: (error, statusCode, {messageStatus, failureType}) { failure = failureType; diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart index fb6ebe72..e6654f5e 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart @@ -84,7 +84,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { AppCustomChipWidget(labelText: "${appState.getAuthenticatedUser()!.age} ${LocaleKeys.yearsOld.tr(context: context)}"), AppCustomChipWidget( labelText: - "${LocaleKeys.clinic.tr()}: ${(appState.isArabic() ? immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceNameN : immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceName)!}"), + "${LocaleKeys.clinic.tr()}: ${(appState.isArabic() ? immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceNameN : immediateLiveCareVM.immediateLiveCareSelectedClinic.serviceName) ?? ""}"), ], ), ], diff --git a/lib/presentation/todo_section/widgets/ancillary_orders_list.dart b/lib/presentation/todo_section/widgets/ancillary_orders_list.dart index 58ee6d46..6a41252e 100644 --- a/lib/presentation/todo_section/widgets/ancillary_orders_list.dart +++ b/lib/presentation/todo_section/widgets/ancillary_orders_list.dart @@ -118,7 +118,7 @@ class AncillaryOrderCard extends StatelessWidget { : Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - "Ancillary Orders".toText14(isBold: true), + LocaleKeys.ancillaryOrdersList.tr(context: context).toText14(isBold: true), Row( children: [ LocaleKeys.viewAll.tr(context: context).toText12(color: AppColors.primaryRedColor), From 961a1f5b03426ffa6f816b6ea926a3c80bdba506 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Mar 2026 14:36:37 +0300 Subject: [PATCH 2/9] updates --- lib/core/utils/calendar_utils.dart | 316 ------------------ .../active_medication_page.dart | 25 +- 2 files changed, 19 insertions(+), 322 deletions(-) delete mode 100644 lib/core/utils/calendar_utils.dart diff --git a/lib/core/utils/calendar_utils.dart b/lib/core/utils/calendar_utils.dart deleted file mode 100644 index 8b21111f..00000000 --- a/lib/core/utils/calendar_utils.dart +++ /dev/null @@ -1,316 +0,0 @@ -import 'dart:async'; -import 'dart:collection'; -import 'dart:convert'; -import 'dart:io'; -import 'dart:ui'; - -import 'package:device_calendar/device_calendar.dart'; -import 'package:flutter/widgets.dart'; -import 'package:hmg_patient_app_new/core/dependencies.dart'; -import 'package:hmg_patient_app_new/core/utils/date_util.dart'; -import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; -import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_reminder_view.dart'; -import 'package:hmg_patient_app_new/services/dialog_service.dart'; -import 'package:hmg_patient_app_new/services/permission_service.dart'; -import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; -import 'package:jiffy/jiffy.dart'; -import 'package:manage_calendar_events/manage_calendar_events.dart' as ios; -import 'package:permission_handler/permission_handler.dart'; -import 'package:timezone/data/latest.dart' as tzl; - -final DeviceCalendarPlugin deviceCalendarPlugin = DeviceCalendarPlugin(); -final ios.CalendarPlugin _myPlugin = ios.CalendarPlugin(); - -class CalendarUtils { - static Completer? _completer; - - dynamic get writableCalendars => calendars.firstWhere((c) => !c.isReadOnly!); - dynamic calendars; - - CalendarUtils._(this.calendars); - - // static Future getInstance() async { - // if (_completer == null) { - // _completer = Completer(); - // print(_completer!.isCompleted); - // try { - // final dynamic calendarsResult; - // if (Platform.isIOS) { - // calendarsResult = await _myPlugin.getCalendars(); - // if (!_completer!.isCompleted) { - // _completer?.complete(CalendarUtils._(await calendarsResult!)); - // } - // } else { - // calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); - // if (!_completer!.isCompleted) { - // _completer?.complete(CalendarUtils._(await calendarsResult.data!)); - // } - // } - // } on Exception catch (e) { - // if (!_completer!.isCompleted) { - // _completer!.completeError(e); - // } - // } - // } - // return _completer!.future; - // } - - static Future getInstance() async { - tzl.initializeTimeZones(); - if (_completer != null) { - return _completer!.future; - } - _completer = Completer(); - try { - final dynamic calendarsResult; - if (Platform.isIOS) { - calendarsResult = await _myPlugin.getCalendars(); - _completer!.complete(CalendarUtils._(calendarsResult)); - } else { - calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); - _completer!.complete(CalendarUtils._(calendarsResult.data)); - } - } catch (e) { - _completer!.completeError(e); - } - - return _completer!.future; - } - - Future createOrUpdateEvents({List? scheduleList, String? title, String? description, List? scheduleDateTime, List? daysOfWeek}) async { - tzl.initializeTimeZones(); - List events = []; - Location _currentLocation; - if (DateTime.now().timeZoneName == "+04") - _currentLocation = getLocation('Asia/Dubai'); - else - _currentLocation = getLocation('Asia/Riyadh'); - - scheduleDateTime!.forEach((element) { - RecurrenceRule recurrenceRule = RecurrenceRule( - // RecurrenceFrequency.Daily, - // daysOfWeek: daysOfWeek, - // endDate: element, - until: element, frequency: Frequency.daily, - ); - //added byAamir Tz Time - Event event = Event(writableCalendars!.id, - recurrenceRule: recurrenceRule, - start: TZDateTime.from(element, _currentLocation), - end: TZDateTime.from(element.add(Duration(minutes: 30)), _currentLocation), - title: title, - description: description); - events.add(event); - }); - - events.forEach((element) { - deviceCalendarPlugin.createOrUpdateEvent(element); - }); - } - - Future createOrUpdateEvent({required String title, required String description, required String location, DateTime? scheduleDateTime, String? eventId}) async { - RecurrenceRule recurrenceRule = RecurrenceRule( - // RecurrenceFrequency.Daily, - // daysOfWeek: daysOfWeek, - // endDate: scheduleDateTime, - until: scheduleDateTime, frequency: Frequency.daily, - ); - - Location _currentLocation; - // if (DateTime.now().timeZoneName == "+04") - // _currentLocation = getLocation('Asia/Dubai'); - // else - _currentLocation = getLocation('Asia/Riyadh'); - - TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation); - - print("writableCalendars-name: " + writableCalendars.name); - print("writableCalendars-Id: " + writableCalendars.id); - print("writableCalendarsToString: " + writableCalendars.toString()); - print("writableCalendarsToString: " + writableCalendars!.id!); - Event event = Event( - writableCalendars!.id, - start: scheduleDateTimeUTZ, - end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), - title: title, - description: description, - ); - - ios.CalendarEvent iosCalEvent = - ios.CalendarEvent(location: location, startDate: scheduleDateTimeUTZ, endDate: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description, isAllDay: false); - - if (Platform.isAndroid) { - Result result = await deviceCalendarPlugin.hasPermissions(); - print(result); - await deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { - print("catchError " + e.toString()); - }).whenComplete(() { - print("whenComplete Calender ID " + eventId!); - }); - } else { - await _myPlugin.createEvent(calendarId: writableCalendars.id!, event: iosCalEvent).catchError((e) { - print("catchError " + e.toString()); - }).whenComplete(() { - print("whenComplete Calender ID iOS " + eventId!); - }); - } - } - - deleteEvent(String _calendarId, String _eventId) async { - if (Platform.isIOS) { - await _myPlugin.deleteEvent(calendarId: _calendarId, eventId: _eventId); - } else { - await deviceCalendarPlugin.deleteEvent(_calendarId, _eventId); - } - } - - Future retrieveEvents( - String calendarId, - RetrieveEventsParams retrieveEventsParams, - ) async { - if (Platform.isIOS) { - return await _myPlugin.getEvents(calendarId: calendarId); - } else { - return await deviceCalendarPlugin.retrieveEvents(calendarId, retrieveEventsParams); - } - } - - Future createCalendar( - String calendarName, { - Color? calendarColor, - String? localAccountName, - }) async { - return await deviceCalendarPlugin.createCalendar(calendarName, calendarColor: calendarColor, localAccountName: localAccountName); - } -} - -Future> requestPermissions() async { - var permissionResults = [Permission.calendarFullAccess].request(); - return permissionResults; -} - -showReminderBottomSheet(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, - {required Function() onSuccess, String? title, String? description, Function(int)? onMultiDateSuccess, bool isMultiAllowed = false}) async { - if (Platform.isAndroid) { - if (await PermissionService.isCalendarPermissionEnabled()) { - _showReminderBottomSheet(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess, isMultiAllowed: isMultiAllowed); - } else { - // Utils.showPermissionConsentDialog(context, TranslationBase.of(context).calendarPermission, () async { - // if (await Permission.calendarFullAccess.request().isGranted) { - // _showReminderDialog(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - // onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess, isMultiAllowed: isMultiAllowed); - // } - // }); - } - } else { - if (await Permission.calendarWriteOnly.request().isGranted) { - if (await Permission.calendarFullAccess.request().isGranted) { - _showReminderBottomSheet(context, dateTime, doctorName, eventId, appoDateFormatted, appoTimeFormatted, - onSuccess: onSuccess, title: title, description: description, onMultiDateSuccess: onMultiDateSuccess, isMultiAllowed: isMultiAllowed); - } - } - } -} - -Future _showReminderBottomSheet(BuildContext providedContext, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, - {required Function onSuccess, String? title, String? description, Function(int)? onMultiDateSuccess, bool? isMultiAllowed}) async { - showCommonBottomSheetWithoutHeight(providedContext, title: "Set the timer of reminder", child: PrescriptionReminderView( - setReminder: (int value) async { - if (!isMultiAllowed!) { - if (onMultiDateSuccess == null) { - CalendarUtils calendarUtils = await CalendarUtils.getInstance(); - await calendarUtils.createOrUpdateEvent( - title: title ?? "You have appointment with Dr. $doctorName", - description: description ?? "At $appoDateFormatted $appoTimeFormatted", - scheduleDateTime: dateTime, - eventId: eventId, - location: ''); - onSuccess(); - } - } else { - onMultiDateSuccess!(value); - } - }, - ), callBackFunc: () {}, isFullScreen: false); -} - -setCalender(BuildContext context, - {required String eventId, required int selectedMinutes, int? frequencyNumber, required int days, required String orderDate, required String itemDescriptionN, required String route}) async { - DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0); - frequencyNumber ??= 2; //Some time frequency number is null so by default will be 2 - - int remainingDays = days - (Jiffy.parseFromDateTime(DateTime.now()).diff(Jiffy.parseFromDateTime(DateUtil.convertStringToDate(orderDate)), unit: Unit.day) as int); - if (remainingDays.isNegative) { - getIt.get().showErrorBottomSheet(message: "Prescription date has been already passed you can not add a reminder for this prescription."); - return; - } - CalendarUtils calendarUtils = await CalendarUtils.getInstance(); - - try { - for (int i = 0; i < remainingDays; i++) { - //event for number of days. - for (int j = 0; j < frequencyNumber; j++) { - // event for number of times per day. - if (j != 0) { - actualDate.add(new Duration(hours: 8)); // 8 hours addition for daily dose. - } - //Time subtraction from actual reminder time. like before 30, or 1 hour. - - actualDate = Jiffy.parseFromDateTime(actualDate).subtract(minutes: selectedMinutes).dateTime; - - calendarUtils.createOrUpdateEvent( - title: "$itemDescriptionN} Prescription Reminder", - description: "$itemDescriptionN $frequencyNumber $route ", - scheduleDateTime: actualDate, - eventId: eventId + (i.toString() + j.toString()), - location: '', //event id with varitions - ); - print("Creating event #$j for day $i → $actualDate"); - actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0); - } - actualDate = Jiffy.parseFromDateTime(actualDate).add(days: 1).dateTime; - } - } catch (ex) { - getIt.get().showErrorBottomSheet(message: "catch:$ex"); - } -} - -Future checkAndRemove(hasReminder, {bool delete = false, String itemDescriptionN = ""}) async { - final ios.CalendarPlugin _myPlugin = ios.CalendarPlugin(); - CalendarUtils calendarUtils = await CalendarUtils.getInstance(); - DateTime startEventsDate = Jiffy.parseFromDateTime(DateTime.now()).subtract(days: 30).dateTime; - DateTime endEventsDate = Jiffy.parseFromDateTime(DateTime.now()).add(days: 120).dateTime; - RetrieveEventsParams params = RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); - - if (calendarUtils.calendars != null) { - if (Platform.isAndroid) { - await processEvents(calendarUtils.calendars, calendarUtils, params, delete, itemDescriptionN, hasReminder); - } else { - List? iosCalendars = await _myPlugin.getCalendars(); - if (iosCalendars != null) { - await processEvents(iosCalendars.map((cal) => Calendar(id: cal.id, name: cal.name, accountName: cal.accountName)).toList(), calendarUtils, params, delete, itemDescriptionN, hasReminder); - } - } - } -} - -Future processEvents(List calendars, calendarUtils, params, delete, String itemDescriptionN, hasReminder) async { - for (var calendar in calendars) { - Result> events = await calendarUtils.retrieveEvents(calendar.id!, params); - for (var event in events.data!) { - if (event.title!.contains(itemDescriptionN)) { - if (delete) { - await calendarUtils.deleteEvent(calendar, event); - // AppToast.showSuccessToast(message: TranslationBase.of(context).reminderCancelSuccess); - hasReminder = false; - } else { - hasReminder = false; - // setState(() { - // hasReminder = true; - // }); - } - } - } - } -} diff --git a/lib/presentation/active_medication/active_medication_page.dart b/lib/presentation/active_medication/active_medication_page.dart index be6b82a6..cb114cd4 100644 --- a/lib/presentation/active_medication/active_medication_page.dart +++ b/lib/presentation/active_medication/active_medication_page.dart @@ -2,11 +2,11 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; +import 'package:hmg_patient_app_new/core/utils/calender_utils_new.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:flutter/cupertino.dart'; import '../../core/app_assets.dart'; -import '../../core/utils/calendar_utils.dart'; import '../../features/active_prescriptions/active_prescriptions_view_model.dart'; import '../../features/active_prescriptions/models/active_prescriptions_response_model.dart'; import '../../generated/locale_keys.g.dart'; @@ -34,7 +34,6 @@ class _ActiveMedicationPageState extends State { List selectedDayMeds = []; ActivePrescriptionsViewModel? activePreVM; - Map medReminderStatus = {}; String _buildMedKey(ActivePrescriptionsResponseModel med) { @@ -773,6 +772,8 @@ class _ReminderTimerDialogState extends State { String bigTimeText = "00:00"; bool showPicker = false; + CalenderUtilsNew calender = CalenderUtilsNew.instance; + final List> presetTimes = [ ["06:00 AM", "07:00 AM", "08:00 AM", "09:00 AM"], // Morning ["12:00 PM", "01:00 PM", "02:00 PM", "03:00 PM"], // Noon @@ -972,16 +973,28 @@ class _ReminderTimerDialogState extends State { if (isPM && hour != 12) hour += 12; if (!isPM && hour == 12) hour = 0; int totalMinutes = hour * 60 + minute; - await setCalender( - context, - eventId: widget.med.itemId.toString(), - selectedMinutes: totalMinutes, + + await calender.createMultipleEvents( + reminderMinutes: totalMinutes, frequencyNumber: widget.frequencyNumber, days: widget.med.days ?? 1, orderDate: widget.med.orderDate ?? "", itemDescriptionN: widget.med.itemDescription ?? "", route: widget.med.route ?? "", + onFailure: (errorMessage) {}, + prescriptionNumber: widget.med.itemId.toString() ); + + // await setCalender( + // context, + // eventId: widget.med.itemId.toString(), + // selectedMinutes: totalMinutes, + // frequencyNumber: widget.frequencyNumber, + // days: widget.med.days ?? 1, + // orderDate: widget.med.orderDate ?? "", + // itemDescriptionN: widget.med.itemDescription ?? "", + // route: widget.med.route ?? "", + // ); ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text(LocaleKeys.reminderAddedToCalendar.tr())), ); From b4a7508f7c01ea8b2429f55f3655e37f33854bac Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 3 Mar 2026 14:34:12 +0300 Subject: [PATCH 3/9] updates --- .../book_appointment/doctor_profile_page.dart | 4 ++++ .../immediate_livecare_pending_request_page.dart | 2 +- .../widgets/tracker_last_value_card.dart | 12 +++++++++++- lib/routes/app_routes.dart | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/presentation/book_appointment/doctor_profile_page.dart b/lib/presentation/book_appointment/doctor_profile_page.dart index c62404ab..25cda6b6 100644 --- a/lib/presentation/book_appointment/doctor_profile_page.dart +++ b/lib/presentation/book_appointment/doctor_profile_page.dart @@ -172,6 +172,10 @@ class DoctorProfilePage extends StatelessWidget { child: CustomButton( text: LocaleKeys.viewAvailableAppointments.tr(), onPressed: () async { + bookAppointmentsViewModel.selectedDoctor.speciality = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty; + bookAppointmentsViewModel.selectedDoctor.specialityN = bookAppointmentsViewModel.doctorsProfileResponseModel.specialty; + bookAppointmentsViewModel.selectedDoctor.name = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName; + bookAppointmentsViewModel.selectedDoctor.name = bookAppointmentsViewModel.doctorsProfileResponseModel.doctorName; LoaderBottomSheet.showLoader(); bookAppointmentsViewModel.isLiveCareSchedule ? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots( diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart index 08543d23..da12f3ef 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart @@ -117,7 +117,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State UserInfoSelectionPage(), userInfoFlowManager: (context) => UserInfoFlowManager(), smartWatches: (context) => SmartwatchHomePage(), - huaweiHealthExample: (context) => HuaweiHealthExample(), + // huaweiHealthExample: (context) => HuaweiHealthExample(), covid19Test: (context) => Covid19LandingPage(), waterConsumptionPage: (context) => WaterConsumptionPage(), waterMonitorSettingsPage: (context) => WaterMonitorSettingsPage(), From 074c060e360970135fa5cb412234866ce34d1308 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 4 Mar 2026 15:31:33 +0300 Subject: [PATCH 4/9] Updates & fixes --- lib/core/api_consts.dart | 2 +- lib/core/utils/date_util.dart | 2 +- .../authentication/authentication_view_model.dart | 8 +++++--- lib/presentation/profile_settings/profile_settings.dart | 6 ++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 39132004..50016d0a 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT diff --git a/lib/core/utils/date_util.dart b/lib/core/utils/date_util.dart index 2b134735..87af0a27 100644 --- a/lib/core/utils/date_util.dart +++ b/lib/core/utils/date_util.dart @@ -493,7 +493,7 @@ class DateUtil { } static convertISODateToJsonDate(String isoDate) { - return "/Date(" + DateFormat('mm-dd-yyy').parse(isoDate).millisecondsSinceEpoch.toString() + ")/"; + return "/Date(" + DateFormat('mm-dd-yyy', "en-US").parse(isoDate).millisecondsSinceEpoch.toString() + ")/"; } static String getDay(DayOfWeek dayOfWeek) { diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 9a3fffc5..fe025f93 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -44,6 +44,7 @@ import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:sms_otp_auto_verify/sms_otp_auto_verify.dart'; +import '../insurance/insurance_view_model.dart'; import 'models/request_models/get_user_mobile_device_data.dart'; import 'models/request_models/insert_patient_mobile_deviceinfo.dart'; import 'models/request_models/patient_insert_device_imei_request.dart'; @@ -629,11 +630,12 @@ class AuthenticationViewModel extends ChangeNotifier { // medicalVm.getAllPendingRecordsByResponseId(); } await clearDefaultInputValues(); + myAppointmentsVM.setIsAppointmentDataToBeLoaded(true); + getIt.get().setIsInsuranceDataToBeLoaded(true); if (isUserAgreedBefore) { LoaderBottomSheet.hideLoader(); navigateToHomeScreen(); } else { - myAppointmentsVM.setIsAppointmentDataToBeLoaded(true); LoaderBottomSheet.hideLoader(); navigateToHomeScreen(); //Agreement page not designed yet so we are navigating to home screen directly @@ -833,8 +835,8 @@ class AuthenticationViewModel extends ChangeNotifier { } Future onRegistrationComplete() async { - // LoaderBottomSheet.showLoader(); - LoadingUtils.showFullScreenLoader(loadingText: "Setting up your medical file.\nMay take a moment."); + LoaderBottomSheet.showLoader(); + // LoadingUtils.showFullScreenLoader(loadingText: "Setting up your medical file.\nMay take a moment."); var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus); final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request); diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index 82150ca7..3a44d1fd 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; @@ -44,6 +45,9 @@ class ProfileSettings extends StatefulWidget { class ProfileSettingsState extends State { @override void initState() { + scheduleMicrotask(() { + insuranceViewModel.initInsuranceProvider(); + }); super.initState(); } @@ -81,9 +85,11 @@ class ProfileSettingsState extends State { int length = 3; final SwiperController _controller = SwiperController(); + late InsuranceViewModel insuranceViewModel; @override Widget build(BuildContext context) { + insuranceViewModel = Provider.of(context, listen: false); return CollapsingListView( title: LocaleKeys.profileAndSettings.tr(context: context), logout: () { From f46b3f745f60bd2dbf778b5a31a0bbe6aed10016 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 5 Mar 2026 16:22:08 +0300 Subject: [PATCH 5/9] Dark mode enabled --- assets/images/svg/dark_mode_icon.svg | 3 + assets/langs/ar-SA.json | 3 +- assets/langs/en-US.json | 3 +- lib/core/api/api_client.dart | 2 +- lib/core/app_assets.dart | 1 + lib/core/utils/utils.dart | 14 +- lib/extensions/string_extensions.dart | 4 +- lib/extensions/widget_extensions.dart | 14 +- .../models/ui_models/vital_sign_ui_model.dart | 2 +- .../profile_settings_view_model.dart | 12 +- lib/generated/locale_keys.g.dart | 3 +- lib/main.dart | 49 ++- .../active_medication_page.dart | 10 +- .../allergies/allergies_list_page.dart | 4 +- .../appointment_details_page.dart | 26 +- .../appointment_payment_page.dart | 1 + .../widgets/appointment_card.dart | 6 +- .../widgets/appointment_doctor_card.dart | 6 +- .../hospital_list_items.dart | 1 + .../region_bottomsheet/region_list_item.dart | 1 + .../region_list_widget.dart | 5 +- .../widgets/ask_doctor_appointment_card.dart | 2 +- lib/presentation/authentication/register.dart | 2 +- .../authentication/register_step2.dart | 2 +- .../book_appointment_page.dart | 42 +- .../doctor_filter/doctors_filter.dart | 2 +- .../book_appointment/doctor_profile_page.dart | 6 +- .../immediate_livecare_payment_details.dart | 2 +- .../immediate_livecare_payment_page.dart | 1 + .../widgets/select_livecare_call_type.dart | 2 +- .../review_appointment_page.dart | 2 +- .../waiting_appointment_payment_page.dart | 1 + .../widgets/appointment_calendar.dart | 8 +- .../book_appointment/widgets/clinic_card.dart | 2 +- .../book_appointment/widgets/doctor_card.dart | 2 +- .../widgets/doctor_rating_details.dart | 20 +- .../contact_us/live_chat_page.dart | 6 +- .../contact_us/widgets/find_us_item_card.dart | 4 +- .../covid19test/covid_payment_screen.dart | 1 + .../e_referral/new_e_referral.dart | 2 +- .../e_referral/widget/e-referral_otp.dart | 3 +- .../widget/e_referral_requester_form.dart | 7 +- .../RRT/rrt_request_type_select.dart | 2 +- .../call_ambulance/call_ambulance_page.dart | 2 +- .../widgets/type_selection_widget.dart | 2 + .../emergency_services_page.dart | 34 +- .../er_online_checkin_payment_page.dart | 1 + .../widget/ambulance_history_item.dart | 2 +- .../history/widget/rrt_item.dart | 2 +- .../widgets/nearestERItem.dart | 2 +- .../habib_wallet/recharge_wallet_page.dart | 10 +- .../wallet_payment_confirm_page.dart | 5 +- .../widgets/hospital_list_item.dart | 1 + .../health_calculators_page.dart | 20 +- .../widgets/bf.dart | 20 +- .../widgets/bmi.dart | 8 +- .../widgets/bmr.dart | 18 +- .../widgets/calories.dart | 18 +- .../widgets/crabs.dart | 8 +- .../widgets/ibw.dart | 12 +- .../widgets/ovulation.dart | 4 +- .../add_health_tracker_entry_page.dart | 2 +- .../health_trackers/health_trackers_page.dart | 2 +- .../hmg_services/services_page.dart | 4 +- .../hmg_services/services_view.dart | 1 + .../home/data/landing_page_data.dart | 11 +- .../home/data/service_card_data.dart | 10 +- .../home/widgets/habib_wallet_card.dart | 4 +- .../home/widgets/large_service_card.dart | 5 +- .../home/widgets/small_service_card.dart | 27 +- .../home_health_care/hhc_procedures_page.dart | 2 +- .../LabResultByClinic.dart | 6 +- .../ai_analysis_widget.dart | 8 +- .../lab_ai_analysis_detailed_page.dart | 2 +- lib/presentation/lab/search_lab_report.dart | 5 +- .../medical_file/medical_file_page.dart | 60 +-- .../medical_file/widgets/lab_rad_card.dart | 1 + .../widgets/medical_file_card.dart | 2 +- .../widgets/patient_sick_leave_card.dart | 6 +- .../medical_report/medical_reports_page.dart | 4 +- .../monthly_report/monthly_report.dart | 2 +- .../widgets/invoice_list_card.dart | 2 +- .../prescription_detail_page.dart | 4 +- .../prescriptions/prescription_item_view.dart | 2 +- .../profile_settings/profile_settings.dart | 42 +- .../radiology/radiology_result_page.dart | 8 +- .../radiology/search_radiology.dart | 5 +- .../smartwatches/widgets/health_chart.dart | 2 +- .../possible_conditions_screen.dart | 2 +- .../symptoms_checker/risk_factors_screen.dart | 2 +- .../symptoms_checker/suggestions_screen.dart | 2 +- .../symptoms_selector_screen.dart | 2 +- .../symptoms_checker/triage_screen.dart | 2 +- .../widgets/organ_dot_widget.dart | 2 +- .../ancillary_order_payment_page.dart | 1 + .../ancillary_procedures_details_page.dart | 2 +- .../water_monitor/water_consumption_page.dart | 2 +- .../water_monitor_settings_page.dart | 2 +- lib/theme/app_theme.dart | 53 ++- lib/theme/colors.dart | 408 +++++++++++++----- lib/widgets/appbar/app_bar_widget.dart | 2 +- lib/widgets/appbar/collapsing_toolbar.dart | 2 +- lib/widgets/arrow_back.dart | 7 +- .../bottom_navigation/bottom_navigation.dart | 28 +- lib/widgets/bottom_sheet.dart | 5 +- lib/widgets/buttons/default_button.dart | 3 +- lib/widgets/chip/app_custom_chip_widget.dart | 32 +- lib/widgets/chip/custom_selectable_chip.dart | 7 +- lib/widgets/common_bottom_sheet.dart | 9 +- lib/widgets/countdown_timer.dart | 3 +- lib/widgets/custom_tab_bar.dart | 32 +- .../date_range_calender.dart | 8 +- lib/widgets/datepicker_widget.dart | 2 +- lib/widgets/dialogs/confirm_dialog.dart | 4 +- .../dropdown/country_dropdown_widget.dart | 4 +- lib/widgets/dropdown/dropdown_widget.dart | 12 +- lib/widgets/expandable_list_widget.dart | 11 +- .../family_files/family_file_add_widget.dart | 2 +- lib/widgets/graph/custom_graph.dart | 39 +- lib/widgets/image_picker.dart | 7 +- lib/widgets/input_widget.dart | 4 +- lib/widgets/loader/bottomsheet_loader.dart | 5 +- lib/widgets/map/map_utility_screen.dart | 2 +- lib/widgets/nfc/nfc_reader_sheet.dart | 2 +- 124 files changed, 823 insertions(+), 578 deletions(-) create mode 100644 assets/images/svg/dark_mode_icon.svg diff --git a/assets/images/svg/dark_mode_icon.svg b/assets/images/svg/dark_mode_icon.svg new file mode 100644 index 00000000..f3a03f1c --- /dev/null +++ b/assets/images/svg/dark_mode_icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 3635e650..0886f376 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1581,5 +1581,6 @@ "invalidInsurance": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح.", "continueCash": "متابعة الدفع نقدًا", "timeFor": "الوقت", - "hmgPolicies": "سياسات مجموعة الحبيب الطبية" + "hmgPolicies": "سياسات مجموعة الحبيب الطبية", + "darkMode": "المظهر الداكن" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 15d78000..294201db 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1574,5 +1574,6 @@ "invalidInsurance": "You cannot make online payment because you do not have a valid insurance.", "continueCash": "Continue as cash", "timeFor": "Time For", - "hmgPolicies": "HMG Policies" + "hmgPolicies": "HMG Policies", + "darkMode": "Dark Mode" } diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index f9c44e76..106b8fd4 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -195,7 +195,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 4773922; + // body['PatientID'] = 4772997; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart index 942eb46b..efe62775 100644 --- a/lib/core/app_assets.dart +++ b/lib/core/app_assets.dart @@ -331,6 +331,7 @@ class AppAssets { static const String doctorResponseIcon = '$svgBasePath/doctor_response_icon.svg'; static const String changeLanguageHomePageIcon = '$svgBasePath/change_language_home_page.svg'; static const String aiOverView = '$svgBasePath/ai_overview.svg'; + static const String darkModeIcon = '$svgBasePath/dark_mode_icon.svg'; // PNGS // static const String hmgLogo = '$pngBasePath/hmg_logo.png'; diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 8b5b2849..0d600bd7 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -664,10 +664,12 @@ class Utils { double width = 24, double height = 24, BoxFit fit = BoxFit.cover, + bool applyThemeColor = true, }) { + final Color? resolvedColor = iconColor ?? (applyThemeColor && AppColors.isDarkMode ? AppColors.textColor : null); return SvgPicture.asset( icon, - colorFilter: iconColor != null ? ColorFilter.mode(isDisabled ? iconColor.withOpacity(0.5) : iconColor, BlendMode.srcIn) : null, + colorFilter: resolvedColor != null ? ColorFilter.mode(isDisabled ? resolvedColor.withOpacity(0.5) : resolvedColor, BlendMode.srcIn) : null, width: width, height: height, fit: fit, @@ -801,11 +803,13 @@ class Utils { double? fontSize, double? letterSpacing, FontWeight? fontWeight, - Color iconColor = AppColors.textColor, - Color textColor = AppColors.blackColor, + Color? iconColor, + Color? textColor, bool isSaudiCurrency = true, bool isExpanded = true, }) { + final resolvedIconColor = iconColor ?? AppColors.textColor; + final resolvedTextColor = textColor ?? AppColors.blackColor; return RichText( maxLines: 1, text: TextSpan( @@ -813,13 +817,13 @@ class Utils { WidgetSpan( alignment: PlaceholderAlignment.baseline, baseline: TextBaseline.alphabetic, - child: Utils.buildSvgWithAssets(icon: AppAssets.saudi_riyal_icon, width: iconSize.h, height: iconSize.h, iconColor: iconColor), + child: Utils.buildSvgWithAssets(icon: AppAssets.saudi_riyal_icon, width: iconSize.h, height: iconSize.h, iconColor: resolvedIconColor), ), TextSpan( // text: NumberFormat.currency(locale: 'en_US', symbol: " ", decimalDigits: 0).format(habibWalletAmount), text: " ${habibWalletAmount.toStringAsFixed(2)}", style: TextStyle( - color: textColor, + color: resolvedTextColor, fontSize: fontSize ?? 32.f, letterSpacing: letterSpacing ?? -4, fontFamily: "Poppins", diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 792bff50..ba646cd2 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -234,7 +234,7 @@ extension EmailValidator on String { TextOverflow? textOverflow, String? fontFamily, double? letterSpacing = -0.4, - Color decorationColor = AppColors.errorColor}) => + Color? decorationColor}) => Text( this, maxLines: maxlines, @@ -249,7 +249,7 @@ extension EmailValidator on String { fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), decoration: isUnderLine ? TextDecoration.underline : null, fontFamily: fontFamily ?? (isEnglishOnly ? "Poppins" : getIt.get().getLanguageCode() == "ar" ? 'GESSTwo' : 'Poppins'), - decorationColor: decorationColor), + decorationColor: decorationColor ?? AppColors.errorColor), ); Widget toText17({bool isEnglishOnly = false, Color? color, bool isBold = false, bool isCenter = false}) => Text( diff --git a/lib/extensions/widget_extensions.dart b/lib/extensions/widget_extensions.dart index 58754dc9..64672f5f 100644 --- a/lib/extensions/widget_extensions.dart +++ b/lib/extensions/widget_extensions.dart @@ -28,10 +28,10 @@ extension WidgetExtensions on Widget { Widget toShimmer({bool isShow = true, bool isTransparent = false}) => isShow ? Shimmer.fromColors( - baseColor: Color(0xffb9bebe), - highlightColor: Colors.white, + baseColor: AppColors.shimmerBaseColor, + highlightColor: AppColors.shimmerHighlightColor, child: Container( - color: isTransparent ? Colors.transparent : Colors.white.withOpacity(0.3), + color: isTransparent ? Colors.transparent : AppColors.whiteColor.withOpacity(0.3), child: this, ), ) @@ -41,14 +41,14 @@ extension WidgetExtensions on Widget { Widget toShimmer2({bool isShow = true, double radius = 20, double? width, double? height}) => isShow ? Shimmer.fromColors( - baseColor: const Color(0xffe8eff0), - highlightColor: Colors.white, + baseColor: AppColors.shimmerBaseColor, + highlightColor: AppColors.shimmerHighlightColor, child: ClipRRect( borderRadius: BorderRadius.circular(radius), child: Container( width: width, height: height, - color: Colors.white, + color: AppColors.whiteColor, child: this, ), ), @@ -69,7 +69,7 @@ extension WidgetExtensions on Widget { return Container( padding: disablePadding ? EdgeInsets.zero : const EdgeInsets.only(top: 15, bottom: 15, left: 14, right: 14), decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(radius), boxShadow: [ BoxShadow( diff --git a/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart b/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart index 45b0ab65..328ffc93 100644 --- a/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart +++ b/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart @@ -40,7 +40,7 @@ class VitalSignUiModel { } if (s.contains('high')) { - return const VitalSignUiModel( + return VitalSignUiModel( iconBg: AppColors.chipSecondaryLightRedColor, iconFg: AppColors.primaryRedColor, chipBg: AppColors.chipSecondaryLightRedColor, diff --git a/lib/features/profile_settings/profile_settings_view_model.dart b/lib/features/profile_settings/profile_settings_view_model.dart index 61acb260..2f788c69 100644 --- a/lib/features/profile_settings/profile_settings_view_model.dart +++ b/lib/features/profile_settings/profile_settings_view_model.dart @@ -1,8 +1,18 @@ import 'package:flutter/foundation.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; class ProfileSettingsViewModel extends ChangeNotifier { + bool _isDarkMode = false; - void notify(){ + bool get isDarkMode => _isDarkMode; + + void toggleDarkMode(bool value) { + _isDarkMode = value; + AppColors.isDarkMode = value; + notifyListeners(); + } + + void notify() { notifyListeners(); } } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 78d7f8a3..58639f9c 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1573,7 +1573,8 @@ abstract class LocaleKeys { static const invalidEligibility = 'invalidEligibility'; static const invalidInsurance = 'invalidInsurance'; static const continueCash = 'continueCash'; + static const timeFor = 'timeFor'; static const hmgPolicies = 'hmgPolicies'; + static const darkMode = 'darkMode'; - static const timeFor = 'Time for'; } diff --git a/lib/main.dart b/lib/main.dart index cff0d043..023404a6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -62,6 +62,9 @@ Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { getIt.get().logInfo("Firebase backgroundMessageHandler Main!!!"); } +// flutter3_32 pub run easy_localization:generate -O ./lib/generated -f keys -o locale_keys.g.dart --source-dir ./assets/langs + + class MyHttpOverrides extends HttpOverrides { @override HttpClient createHttpClient(SecurityContext? context) { @@ -247,27 +250,35 @@ class MyApp extends StatelessWidget { return Sizer( builder: (context, orientation, deviceType) { // SizeConfig().init(constraints, orientation); - return MaterialApp( - // title: 'Dr. AlHabib', - title: 'Dr. AlHabib Beta', - builder: (context, mchild) { - return MediaQuery( - data: MediaQuery.of(context).copyWith( - textScaler: TextScaler.noScaling, - alwaysUse24HourFormat: true, - ), - child: mchild!, + return Consumer( + builder: (context, profileVm, _) { + final isArabic = EasyLocalization.of(context)?.locale.languageCode == "ar"; + return MaterialApp( + key: ValueKey('app_theme_${profileVm.isDarkMode}'), + // title: 'Dr. AlHabib', + title: 'Dr. AlHabib Beta', + builder: (context, mchild) { + return MediaQuery( + data: MediaQuery.of(context).copyWith( + textScaler: TextScaler.noScaling, + alwaysUse24HourFormat: true, + ), + child: mchild!, + ); + }, + showSemanticsDebugger: false, + debugShowCheckedModeBanner: false, + localizationsDelegates: context.localizationDelegates, + supportedLocales: context.supportedLocales, + locale: context.locale, + initialRoute: AppRoutes.initialRoute, + routes: AppRoutes.routes, + theme: AppTheme.getTheme(isArabic), + darkTheme: AppTheme.getDarkTheme(isArabic), + themeMode: profileVm.isDarkMode ? ThemeMode.dark : ThemeMode.light, + navigatorKey: getIt.get().navigatorKey, ); }, - showSemanticsDebugger: false, - debugShowCheckedModeBanner: false, - localizationsDelegates: context.localizationDelegates, - supportedLocales: context.supportedLocales, - locale: context.locale, - initialRoute: AppRoutes.initialRoute, - routes: AppRoutes.routes, - theme: AppTheme.getTheme(EasyLocalization.of(context)?.locale.languageCode == "ar"), - navigatorKey: getIt.get().navigatorKey, ); }, ); diff --git a/lib/presentation/active_medication/active_medication_page.dart b/lib/presentation/active_medication/active_medication_page.dart index cb114cd4..ae46d402 100644 --- a/lib/presentation/active_medication/active_medication_page.dart +++ b/lib/presentation/active_medication/active_medication_page.dart @@ -171,7 +171,7 @@ class _ActiveMedicationPageState extends State { offset: const Offset(0, -4), child: Text( _getSuffix(selectedDate.day), - style: const TextStyle( + style: TextStyle( fontSize: 12, color: AppColors.textColor, fontWeight: FontWeight.w500, @@ -181,7 +181,7 @@ class _ActiveMedicationPageState extends State { ), TextSpan( text: " ${DateFormat.MMMM().format(selectedDate)}", - style: const TextStyle( + style: TextStyle( color: AppColors.textColor, fontSize: 16, fontWeight: FontWeight.w500, @@ -278,7 +278,7 @@ class _ActiveMedicationPageState extends State { ), ], ).paddingOnly(left: 16, right: 16), - const Divider( + Divider( color: AppColors.greyColor), GestureDetector( onTap: () => showDoseDialog(med), @@ -330,7 +330,7 @@ class _ActiveMedicationPageState extends State { ], ).paddingAll(16), ), - const Divider( + Divider( color: AppColors.greyColor), _buildButtons(), ], @@ -657,7 +657,7 @@ class _ActiveMedicationPageState extends State { builder: (_) => Container( width: double.infinity, height: 460.h, - decoration: const BoxDecoration( + decoration: BoxDecoration( color: AppColors.bottomSheetBgColor, borderRadius: BorderRadius.only( topLeft: Radius.circular(24), diff --git a/lib/presentation/allergies/allergies_list_page.dart b/lib/presentation/allergies/allergies_list_page.dart index adb63f02..06ae2713 100644 --- a/lib/presentation/allergies/allergies_list_page.dart +++ b/lib/presentation/allergies/allergies_list_page.dart @@ -56,7 +56,7 @@ class AllergiesListPage extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.allergy_info_icon, width: 36.w, height: 36.h, fit: BoxFit.contain).toShimmer2(isShow: true), + Utils.buildSvgWithAssets(icon: AppAssets.allergy_info_icon, width: 36.w, height: 36.h, fit: BoxFit.contain, applyThemeColor: false).toShimmer2(isShow: true), SizedBox(width: 16.h), Expanded( child: Column( @@ -100,7 +100,7 @@ class AllergiesListPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.allergy_info_icon, width: 36.w, height: 36.h, fit: BoxFit.contain), + Utils.buildSvgWithAssets(icon: AppAssets.allergy_info_icon, width: 36.w, height: 36.h, fit: BoxFit.contain, applyThemeColor: false), SizedBox(height: 16.h), Row( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index e5961e30..cafb740e 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -241,13 +241,13 @@ class _AppointmentDetailsPageState extends State { }, backgroundColor: AppColors.successColor, borderColor: AppColors.successColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 14.f, fontWeight: FontWeight.w500, borderRadius: 12.r, height: 40.h, icon: AppAssets.confirm_appointment_icon, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 16.h, ) : SizedBox.shrink()) @@ -305,16 +305,16 @@ class _AppointmentDetailsPageState extends State { } }, text: LocaleKeys.getDirections.tr(context: context), - backgroundColor: AppColors.textColor.withValues(alpha: 0.8), + backgroundColor: AppColors.bookAppointment.withValues(alpha: 0.8), borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withValues(alpha: 0.01), - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 14.f, fontWeight: FontWeight.w500, borderRadius: 12.r, padding: EdgeInsets.symmetric(horizontal: 10.w), height: 40.h, icon: AppAssets.directions_icon, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 14.h, ).paddingAll(12.h), ), @@ -353,7 +353,7 @@ class _AppointmentDetailsPageState extends State { child: Row( mainAxisSize: MainAxisSize.max, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h), + Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h, applyThemeColor: false), SizedBox(width: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -841,15 +841,15 @@ class _AppointmentDetailsPageState extends State { }, backgroundColor: AppColors.successColor, borderColor: AppColors.successColor, - textColor: AppColors.whiteColor, - fontSize: 16.f, + textColor: Colors.white, + fontSize: 16.f, fontWeight: FontWeight.w500, borderRadius: 12.r, padding: EdgeInsets.symmetric(horizontal: 10.w), height: 50.h, icon: AppAssets.add_icon, - iconColor: AppColors.whiteColor, - iconSize: 18.h, + iconColor: Colors.white, + iconSize: 18.h, ).paddingSymmetrical(16.h, 24.h) : SizedBox.shrink() : CustomButton( @@ -860,14 +860,14 @@ class _AppointmentDetailsPageState extends State { backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction), borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01), - textColor: widget.patientAppointmentHistoryResponseModel.nextAction == 15 ? AppColors.textColor : AppColors.whiteColor, + textColor: widget.patientAppointmentHistoryResponseModel.nextAction == 15 ? AppColors.textColor : Colors.white, fontSize: 16.f, fontWeight: FontWeight.w500, borderRadius: 12.r, padding: EdgeInsets.symmetric(horizontal: 10.w), height: 56.h, icon: AppointmentType.getNextActionIcon(widget.patientAppointmentHistoryResponseModel.nextAction), - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 18.h, ).paddingSymmetrical(16.h, 24.h), ], @@ -904,7 +904,7 @@ class _AppointmentDetailsPageState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16.f, fontWeight: FontWeight.w500, borderRadius: 12.r, diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index e70ddf49..d762f795 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -318,6 +318,7 @@ class _AppointmentPaymentPageState extends State { width: 200.h, height: 80.h, fit: BoxFit.contain, + applyThemeColor: false ).paddingSymmetrical(24.h, 0.h).onPress(() { // payfortVM.setIsApplePayConfigurationLoading(true); if (Utils.havePrivilege(103)) { diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 971e9ca8..89a18bf5 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -96,10 +96,10 @@ class AppointmentCard extends StatelessWidget { children: [ AppCustomChipWidget( icon: isLoading ? AppAssets.walkin_appointment_icon : (isLiveCare ? AppAssets.small_livecare_icon : AppAssets.walkin_appointment_icon), - iconColor: isLoading ? AppColors.textColor : (isLiveCare ? AppColors.whiteColor : AppColors.textColor), + iconColor: isLoading ? AppColors.textColor : (isLiveCare ? Colors.white : AppColors.textColor), labelText: isLoading ? LocaleKeys.walkin.tr(context: context) : (isLiveCare ? LocaleKeys.livecare.tr(context: context) : LocaleKeys.walkin.tr(context: context)), backgroundColor: isLoading ? AppColors.greyColor : (isLiveCare ? AppColors.successColor : AppColors.greyColor), - textColor: isLoading ? AppColors.textColor : (isLiveCare ? AppColors.whiteColor : AppColors.textColor), + textColor: isLoading ? AppColors.textColor : (isLiveCare ? Colors.white : AppColors.textColor), ).toShimmer2(isShow: isLoading), AppCustomChipWidget( labelText: @@ -145,7 +145,7 @@ class AppointmentCard extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h), + Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, iconColor: AppColors.ratingColorYellow), SizedBox(height: 2.h), (isFoldable || isTablet) ? "${patientAppointmentHistoryResponseModel.decimalDoctorRate}".toText9(isBold: true, color: AppColors.textColor) diff --git a/lib/presentation/appointments/widgets/appointment_doctor_card.dart b/lib/presentation/appointments/widgets/appointment_doctor_card.dart index 467ba640..298e8732 100644 --- a/lib/presentation/appointments/widgets/appointment_doctor_card.dart +++ b/lib/presentation/appointments/widgets/appointment_doctor_card.dart @@ -68,7 +68,7 @@ class AppointmentDoctorCard extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h), + Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, iconColor: AppColors.ratingColorYellow), SizedBox(height: 2.h), "${patientAppointmentHistoryResponseModel.decimalDoctorRate ?? 0.0}".toText11(isBold: true, color: AppColors.textColor), ], @@ -115,13 +115,13 @@ class AppointmentDoctorCard extends StatelessWidget { icon: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppAssets.walkin_appointment_icon : AppAssets.small_livecare_icon, - iconColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor, + iconColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : Colors.white, labelText: patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? LocaleKeys.livecare.tr(context: context) : LocaleKeys.walkin.tr(context: context), backgroundColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.greyColor : AppColors.successColor, - textColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : AppColors.whiteColor, + textColor: !patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? AppColors.textColor : Colors.white, ), ], ), diff --git a/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart b/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart index 5d9ed8db..b0a717b7 100644 --- a/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart +++ b/lib/presentation/appointments/widgets/hospital_bottom_sheet/hospital_list_items.dart @@ -56,6 +56,7 @@ class HospitalListItem extends StatelessWidget { children: [ Utils.buildSvgWithAssets( icon: (hospitalData?.isHMC == true) ? AppAssets.hmc : AppAssets.hmg, + applyThemeColor: false, ).paddingOnly(right: 10), Expanded( child: Text( diff --git a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_item.dart b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_item.dart index 969e23af..99f31be6 100644 --- a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_item.dart +++ b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_item.dart @@ -63,6 +63,7 @@ class RegionListItem extends StatelessWidget { iconSize: 14.h, icon: svgPath, iconHasColor: false, + applyThemeColor: false, richText: RichText( text: TextSpan( text: count, diff --git a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart index 6588c2ea..fad96965 100644 --- a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart +++ b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart @@ -7,6 +7,7 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/region_bottomsheet/region_list_item.dart' show RegionListItem; +import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; import '../../../../widgets/common_bottom_sheet.dart'; @@ -52,8 +53,8 @@ class _RegionBottomSheetBodyState extends State { if (myAppointmentsVM.isRegionListLoading) { return Container( height: MediaQuery.of(context).size.height * 0.3, - decoration: const BoxDecoration( - color: Colors.white, + decoration: BoxDecoration( + color: AppColors.whiteColor, borderRadius: BorderRadius.vertical(top: Radius.circular(16)), ), child: Center( diff --git a/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart b/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart index 4ff24c7a..e4185e72 100644 --- a/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart +++ b/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart @@ -109,7 +109,7 @@ class AskDoctorAppointmentCard extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h), + Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false), SizedBox(height: 2.h), "${askDoctorAppointmentHistoryList.decimalDoctorRate}".toText11(isBold: true, color: AppColors.textColor), ], diff --git a/lib/presentation/authentication/register.dart b/lib/presentation/authentication/register.dart index 2a26a726..9d67920f 100644 --- a/lib/presentation/authentication/register.dart +++ b/lib/presentation/authentication/register.dart @@ -85,7 +85,7 @@ class _RegisterNew extends State { Directionality( textDirection: Directionality.of(context), child: Container( - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24)), padding: EdgeInsets.symmetric(horizontal: 16.h), child: Column( children: [ diff --git a/lib/presentation/authentication/register_step2.dart b/lib/presentation/authentication/register_step2.dart index c4bdf0f9..f4968850 100644 --- a/lib/presentation/authentication/register_step2.dart +++ b/lib/presentation/authentication/register_step2.dart @@ -76,7 +76,7 @@ class _RegisterNew extends State { LocaleKeys.personalDetailsVerification.tr(context: context).toText26(color: AppColors.textColor, weight: FontWeight.w600, letterSpacing: -2), SizedBox(height: 24.h), Container( - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24)), padding: EdgeInsets.only(left: 16.h, right: 16.h), child: Column( children: [ diff --git a/lib/presentation/book_appointment/book_appointment_page.dart b/lib/presentation/book_appointment/book_appointment_page.dart index 03de8332..ab548449 100644 --- a/lib/presentation/book_appointment/book_appointment_page.dart +++ b/lib/presentation/book_appointment/book_appointment_page.dart @@ -230,7 +230,7 @@ class _BookAppointmentPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.search_by_clinic_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.search_by_clinic_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -262,7 +262,7 @@ class _BookAppointmentPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.search_by_doctor_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.search_by_doctor_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -292,7 +292,7 @@ class _BookAppointmentPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.search_by_region_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.search_by_region_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -336,9 +336,9 @@ class _BookAppointmentPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.search_by_clinic_icon, width: 40.h, height: 40.h), - SizedBox(width: 12.h), - Column( + Utils.buildSvgWithAssets(icon: AppAssets.search_by_clinic_icon, width: 40.h, height: 40.h, applyThemeColor: false), + SizedBox(width: 12.h), + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.immediateConsultation.tr(context: context).toText14(color: AppColors.textColor, weight: FontWeight.w500), @@ -378,9 +378,9 @@ class _BookAppointmentPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.search_by_doctor_icon, width: 40.h, height: 40.h), - SizedBox(width: 12.h), - Column( + Utils.buildSvgWithAssets(icon: AppAssets.search_by_doctor_icon, width: 40.h, height: 40.h, applyThemeColor: false), + SizedBox(width: 12.h), + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.scheduledConsultation.tr(context: context).toText14(color: AppColors.textColor, weight: FontWeight.w500), @@ -400,30 +400,6 @@ class _BookAppointmentPageState extends State { ), ); }), - // SizedBox(height: 16.h), - // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.1), height: 1.h), - // SizedBox(height: 16.h), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Row( - // children: [ - // Utils.buildSvgWithAssets(icon: AppAssets.search_by_region_icon, width: 40.h, height: 40.h), - // SizedBox(width: 12.h), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // LocaleKeys.pharmaLiveCare.tr(context: context).toText14(color: AppColors.textColor, weight: FontWeight.w500), - // "".toText12(color: AppColors.primaryRedColor, fontWeight: FontWeight.w500), - // ], - // ), - // ], - // ), - // Transform.flip(flipX: appState.isArabic(), child: Utils.buildSvgWithAssets(icon: AppAssets.forward_arrow_icon, iconColor: AppColors.textColor, width: 40.h, height: 40.h)), - // ], - // ).onPress(() { - // openRegionListBottomSheet(context, RegionBottomSheetType.FOR_REGION); - // }), ], ), ), diff --git a/lib/presentation/book_appointment/doctor_filter/doctors_filter.dart b/lib/presentation/book_appointment/doctor_filter/doctors_filter.dart index d9aa9e5e..9cfcc1f8 100644 --- a/lib/presentation/book_appointment/doctor_filter/doctors_filter.dart +++ b/lib/presentation/book_appointment/doctor_filter/doctors_filter.dart @@ -159,7 +159,7 @@ class DoctorsFilters extends StatelessWidget{ Spacer(), DecoratedBox( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, customBorder: BorderRadius.only(topLeft: Radius.circular(24.h), topRight: Radius.circular(24.h)) , ), diff --git a/lib/presentation/book_appointment/doctor_profile_page.dart b/lib/presentation/book_appointment/doctor_profile_page.dart index 25cda6b6..4b2d4dbb 100644 --- a/lib/presentation/book_appointment/doctor_profile_page.dart +++ b/lib/presentation/book_appointment/doctor_profile_page.dart @@ -106,6 +106,7 @@ class DoctorProfilePage extends StatelessWidget { width: 48.w, height: 48.h, fit: BoxFit.contain, + applyThemeColor: false ), SizedBox(height: 16.h), "Ratings".toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), @@ -132,6 +133,7 @@ class DoctorProfilePage extends StatelessWidget { width: 48.w, height: 48.h, fit: BoxFit.contain, + applyThemeColor: false ), SizedBox(height: 16.h), "Reviews".toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), @@ -227,14 +229,14 @@ class DoctorProfilePage extends StatelessWidget { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 50.h, icon: AppAssets.calendar, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 20.h, ).paddingSymmetrical(24.h, 24.h), ), diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart index e6654f5e..7c2784de 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_details.dart @@ -110,7 +110,7 @@ class ImmediateLiveCarePaymentDetails extends StatelessWidget { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: getLiveCareTypeIcon(immediateLiveCareVM.liveCareSelectedCallType), width: 32.h, height: 32.h, fit: BoxFit.contain), + Utils.buildSvgWithAssets(icon: getLiveCareTypeIcon(immediateLiveCareVM.liveCareSelectedCallType), width: 32.h, height: 32.h, fit: BoxFit.contain, applyThemeColor: false), SizedBox(width: 8.h), getLiveCareType(context, immediateLiveCareVM.liveCareSelectedCallType).toText16(isBold: true), ], diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart index 73da69f5..4018b42a 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart @@ -292,6 +292,7 @@ class _ImmediateLiveCarePaymentPageState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16, fontWeight: FontWeight.w500, borderRadius: 12, diff --git a/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart b/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart index abd8d102..663fd5b4 100644 --- a/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart +++ b/lib/presentation/book_appointment/waiting_appointment/waiting_appointment_payment_page.dart @@ -313,6 +313,7 @@ class _WaitingAppointmentPaymentPageState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16.f, fontWeight: FontWeight.w500, borderRadius: 10.r, @@ -344,7 +344,7 @@ class TimeSlotChip extends StatelessWidget { ? Container( padding: EdgeInsets.symmetric(horizontal: 14.h, vertical: 8.h), decoration: ShapeDecoration( - color: isSelected ? AppColors.warningColorYellow : AppColors.whiteColor, + color: isSelected ? AppColors.warningColorYellow : AppColors.textColor, shape: SmoothRectangleBorder( borderRadius: BorderRadius.circular(8.h), smoothness: 1, @@ -367,8 +367,8 @@ class TimeSlotChip extends StatelessWidget { ), ), child: label.toText12( - color: isSelected ? AppColors.primaryRedColor : Colors.black87, - fontWeight: FontWeight.w500, + color: isSelected ? AppColors.primaryRedColor : AppColors.textColor, + fontWeight: FontWeight.w500, ), ), ); diff --git a/lib/presentation/book_appointment/widgets/clinic_card.dart b/lib/presentation/book_appointment/widgets/clinic_card.dart index 7e3c8df1..e7a6ca3a 100644 --- a/lib/presentation/book_appointment/widgets/clinic_card.dart +++ b/lib/presentation/book_appointment/widgets/clinic_card.dart @@ -34,7 +34,7 @@ class ClinicCard extends StatelessWidget { Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Utils.buildSvgWithAssets(icon: "assets/images/clinicIcons/${clinicsListResponseModel.clinicID ?? 1}.svg", width: 24.w, height: 24.h, fit: BoxFit.contain).toShimmer2(isShow: isLoading), (clinicsListResponseModel.isLiveCareClinicAndOnline ?? true) - ? Utils.buildSvgWithAssets(icon: AppAssets.livecare_clinic_icon, width: 32.w, height: 32.h, fit: BoxFit.contain).toShimmer2(isShow: isLoading) + ? Utils.buildSvgWithAssets(icon: AppAssets.livecare_clinic_icon, width: 32.w, height: 32.h, fit: BoxFit.contain, applyThemeColor: false).toShimmer2(isShow: isLoading) : SizedBox.shrink(), ], ), diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index ddb43e9d..9e3c69d1 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -72,7 +72,7 @@ class DoctorCard extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h), + Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false), SizedBox(height: 2.h), "${isLoading ? 4.78 : doctorsListResponseModel.decimalDoctorRate}".toText11(isBold: true, color: AppColors.textColor), ], diff --git a/lib/presentation/book_appointment/widgets/doctor_rating_details.dart b/lib/presentation/book_appointment/widgets/doctor_rating_details.dart index 0ed54862..6d9e1cb2 100644 --- a/lib/presentation/book_appointment/widgets/doctor_rating_details.dart +++ b/lib/presentation/book_appointment/widgets/doctor_rating_details.dart @@ -69,13 +69,13 @@ class DoctorRatingDetails extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(LocaleKeys.excellent.tr(context: context), style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + child: Text(LocaleKeys.excellent.tr(context: context), style: TextStyle(fontSize: 13.0, color: AppColors.textColor, fontWeight: FontWeight.w600))), getRatingLine(bookAppointmentsVM.doctorDetailsList[0].ratio, Colors.green[700]!), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text("${getRatingWidth(bookAppointmentsVM.doctorDetailsList[0].ratio).round()}%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text("${getRatingWidth(bookAppointmentsVM.doctorDetailsList[0].ratio).round()}%", style: TextStyle(fontSize: 14.0, color: AppColors.textColor, fontWeight: FontWeight.w600)), ), ], ), @@ -89,13 +89,13 @@ class DoctorRatingDetails extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(LocaleKeys.vGood.tr(context: context), style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + child: Text(LocaleKeys.vGood.tr(context: context), style: TextStyle(fontSize: 13.0, color: AppColors.textColor, fontWeight: FontWeight.w600))), getRatingLine(bookAppointmentsVM.doctorDetailsList[1].ratio, Color(0xffB7B723)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text("${bookAppointmentsVM.doctorDetailsList[1].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text("${bookAppointmentsVM.doctorDetailsList[1].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: AppColors.textColor, fontWeight: FontWeight.w600)), ), ], ), @@ -109,13 +109,13 @@ class DoctorRatingDetails extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(LocaleKeys.good.tr(context: context), style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + child: Text(LocaleKeys.good.tr(context: context), style: TextStyle(fontSize: 13.0, color: AppColors.textColor, fontWeight: FontWeight.w600))), getRatingLine(bookAppointmentsVM.doctorDetailsList[2].ratio, Color(0xffEBA727)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text("${bookAppointmentsVM.doctorDetailsList[2].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text("${bookAppointmentsVM.doctorDetailsList[2].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: AppColors.textColor, fontWeight: FontWeight.w600)), ), ], ), @@ -129,13 +129,13 @@ class DoctorRatingDetails extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(LocaleKeys.average.tr(context: context), style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + child: Text(LocaleKeys.average.tr(context: context), style: TextStyle(fontSize: 13.0, color: AppColors.textColor, fontWeight: FontWeight.w600))), getRatingLine(bookAppointmentsVM.doctorDetailsList[3].ratio, Color(0xffEB7227)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text("${bookAppointmentsVM.doctorDetailsList[3].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text("${bookAppointmentsVM.doctorDetailsList[3].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: AppColors.textColor, fontWeight: FontWeight.w600)), ), ], ), @@ -150,13 +150,13 @@ class DoctorRatingDetails extends StatelessWidget { Container( width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), - child: Text(LocaleKeys.average.tr(context: context), style: TextStyle(fontSize: 13.0, color: Colors.black, fontWeight: FontWeight.w600))), + child: Text(LocaleKeys.average.tr(context: context), style: TextStyle(fontSize: 13.0, color: AppColors.textColor, fontWeight: FontWeight.w600))), getRatingLine(bookAppointmentsVM.doctorDetailsList[4].ratio, Color(0xffE20C0C)), ], ), Container( margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - child: Text("${bookAppointmentsVM.doctorDetailsList[4].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), + child: Text("${bookAppointmentsVM.doctorDetailsList[4].ratio.round()}%", style: TextStyle(fontSize: 14.0, color: AppColors.textColor, fontWeight: FontWeight.w600)), ), ], ), diff --git a/lib/presentation/contact_us/live_chat_page.dart b/lib/presentation/contact_us/live_chat_page.dart index a602eb14..5d09a64f 100644 --- a/lib/presentation/contact_us/live_chat_page.dart +++ b/lib/presentation/contact_us/live_chat_page.dart @@ -122,12 +122,12 @@ class LiveChatPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ ("${appState.isArabic() ? contactUsVM.liveChatProjectsList[index].projectNameN! : contactUsVM.liveChatProjectsList[index].projectName!}\n${contactUsVM.liveChatProjectsList[index].distanceInKilometers!} KM") - .toText14(isBold: true, color: contactUsVM.selectedLiveChatProjectIndex == index ? AppColors.whiteColor : AppColors.textColor), + .toText14(isBold: true, color: contactUsVM.selectedLiveChatProjectIndex == index ? Colors.white : AppColors.textColor), Transform.flip( flipX: getIt.get().isArabic(), child: Utils.buildSvgWithAssets( icon: AppAssets.forward_arrow_icon_small, - iconColor: contactUsVM.selectedLiveChatProjectIndex == index ? AppColors.whiteColor : AppColors.textColor, + iconColor: contactUsVM.selectedLiveChatProjectIndex == index ? Colors.white : AppColors.textColor, width: 18.h, height: 13.h, fit: BoxFit.contain, @@ -235,7 +235,7 @@ class LiveChatPage extends StatelessWidget { }, backgroundColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor, borderColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16, fontWeight: FontWeight.w500, borderRadius: 12, diff --git a/lib/presentation/contact_us/widgets/find_us_item_card.dart b/lib/presentation/contact_us/widgets/find_us_item_card.dart index 1774404d..4738a63a 100644 --- a/lib/presentation/contact_us/widgets/find_us_item_card.dart +++ b/lib/presentation/contact_us/widgets/find_us_item_card.dart @@ -102,9 +102,9 @@ class FindUsItemCard extends StatelessWidget { AppCustomChipWidget( labelText: LocaleKeys.callNow.tr(), icon: AppAssets.call_fill, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, backgroundColor: AppColors.primaryRedColor.withValues(alpha: 1.0), - textColor: AppColors.whiteColor, + textColor: Colors.white, onChipTap: () { launchUrl(Uri.parse("tel://" + "${getHMGLocationsModel.phoneNumber}")); }, diff --git a/lib/presentation/covid19test/covid_payment_screen.dart b/lib/presentation/covid19test/covid_payment_screen.dart index e395a426..40bf2863 100644 --- a/lib/presentation/covid19test/covid_payment_screen.dart +++ b/lib/presentation/covid19test/covid_payment_screen.dart @@ -133,6 +133,7 @@ class _CovidPaymentScreenState extends State { width: 200.h, height: 80.h, fit: BoxFit.contain, + applyThemeColor: false ).paddingSymmetrical(24.h, 0.h).onPress(() { if (Utils.havePrivilege(103)) { startApplePay(); diff --git a/lib/presentation/e_referral/new_e_referral.dart b/lib/presentation/e_referral/new_e_referral.dart index 02881730..844ef5d5 100644 --- a/lib/presentation/e_referral/new_e_referral.dart +++ b/lib/presentation/e_referral/new_e_referral.dart @@ -171,7 +171,7 @@ class _NewReferralPageState extends State { ); }, bottomChild: Container( - color: Colors.white, + color: AppColors.whiteColor, padding: EdgeInsets.all(ResponsiveExtension(20).h), child: CustomButton( text: _currentStep <= 1 ? LocaleKeys.next.tr() : LocaleKeys.submit.tr(), diff --git a/lib/presentation/e_referral/widget/e-referral_otp.dart b/lib/presentation/e_referral/widget/e-referral_otp.dart index 390fc71f..17ae4272 100644 --- a/lib/presentation/e_referral/widget/e-referral_otp.dart +++ b/lib/presentation/e_referral/widget/e-referral_otp.dart @@ -90,7 +90,8 @@ class OTPService { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedBorderColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, + iconColor: Colors.white, icon: AppAssets.message, ), ), diff --git a/lib/presentation/e_referral/widget/e_referral_requester_form.dart b/lib/presentation/e_referral/widget/e_referral_requester_form.dart index b49846f4..d57abe23 100644 --- a/lib/presentation/e_referral/widget/e_referral_requester_form.dart +++ b/lib/presentation/e_referral/widget/e_referral_requester_form.dart @@ -6,6 +6,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/e_referral/e_referral_form_manager.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:provider/provider.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; @@ -121,7 +122,7 @@ class RequesterFormStepState extends State { errorMessage: formManager.errors.relationship, hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.relationship), hasSelectionCustomIcon: false, - labelColor: Colors.black, + labelColor: AppColors.textColor, padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16), leadingIcon: AppAssets.user_circle, dropdownItems: [], @@ -171,8 +172,8 @@ class RequesterFormStepState extends State { return DecoratedBox( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, - customBorder: BorderRadius.all(Radius.circular(24.h)) , + color: AppColors.whiteColor, + customBorder: BorderRadius.all(Radius.circular(24.h)) , ), child: ListView.builder( shrinkWrap: true, diff --git a/lib/presentation/emergency_services/RRT/rrt_request_type_select.dart b/lib/presentation/emergency_services/RRT/rrt_request_type_select.dart index 91db0ded..c17f3560 100644 --- a/lib/presentation/emergency_services/RRT/rrt_request_type_select.dart +++ b/lib/presentation/emergency_services/RRT/rrt_request_type_select.dart @@ -28,7 +28,7 @@ class RrtRequestTypeSelect extends StatelessWidget { ), DecoratedBox( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: 20.r, ), child: OptionSelection(context)), diff --git a/lib/presentation/emergency_services/call_ambulance/call_ambulance_page.dart b/lib/presentation/emergency_services/call_ambulance/call_ambulance_page.dart index 5a368a3b..e5578a3e 100644 --- a/lib/presentation/emergency_services/call_ambulance/call_ambulance_page.dart +++ b/lib/presentation/emergency_services/call_ambulance/call_ambulance_page.dart @@ -79,7 +79,7 @@ class CallAmbulancePage extends StatelessWidget { ), Align( alignment: AlignmentDirectional.topStart, - child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32.h, height: 32.h).onPress(() { + child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32.h, height: 32.h, applyThemeColor: false).onPress(() { context.read().flushPickupInformation(); Navigator.pop(context); }), diff --git a/lib/presentation/emergency_services/call_ambulance/widgets/type_selection_widget.dart b/lib/presentation/emergency_services/call_ambulance/widgets/type_selection_widget.dart index 3ae93d0d..9ad98cb6 100644 --- a/lib/presentation/emergency_services/call_ambulance/widgets/type_selection_widget.dart +++ b/lib/presentation/emergency_services/call_ambulance/widgets/type_selection_widget.dart @@ -52,6 +52,7 @@ class TypeSelectionWidget extends StatelessWidget { child: AppCustomChipWidget( icon: AppAssets.hmg, iconHasColor: false, + applyThemeColor: false, labelText: LocaleKeys.hmgHospitals.tr(context: context), shape: RoundedRectangleBorder( side: BorderSide( @@ -76,6 +77,7 @@ class TypeSelectionWidget extends StatelessWidget { child: AppCustomChipWidget( icon: AppAssets.hmc, iconHasColor: false, + applyThemeColor: false, labelText: LocaleKeys.hmcMedicalClinic.tr(context: context), shape: RoundedRectangleBorder( side: BorderSide( diff --git a/lib/presentation/emergency_services/emergency_services_page.dart b/lib/presentation/emergency_services/emergency_services_page.dart index a5281ca0..41597e40 100644 --- a/lib/presentation/emergency_services/emergency_services_page.dart +++ b/lib/presentation/emergency_services/emergency_services_page.dart @@ -53,7 +53,7 @@ class EmergencyServicesPage extends StatelessWidget { ), child: Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.call_ambulance_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.call_ambulance_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Expanded( child: Column( @@ -87,7 +87,7 @@ class EmergencyServicesPage extends StatelessWidget { "".toText14(), Utils.buildSvgWithAssets( icon: AppAssets.cancel_circle_icon, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, width: 24.h, height: 24.h, fit: BoxFit.contain, @@ -99,10 +99,10 @@ class EmergencyServicesPage extends StatelessWidget { Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), SizedBox(height: 8.h), - LocaleKeys.confirmation.tr().toText28(color: AppColors.whiteColor, isBold: true), + LocaleKeys.confirmation.tr().toText28(color: Colors.white, isBold: true), SizedBox(height: 8.h), LocaleKeys.areYouSureYouWantToCallAmbulance.tr() - .toText14(color: AppColors.whiteColor, weight: FontWeight.w500), + .toText14(color: Colors.white, weight: FontWeight.w500), SizedBox(height: 24.h), CustomButton( text: LocaleKeys.confirm.tr(context: context), @@ -111,8 +111,8 @@ class EmergencyServicesPage extends StatelessWidget { await emergencyServicesViewModel.getTransportationOption(); openTranportationSelectionBottomSheet(context); }, - backgroundColor: AppColors.whiteColor, - borderColor: AppColors.whiteColor, + backgroundColor: Colors.white, + borderColor: Colors.white, textColor: AppColors.primaryRedColor, icon: AppAssets.checkmark_icon, iconColor: AppColors.primaryRedColor, @@ -140,7 +140,7 @@ class EmergencyServicesPage extends StatelessWidget { ), child: Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.nearest_er_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.nearest_er_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Expanded( child: Column( @@ -169,7 +169,7 @@ class EmergencyServicesPage extends StatelessWidget { ), child: Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Expanded( child: Column( @@ -199,10 +199,10 @@ class EmergencyServicesPage extends StatelessWidget { children: [ Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), SizedBox(height: 8.h), - LocaleKeys.confirm.tr().toText28(color: AppColors.whiteColor, isBold: true), + LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), SizedBox(height: 8.h), LocaleKeys.areYouSureYouWantToCallRRT.tr() - .toText14(color: AppColors.whiteColor, weight: FontWeight.w500), + .toText14(color: Colors.white, weight: FontWeight.w500), SizedBox(height: 24.h), CustomButton( text: LocaleKeys.confirm.tr(context: context), @@ -237,8 +237,8 @@ class EmergencyServicesPage extends StatelessWidget { ); }); }, - backgroundColor: AppColors.whiteColor, - borderColor: AppColors.whiteColor, + backgroundColor: Colors.white, + borderColor: Colors.white, textColor: AppColors.primaryRedColor, icon: AppAssets.checkmark_icon, iconColor: AppColors.primaryRedColor, @@ -268,7 +268,7 @@ class EmergencyServicesPage extends StatelessWidget { ), child: Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 12.h), Expanded( child: Column( @@ -311,9 +311,9 @@ class EmergencyServicesPage extends StatelessWidget { Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), SizedBox(height: 8.h), - LocaleKeys.confirm.tr().toText28(color: AppColors.whiteColor, isBold: true), + LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), SizedBox(height: 8.h), - LocaleKeys.areYouSureYouWantToMakeERCheckIn.tr().toText14(color: AppColors.whiteColor, weight: FontWeight.w500), + LocaleKeys.areYouSureYouWantToMakeERCheckIn.tr().toText14(color: Colors.white, weight: FontWeight.w500), SizedBox(height: 24.h), CustomButton( text: LocaleKeys.confirm.tr(context: context), @@ -325,8 +325,8 @@ class EmergencyServicesPage extends StatelessWidget { context.read().navigateToEROnlineCheckIn(); }); }, - backgroundColor: AppColors.whiteColor, - borderColor: AppColors.whiteColor, + backgroundColor: Colors.white, + borderColor: Colors.white, textColor: AppColors.primaryRedColor, icon: AppAssets.checkmark_icon, iconColor: AppColors.primaryRedColor, diff --git a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart index 26456794..8b9633c1 100644 --- a/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart +++ b/lib/presentation/emergency_services/er_online_checkin/er_online_checkin_payment_page.dart @@ -288,6 +288,7 @@ class _ErOnlineCheckinPaymentPageState extends State width: 200.h, height: 80.h, fit: BoxFit.contain, + applyThemeColor: false ).paddingSymmetrical(24.h, 0.h).onPress(() { if (Utils.havePrivilege(103)) { startApplePay(); diff --git a/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart b/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart index 7b17eab8..e1ebc83c 100644 --- a/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart +++ b/lib/presentation/emergency_services/history/widget/ambulance_history_item.dart @@ -26,7 +26,7 @@ class AmbulanceHistoryItem extends StatelessWidget { Widget build(BuildContext context) { return DecoratedBox( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, hasShadow: true, customBorder: BorderRadius.all( Radius.circular(20.h), diff --git a/lib/presentation/emergency_services/history/widget/rrt_item.dart b/lib/presentation/emergency_services/history/widget/rrt_item.dart index d345e2df..c8787791 100644 --- a/lib/presentation/emergency_services/history/widget/rrt_item.dart +++ b/lib/presentation/emergency_services/history/widget/rrt_item.dart @@ -26,7 +26,7 @@ class RRTItem extends StatelessWidget { Widget build(BuildContext context) { return DecoratedBox( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, hasShadow: true, customBorder: BorderRadius.all( Radius.circular(20.h), diff --git a/lib/presentation/emergency_services/widgets/nearestERItem.dart b/lib/presentation/emergency_services/widgets/nearestERItem.dart index 2226f82b..fae19a0a 100644 --- a/lib/presentation/emergency_services/widgets/nearestERItem.dart +++ b/lib/presentation/emergency_services/widgets/nearestERItem.dart @@ -27,7 +27,7 @@ class NearestERItem extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, customBorder: BorderRadius.only( topLeft: Radius.circular(24.h), topRight: Radius.circular(24.h), diff --git a/lib/presentation/habib_wallet/recharge_wallet_page.dart b/lib/presentation/habib_wallet/recharge_wallet_page.dart index c4587bf9..ef1642eb 100644 --- a/lib/presentation/habib_wallet/recharge_wallet_page.dart +++ b/lib/presentation/habib_wallet/recharge_wallet_page.dart @@ -133,7 +133,7 @@ class _RechargeWalletPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.my_account_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.my_account_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -171,7 +171,7 @@ class _RechargeWalletPageState extends State { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.select_hospital_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.select_hospital_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -197,7 +197,7 @@ class _RechargeWalletPageState extends State { SizedBox(height: 16.h), Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -281,14 +281,14 @@ class _RechargeWalletPageState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 50.h, icon: AppAssets.appointment_pay_icon, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 18.h, ).paddingSymmetrical(24.h, 24.h), ), diff --git a/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart b/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart index 4585b7d0..9efcb01b 100644 --- a/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart +++ b/lib/presentation/habib_wallet/wallet_payment_confirm_page.dart @@ -188,10 +188,7 @@ class _WalletPaymentConfirmPageState extends State { Platform.isIOS ? Utils.buildSvgWithAssets( icon: AppAssets.apple_pay_button, - width: 200.h, - height: 56.h, - fit: BoxFit.contain, - ).paddingSymmetrical(24.h, 0.h).onPress(() { + width: 200.h, height: 56.h, fit: BoxFit.contain, applyThemeColor: false).paddingSymmetrical(24.h, 0.h).onPress(() { if (Utils.havePrivilege(103)) { startApplePay(); } else { diff --git a/lib/presentation/habib_wallet/widgets/hospital_list_item.dart b/lib/presentation/habib_wallet/widgets/hospital_list_item.dart index a46f79db..67e174a3 100644 --- a/lib/presentation/habib_wallet/widgets/hospital_list_item.dart +++ b/lib/presentation/habib_wallet/widgets/hospital_list_item.dart @@ -54,6 +54,7 @@ class HospitalListItemAdvancePayment extends StatelessWidget { children: [ Utils.buildSvgWithAssets( icon: (hospitalModel.isHMC == true) ? AppAssets.hmc : AppAssets.hmg, + applyThemeColor: false ).paddingOnly(right: 10), Expanded( child: Text( diff --git a/lib/presentation/health_calculators_and_converts/health_calculators_page.dart b/lib/presentation/health_calculators_and_converts/health_calculators_page.dart index aae25b03..4f519d66 100644 --- a/lib/presentation/health_calculators_and_converts/health_calculators_page.dart +++ b/lib/presentation/health_calculators_and_converts/health_calculators_page.dart @@ -39,10 +39,10 @@ class _HealthCalculatorsPageState extends State { ? Column( children: [ Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r), child: Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.general_health, height: 40.h, width: 40.w, fit: BoxFit.none), + Utils.buildSvgWithAssets(icon: AppAssets.general_health, height: 40.h, width: 40.w, fit: BoxFit.none, applyThemeColor: false), SizedBox(width: 12.w), Flexible( child: Column( @@ -70,10 +70,10 @@ class _HealthCalculatorsPageState extends State { }), SizedBox(height: 16.h), Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r), child: Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.women_health, height: 40.h, width: 40.w, fit: BoxFit.none), + Utils.buildSvgWithAssets(icon: AppAssets.women_health, height: 40.h, width: 40.w, fit: BoxFit.none, applyThemeColor: false), SizedBox(width: 12.w), Flexible( child: Column( @@ -102,11 +102,11 @@ class _HealthCalculatorsPageState extends State { : Column( children: [ Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.bloodSugar, height: 40.h, width: 40.w, fit: BoxFit.none), + Utils.buildSvgWithAssets(icon: AppAssets.bloodSugar, height: 40.h, width: 40.w, fit: BoxFit.none, applyThemeColor: false), SizedBox(width: 12.w), Flexible( child: Column( @@ -136,11 +136,11 @@ class _HealthCalculatorsPageState extends State { }), SizedBox(height: 16.h), Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.bloodCholestrol, height: 40.h, width: 40.w, fit: BoxFit.none), + Utils.buildSvgWithAssets(icon: AppAssets.bloodCholestrol, height: 40.h, width: 40.w, fit: BoxFit.none, applyThemeColor: false), SizedBox(width: 12.w), Flexible( child: Column( @@ -166,11 +166,11 @@ class _HealthCalculatorsPageState extends State { }), SizedBox(height: 16.h), Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.triglycerides, height: 40.h, width: 40.w, fit: BoxFit.none), + Utils.buildSvgWithAssets(icon: AppAssets.triglycerides, height: 40.h, width: 40.w, fit: BoxFit.none, applyThemeColor: false), SizedBox(width: 12.w), Flexible( child: Column( diff --git a/lib/presentation/health_calculators_and_converts/widgets/bf.dart b/lib/presentation/health_calculators_and_converts/widgets/bf.dart index c8c949c4..481bfcbf 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/bf.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/bf.dart @@ -85,7 +85,7 @@ class _BodyFatWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.gender, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.gender, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -111,7 +111,7 @@ class _BodyFatWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _genders.length, @@ -165,7 +165,7 @@ class _BodyFatWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -221,7 +221,7 @@ class _BodyFatWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -277,7 +277,7 @@ class _BodyFatWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -338,7 +338,7 @@ class _BodyFatWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -394,7 +394,7 @@ class _BodyFatWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -455,7 +455,7 @@ class _BodyFatWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -511,7 +511,7 @@ class _BodyFatWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -572,7 +572,7 @@ class _BodyFatWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, diff --git a/lib/presentation/health_calculators_and_converts/widgets/bmi.dart b/lib/presentation/health_calculators_and_converts/widgets/bmi.dart index 3969db41..a5ea06d1 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/bmi.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/bmi.dart @@ -67,7 +67,7 @@ class _BMIWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -123,7 +123,7 @@ class _BMIWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -179,7 +179,7 @@ class _BMIWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -240,7 +240,7 @@ class _BMIWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _weightUnits.length, diff --git a/lib/presentation/health_calculators_and_converts/widgets/bmr.dart b/lib/presentation/health_calculators_and_converts/widgets/bmr.dart index f19c6b5c..d1cb2c3a 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/bmr.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/bmr.dart @@ -80,7 +80,7 @@ class _BMRWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.gender, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.gender, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -107,7 +107,7 @@ class _BMRWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _genders.length, @@ -162,7 +162,7 @@ class _BMRWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -199,7 +199,7 @@ class _BMRWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -255,7 +255,7 @@ class _BMRWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -312,7 +312,7 @@ class _BMRWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -373,7 +373,7 @@ class _BMRWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _weightUnits.length, @@ -430,7 +430,7 @@ class _BMRWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -456,7 +456,7 @@ class _BMRWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _activity.length, diff --git a/lib/presentation/health_calculators_and_converts/widgets/calories.dart b/lib/presentation/health_calculators_and_converts/widgets/calories.dart index b1a4b773..1609c056 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/calories.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/calories.dart @@ -81,7 +81,7 @@ class _CaloriesWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.gender, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.gender, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -108,7 +108,7 @@ class _CaloriesWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _genders.length, @@ -162,7 +162,7 @@ class _CaloriesWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -199,7 +199,7 @@ class _CaloriesWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -255,7 +255,7 @@ class _CaloriesWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -311,7 +311,7 @@ class _CaloriesWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -372,7 +372,7 @@ class _CaloriesWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _weightUnits.length, @@ -429,7 +429,7 @@ class _CaloriesWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -455,7 +455,7 @@ class _CaloriesWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _activity.length, diff --git a/lib/presentation/health_calculators_and_converts/widgets/crabs.dart b/lib/presentation/health_calculators_and_converts/widgets/crabs.dart index 83130fe2..c241e688 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/crabs.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/crabs.dart @@ -62,7 +62,7 @@ class _CrabsWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -93,7 +93,7 @@ class _CrabsWidgetState extends State { ], ), ), - Utils.buildSvgWithAssets(icon: AppAssets.ask_doctor_icon).onPress(() { + Utils.buildSvgWithAssets(icon: AppAssets.ask_doctor_icon, applyThemeColor: false).onPress(() { Navigator.pop(context); Navigator.of(context).push(CustomPageRoute(page: HealthCalculatorDetailedPage(calculatorType: HealthCalculatorsTypeEnum.calories))); }), @@ -104,7 +104,7 @@ class _CrabsWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -130,7 +130,7 @@ class _CrabsWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _activity.length, diff --git a/lib/presentation/health_calculators_and_converts/widgets/ibw.dart b/lib/presentation/health_calculators_and_converts/widgets/ibw.dart index 1665ccd1..a783d2c8 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/ibw.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/ibw.dart @@ -73,7 +73,7 @@ class _IdealBodyWeightWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.height, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -129,7 +129,7 @@ class _IdealBodyWeightWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _heightUnits.length, @@ -185,7 +185,7 @@ class _IdealBodyWeightWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.weight, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -246,7 +246,7 @@ class _IdealBodyWeightWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _weightUnits.length, @@ -301,7 +301,7 @@ class _IdealBodyWeightWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.activity, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( child: Row( @@ -327,7 +327,7 @@ class _IdealBodyWeightWidgetState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: _activity.length, diff --git a/lib/presentation/health_calculators_and_converts/widgets/ovulation.dart b/lib/presentation/health_calculators_and_converts/widgets/ovulation.dart index 8d7591e6..556880d4 100644 --- a/lib/presentation/health_calculators_and_converts/widgets/ovulation.dart +++ b/lib/presentation/health_calculators_and_converts/widgets/ovulation.dart @@ -89,7 +89,7 @@ class _OvulationWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, @@ -126,7 +126,7 @@ class _OvulationWidgetState extends State { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w), + Utils.buildSvgWithAssets(icon: AppAssets.age, width: 40.w, height: 40.w, applyThemeColor: false), SizedBox(width: 12.w), Expanded( flex: 3, diff --git a/lib/presentation/health_trackers/add_health_tracker_entry_page.dart b/lib/presentation/health_trackers/add_health_tracker_entry_page.dart index 702875d9..8320972e 100644 --- a/lib/presentation/health_trackers/add_health_tracker_entry_page.dart +++ b/lib/presentation/health_trackers/add_health_tracker_entry_page.dart @@ -211,7 +211,7 @@ class _AddHealthTrackerEntryPageState extends State { child: Container( constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.7), padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: items.length, diff --git a/lib/presentation/health_trackers/health_trackers_page.dart b/lib/presentation/health_trackers/health_trackers_page.dart index 9c68281f..66630f28 100644 --- a/lib/presentation/health_trackers/health_trackers_page.dart +++ b/lib/presentation/health_trackers/health_trackers_page.dart @@ -26,7 +26,7 @@ Widget buildHealthTrackerCard({ required VoidCallback onTap, }) { return Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index 4458b75a..4996850b 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -389,7 +389,7 @@ class ServicesPage extends StatelessWidget { spacing: 8.w, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h, applyThemeColor: false), LocaleKeys.habibWallet.tr().toText14(weight: FontWeight.w600, maxlines: 2).expanded, Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), ], @@ -449,7 +449,7 @@ class ServicesPage extends StatelessWidget { spacing: 8.w, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.services_medical_file_icon, width: 40.w, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.services_medical_file_icon, width: 40.w, height: 40.h, applyThemeColor: false), LocaleKeys.medicalFile.tr().toText16(weight: FontWeight.w600, maxlines: 2).expanded, Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), ], diff --git a/lib/presentation/hmg_services/services_view.dart b/lib/presentation/hmg_services/services_view.dart index 3dd5c462..dd70c413 100644 --- a/lib/presentation/hmg_services/services_view.dart +++ b/lib/presentation/hmg_services/services_view.dart @@ -48,6 +48,7 @@ class ServiceGridViewItem extends StatelessWidget { icon: hmgServiceComponentModel.icon, iconColor: isHealthToolIcon ? null : AppColors.whiteColor, fit: BoxFit.contain, + applyThemeColor: false ), ), ), diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart index c52d5e19..1fefb8ce 100644 --- a/lib/presentation/home/data/landing_page_data.dart +++ b/lib/presentation/home/data/landing_page_data.dart @@ -1,11 +1,12 @@ import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/home/data/service_card_data.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; class LandingPageData { - static List getNotLoggedInServiceCardsList = [ + static List get getNotLoggedInServiceCardsList => [ ServiceCardData( serviceName: "emergency", icon: AppAssets.emergency_services_icon, @@ -68,15 +69,15 @@ class LandingPageData { ), ]; - static List getLoggedInServiceCardsList = [ + static List get getLoggedInServiceCardsList => [ ServiceCardData( serviceName: "emergency", icon: AppAssets.emergency_services_icon, title: LocaleKeys.emergency, subtitle: LocaleKeys.services2, backgroundColor: AppColors.primaryRedColor, - iconColor: AppColors.whiteColor, - textColor: AppColors.whiteColor, + iconColor: Colors.white, + textColor: Colors.white, isBold: true, ), ServiceCardData( @@ -141,7 +142,7 @@ class LandingPageData { ), ]; - static List getServiceCardsList = [ + static List get getServiceCardsList => [ ServiceCardData( serviceName: "livecare", icon: AppAssets.small_livecare_icon, diff --git a/lib/presentation/home/data/service_card_data.dart b/lib/presentation/home/data/service_card_data.dart index 3bc22d7c..c16147b1 100644 --- a/lib/presentation/home/data/service_card_data.dart +++ b/lib/presentation/home/data/service_card_data.dart @@ -8,8 +8,8 @@ class ServiceCardData { final String title; final String subtitle; final Color? iconColor; - final Color textColor; - final Color backgroundColor; + final Color? textColor; + final Color? backgroundColor; final bool isBold; final String largeCardIcon; @@ -19,9 +19,9 @@ class ServiceCardData { this.title = "", this.subtitle = "", this.largeCardIcon = "", - this.backgroundColor = AppColors.whiteColor, - this.iconColor = AppColors.blackColor, - this.textColor = AppColors.blackColor, + this.backgroundColor, + this.iconColor, + this.textColor, this.isBold = false }); } diff --git a/lib/presentation/home/widgets/habib_wallet_card.dart b/lib/presentation/home/widgets/habib_wallet_card.dart index ed48058d..0ac32443 100644 --- a/lib/presentation/home/widgets/habib_wallet_card.dart +++ b/lib/presentation/home/widgets/habib_wallet_card.dart @@ -45,7 +45,7 @@ class HabibWalletCard extends StatelessWidget { child: Stack(children: [ Positioned( right: 0, - child: ClipRRect(borderRadius: BorderRadius.circular(24.0), child: Utils.buildSvgWithAssets(icon: AppAssets.habib_background_icon, width: 150.h, height: 150.h)), + child: ClipRRect(borderRadius: BorderRadius.circular(24.0), child: Utils.buildSvgWithAssets(icon: AppAssets.habib_background_icon, width: 150.h, height: 150.h, applyThemeColor: false)), ), Padding( padding: EdgeInsets.all(16.h), @@ -123,7 +123,7 @@ class HabibWalletCard extends StatelessWidget { icon: AppAssets.recharge_icon, iconSize: 24.h, backgroundColor: AppColors.infoColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, text: LocaleKeys.recharge.tr(context: context), borderWidth: 0.w, fontWeight: FontWeight.w500, diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index e25ed0b3..e65eb1d8 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -72,7 +72,7 @@ class LargeServiceCard extends StatelessWidget { height: 48.h, width: 48.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: serviceCardData.backgroundColor, + color: serviceCardData.backgroundColor!, borderRadius: 12.r, hasShadow: false, ), @@ -209,7 +209,7 @@ class FadedLargeServiceCard extends StatelessWidget { height: 32.h, width: 32.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: serviceCardData.backgroundColor, + color: serviceCardData.backgroundColor!, borderRadius: 30.r, hasShadow: false, ), @@ -219,6 +219,7 @@ class FadedLargeServiceCard extends StatelessWidget { icon: serviceCardData.icon, iconColor: serviceCardData.iconColor, fit: BoxFit.contain, + applyThemeColor: false ), ), ), diff --git a/lib/presentation/home/widgets/small_service_card.dart b/lib/presentation/home/widgets/small_service_card.dart index 84ef6fa2..0c2da8d6 100644 --- a/lib/presentation/home/widgets/small_service_card.dart +++ b/lib/presentation/home/widgets/small_service_card.dart @@ -32,9 +32,9 @@ class SmallServiceCard extends StatelessWidget { final String icon; final String title; final String subtitle; - final Color iconColor; - final Color textColor; - final Color backgroundColor; + final Color? iconColor; + final Color? textColor; + final Color? backgroundColor; final bool isBold; SmallServiceCard({ @@ -43,33 +43,36 @@ class SmallServiceCard extends StatelessWidget { this.serviceName = "", this.title = "", this.subtitle = "", - this.backgroundColor = AppColors.whiteColor, - this.iconColor = AppColors.blackColor, - this.textColor = AppColors.blackColor, + this.backgroundColor, + this.iconColor, + this.textColor, this.isBold = false, }); @override Widget build(BuildContext context) { + final resolvedBgColor = backgroundColor ?? AppColors.whiteColor; + final resolvedIconColor = iconColor ?? AppColors.blackColor; + final resolvedTextColor = textColor ?? AppColors.blackColor; return Container( height: 92.h, width: 92.h, padding: EdgeInsets.all(4.0), decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: backgroundColor, + color: resolvedBgColor, borderRadius: 16, ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: icon, iconColor: iconColor, width: 32.h, height: 32.h), + Utils.buildSvgWithAssets(icon: icon, iconColor: resolvedIconColor, width: 32.h, height: 32.h), SizedBox(height: 6.h), if (isFoldable || isTablet) ...[ - title.tr(context: context).toText10(color: textColor, weight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxlines: 1), - subtitle.tr(context: context).toText10(color: textColor, weight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxlines: 1), + title.tr(context: context).toText10(color: resolvedTextColor, weight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxlines: 1), + subtitle.tr(context: context).toText10(color: resolvedTextColor, weight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxlines: 1), ] else ...[ - title.tr(context: context).toText12(color: textColor, fontWeight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxLine: 1), - subtitle.tr(context: context).toText12(color: textColor, fontWeight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxLine: 1), + title.tr(context: context).toText12(color: resolvedTextColor, fontWeight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxLine: 1), + subtitle.tr(context: context).toText12(color: resolvedTextColor, fontWeight: FontWeight.w500, isCenter: true, letterSpacing: -0.2, maxLine: 1), ] ], ), diff --git a/lib/presentation/home_health_care/hhc_procedures_page.dart b/lib/presentation/home_health_care/hhc_procedures_page.dart index ef5dce5c..c420742c 100644 --- a/lib/presentation/home_health_care/hhc_procedures_page.dart +++ b/lib/presentation/home_health_care/hhc_procedures_page.dart @@ -434,7 +434,7 @@ class _HhcProceduresPageState extends State { child: Container( height: 80.h, decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(10.r), ), ), diff --git a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart index 8fb30900..eed1eedb 100644 --- a/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart +++ b/lib/presentation/lab/lab_result_via_clinic/LabResultByClinic.dart @@ -146,14 +146,14 @@ class LabResultByClinic extends StatelessWidget { }, backgroundColor: AppColors.successColor, borderColor: AppColors.successColor, - textColor: AppColors.whiteColor, - fontSize: 16, + textColor: Colors.white, + fontSize: 16.f, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 45.h, icon: AppAssets.download, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 20.h, ).paddingSymmetrical(24.h, 24.h), ), diff --git a/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart b/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart index f0c9b26b..7a477761 100644 --- a/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart +++ b/lib/presentation/lab/lab_result_via_clinic/ai_analysis_widget.dart @@ -20,7 +20,7 @@ class AiAnalysisWidget extends StatelessWidget { padding: EdgeInsets.all(1.5.r), // Border thickness child: Container( decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(22.r), ), padding: EdgeInsets.all(20.r), @@ -44,7 +44,7 @@ class AiAnalysisWidget extends StatelessWidget { SizedBox(height: 8.h), data.summary!.toText14(color: AppColors.textColorLight, height: 1.5, weight: FontWeight.w400), SizedBox(height: 16.h), - const Divider(color: AppColors.dividerColor, thickness: 1), + Divider(color: AppColors.dividerColor, thickness: 1), SizedBox(height: 16.h), ], if (data.aiPredictions != null && data.aiPredictions!.isNotEmpty) ...[ @@ -52,7 +52,7 @@ class AiAnalysisWidget extends StatelessWidget { SizedBox(height: 12.h), ...data.aiPredictions!.map((item) => _buildBulletItem(item)), SizedBox(height: 16.h), - const Divider(color: AppColors.dividerColor, thickness: 1), + Divider(color: AppColors.dividerColor, thickness: 1), SizedBox(height: 16.h), ], if (data.prevention != null && data.prevention!.isNotEmpty) ...[ @@ -88,7 +88,7 @@ class AiAnalysisWidget extends StatelessWidget { child: Container( width: 5.r, height: 5.r, - decoration: const BoxDecoration(color: AppColors.blackColor, shape: BoxShape.circle), + decoration: BoxDecoration(color: AppColors.blackColor, shape: BoxShape.circle), ), ), Expanded( diff --git a/lib/presentation/lab/lab_result_via_clinic/lab_ai_analysis_detailed_page.dart b/lib/presentation/lab/lab_result_via_clinic/lab_ai_analysis_detailed_page.dart index 14ff620b..2a4fd66d 100644 --- a/lib/presentation/lab/lab_result_via_clinic/lab_ai_analysis_detailed_page.dart +++ b/lib/presentation/lab/lab_result_via_clinic/lab_ai_analysis_detailed_page.dart @@ -133,7 +133,7 @@ class _LabAiAnalysisDetailedPageState extends State { ), if (!isLast) ...[ SizedBox(height: 12.h), - const Divider(color: AppColors.dividerColor, thickness: 1), + Divider(color: AppColors.dividerColor, thickness: 1), SizedBox(height: 12.h), ], ], diff --git a/lib/presentation/lab/search_lab_report.dart b/lib/presentation/lab/search_lab_report.dart index bf27b911..d366f38f 100644 --- a/lib/presentation/lab/search_lab_report.dart +++ b/lib/presentation/lab/search_lab_report.dart @@ -59,7 +59,7 @@ class _SearchLabResultsContentState extends State { title: LocaleKeys.labResults.tr(), isClose: true, bottomChild: Container( - color: Colors.white, + color: AppColors.whiteColor, padding: EdgeInsets.all(ResponsiveExtension(20).h), child: CustomButton( text: LocaleKeys.search.tr(), @@ -144,7 +144,8 @@ class SuggestionChip extends StatelessWidget { borderRadius: BorderRadius.circular(8), ), child: label.toText12( - color: isSelected ? Colors.white : Colors.black87, + // color: isSelected ? AppColors.textColor : Colors.black87, + color: AppColors.textColor, fontWeight: FontWeight.w500, ), ), diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 1a68f224..f288af66 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -478,11 +478,12 @@ class _MedicalFilePageState extends State { // Using CustomExpandableList CustomExpandableList( expansionMode: ExpansionMode.exactlyOne, - dividerColor: Color(0xff2b353e1a), + dividerColor: AppColors.dividerColor, itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h), items: [ ExpandableListItem( title: LocaleKeys.medicalServices.tr(context: context).toText18(weight: FontWeight.w600), + expandedBackgroundColor: Colors.transparent, children: [ SizedBox(height: 10.h), getSelectedTabData(0), @@ -518,53 +519,6 @@ class _MedicalFilePageState extends State { defaultTrailingIcon: Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w, iconColor: AppColors.textColor), ), ).paddingSymmetrical(16.w, 0.0), - - // ExpansionTileList( - // shrinkWrap: true, - // trailing: Icon(Icons.arrow_drop_down), - // expansionMode: ExpansionMode.exactlyOne, - // children: [ - // ExpansionTile( - // title: "Medical Services".toText20(weight: FontWeight.w600, color: AppColors.textColor), - // iconColor: Color(0xFF2E3039), - // trailing: Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, height: 22.h, width: 22.w), - // children: [Text('Child 1')], - // ), - // ExpansionTile( - // title: "Medical Reports".toText20(weight: FontWeight.w600, color: AppColors.textColor), - // children: [Text('Child 2')], - // ), - // ExpansionTile( - // title: "Insurance & Payments".toText20(weight: FontWeight.w600, color: AppColors.textColor), - // children: [Text('Child 3')], - // ), - // ExpansionTile( - // title: "Tracker & Others".toText20(weight: FontWeight.w600, color: AppColors.textColor), - // children: [Text('Child 4')], - // ), - // ], - // ), - // Consumer(builder: (context, medicalFileVM, child) { - // return Column( - // children: [ - // CustomTabBar( - // activeTextColor: AppColors.primaryRedColor, - // activeBackgroundColor: AppColors.primaryRedColor.withValues(alpha: .1), - // tabs: [ - // CustomTabBarModel(AppAssets.myFilesBottom, LocaleKeys.general.tr(context: context).needTranslation), - // CustomTabBarModel(AppAssets.insurance, LocaleKeys.insurance.tr(context: context)), - // CustomTabBarModel(AppAssets.requests, LocaleKeys.request.tr(context: context).needTranslation), - // CustomTabBarModel(AppAssets.more, "More".needTranslation), - // ], - // onTabChange: (index) { - // medicalFileVM.onTabChanged(index); - // }, - // ).paddingSymmetrical(24.w, 0.0), - // SizedBox(height: 24.h), - // getSelectedTabData(medicalFileVM.selectedTabIndex), - // ], - // ); - // }), ], ), ); @@ -669,9 +623,9 @@ class _MedicalFilePageState extends State { ), ); }, - backgroundColor: Color(0xffFEE9EA), - borderColor: Color(0xffFEE9EA), - textColor: Color(0xffED1C2B), + backgroundColor: AppColors.secondaryLightRedColor, + borderColor: AppColors.secondaryLightRedColor, + textColor: AppColors.primaryRedColor, fontSize: 14.f, fontWeight: FontWeight.w500, borderRadius: 12.r, @@ -792,7 +746,7 @@ class _MedicalFilePageState extends State { ? const CommonShimmerWidget().paddingSymmetrical(0.w, 0.h) : prescriptionVM.patientPrescriptionOrders.isNotEmpty ? Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: Colors.white, borderRadius: 20.r, hasShadow: false), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.r, hasShadow: false), child: Padding( padding: EdgeInsets.all(16.w), child: Column( @@ -862,7 +816,7 @@ class _MedicalFilePageState extends State { separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h), ), SizedBox(height: 16.h), - const Divider(color: AppColors.dividerColor), + Divider(color: AppColors.dividerColor), SizedBox(height: 16.h), Row( children: [ diff --git a/lib/presentation/medical_file/widgets/lab_rad_card.dart b/lib/presentation/medical_file/widgets/lab_rad_card.dart index f31c90b9..b107403d 100644 --- a/lib/presentation/medical_file/widgets/lab_rad_card.dart +++ b/lib/presentation/medical_file/widgets/lab_rad_card.dart @@ -36,6 +36,7 @@ class LabRadCard extends StatelessWidget { width: 40.w, height: 40.h, fit: BoxFit.cover, + applyThemeColor: false ).toShimmer2(isShow: false, radius: 12.r), SizedBox(width: 8.w), Flexible( diff --git a/lib/presentation/medical_file/widgets/medical_file_card.dart b/lib/presentation/medical_file/widgets/medical_file_card.dart index 77968c57..c2551d30 100644 --- a/lib/presentation/medical_file/widgets/medical_file_card.dart +++ b/lib/presentation/medical_file/widgets/medical_file_card.dart @@ -37,7 +37,7 @@ class MedicalFileCard extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: [ - Utils.buildSvgWithAssets(icon: svgIcon, width: iconS, height: iconS, fit: BoxFit.contain), + Utils.buildSvgWithAssets(icon: svgIcon, width: iconS, height: iconS, fit: BoxFit.contain, applyThemeColor: false), SizedBox(height: 8.h), isLargeText ? label.toText13(color: textColor, isBold: true, maxLine: 2) : label.toText11(color: textColor, isBold: true, maxLine: 2), ], diff --git a/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart b/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart index 16c05d8b..a0c54e68 100644 --- a/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart +++ b/lib/presentation/medical_file/widgets/patient_sick_leave_card.dart @@ -182,15 +182,15 @@ class PatientSickLeaveCard extends StatelessWidget { } Color getStatusColor() { - Color statusColor = Colors.white; + Color statusColor = AppColors.whiteColor; if (patientSickLeavesResponseModel.status == 1) { - statusColor = Color(0xffCC9B14); // TODO change color as per In Queue design + statusColor = AppColors.statusPendingColor; } else if (patientSickLeavesResponseModel.status == 2) { statusColor = AppColors.successColor; } else if (patientSickLeavesResponseModel.status == 3) { statusColor = AppColors.primaryRedColor; } else { - statusColor = Colors.white; + statusColor = AppColors.whiteColor; } return statusColor; } diff --git a/lib/presentation/medical_report/medical_reports_page.dart b/lib/presentation/medical_report/medical_reports_page.dart index 02a9bdec..fd3ba7f9 100644 --- a/lib/presentation/medical_report/medical_reports_page.dart +++ b/lib/presentation/medical_report/medical_reports_page.dart @@ -370,13 +370,13 @@ class _MedicalReportsPageState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16.f, fontWeight: FontWeight.w500, borderRadius: 12.r, height: 46.h, icon: AppAssets.requests, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 20.h, ).paddingSymmetrical(24.h, 24.h), ), diff --git a/lib/presentation/monthly_report/monthly_report.dart b/lib/presentation/monthly_report/monthly_report.dart index 43c7fc1d..998d7f48 100644 --- a/lib/presentation/monthly_report/monthly_report.dart +++ b/lib/presentation/monthly_report/monthly_report.dart @@ -74,7 +74,7 @@ class MonthlyReport extends StatelessWidget { children: [ Row( children: [ - Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.email_icon, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/my_invoices/widgets/invoice_list_card.dart b/lib/presentation/my_invoices/widgets/invoice_list_card.dart index 4a328c5e..6e0fa0e4 100644 --- a/lib/presentation/my_invoices/widgets/invoice_list_card.dart +++ b/lib/presentation/my_invoices/widgets/invoice_list_card.dart @@ -80,7 +80,7 @@ class InvoiceListCard extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h), + Utils.buildSvgWithAssets(icon: AppAssets.rating_icon, width: 15.w, height: 15.h, applyThemeColor: false), SizedBox(height: 2.h), "${getInvoicesListResponseModel.decimalDoctorRate}".toText11(isBold: true, color: AppColors.textColor), ], diff --git a/lib/presentation/prescriptions/prescription_detail_page.dart b/lib/presentation/prescriptions/prescription_detail_page.dart index 5bb9cbd7..b9b5b789 100644 --- a/lib/presentation/prescriptions/prescription_detail_page.dart +++ b/lib/presentation/prescriptions/prescription_detail_page.dart @@ -240,7 +240,7 @@ class _PrescriptionDetailPageState extends State { backgroundColor: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.successColor : AppColors.greyF7Color, borderColor: AppColors.successColor.withOpacity(0.01), textColor: - widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.whiteColor : AppColors.textColor.withOpacity(0.35), + widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? Colors.white : AppColors.textColor.withOpacity(0.35), fontSize: 16, fontWeight: FontWeight.w500, borderRadius: 12, @@ -248,7 +248,7 @@ class _PrescriptionDetailPageState extends State { height: 50.h, icon: AppAssets.prescription_refill_icon, iconColor: - widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.whiteColor : AppColors.textColor.withOpacity(0.35), + widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? Colors.white : AppColors.textColor.withOpacity(0.35), iconSize: 20.h, ).paddingSymmetrical(24.h, 24.h), ), diff --git a/lib/presentation/prescriptions/prescription_item_view.dart b/lib/presentation/prescriptions/prescription_item_view.dart index 1369d4ac..38b96d37 100644 --- a/lib/presentation/prescriptions/prescription_item_view.dart +++ b/lib/presentation/prescriptions/prescription_item_view.dart @@ -89,7 +89,7 @@ class PrescriptionItemView extends StatelessWidget { child: Row( mainAxisSize: MainAxisSize.max, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h).toShimmer2(isShow: isLoading), + Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h, applyThemeColor: false).toShimmer2(isShow: isLoading), SizedBox(width: 8.h), Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index 3a44d1fd..2bd41f06 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -158,7 +158,7 @@ class ProfileSettingsState extends State { spacing: 8.w, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h), + Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h, applyThemeColor: false), LocaleKeys.habibWallet.tr(context: context).toText16(weight: FontWeight.w600, maxlines: 2).expanded, Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), ], @@ -194,6 +194,38 @@ class ProfileSettingsState extends State { ], ), LocaleKeys.quickActions.tr(context: context).toText18(weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1).paddingOnly(left: 24.w, right: 24.w), + Container( + margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h), + padding: EdgeInsets.only(top: 4.h, bottom: 4.h), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r, hasShadow: true), + child: Column( + children: [ + actionItem(AppAssets.language_change, LocaleKeys.language.tr(context: context), () { + showCommonBottomSheetWithoutHeight(context, title: LocaleKeys.language.tr(context: context), child: AppLanguageChange(), callBackFunc: () {}, isFullScreen: false); + }, trailingLabel: Utils.appState.isArabic() ? "العربية" : "English"), + 1.divider, + actionItem(AppAssets.bell, LocaleKeys.notificationsSettings.tr(context: context), () { + openAppSettings(); + }), + 1.divider, + Consumer( + builder: (context, profileVm, _) { + return actionItem( + AppAssets.darkModeIcon, + LocaleKeys.darkMode.tr(context: context), + () { + profileVm.toggleDarkMode(!profileVm.isDarkMode); + }, + switchValue: profileVm.isDarkMode, + onSwitchChanged: (value) { + profileVm.toggleDarkMode(value); + }, + ); + }, + ), + ], + ), + ), Container( margin: EdgeInsets.only(left: 24.w, right: 24.w, top: 16.h, bottom: 24.h), padding: EdgeInsets.only(top: 4.h, bottom: 4.h), @@ -282,7 +314,7 @@ class ProfileSettingsState extends State { ); } - Widget actionItem(String icon, String label, VoidCallback onPress, {String trailingLabel = "", bool? switchValue, bool isExternalLink = false}) { + Widget actionItem(String icon, String label, VoidCallback onPress, {String trailingLabel = "", bool? switchValue, ValueChanged? onSwitchChanged, bool isExternalLink = false}) { return SizedBox( height: 56.h, child: Row( @@ -294,7 +326,7 @@ class ProfileSettingsState extends State { switchValue != null ? Switch( value: switchValue, - onChanged: (value) {}, + onChanged: onSwitchChanged ?? (value) {}, activeThumbColor: AppColors.successColor, activeTrackColor: AppColors.successColor.withValues(alpha: .15), ) @@ -463,8 +495,8 @@ class FamilyCardWidget extends StatelessWidget { onPressed: canSwitch ? () => onFamilySwitchPress(profile) : onAddFamilyMemberPress, backgroundColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, borderColor: canSwitch ? AppColors.secondaryLightRedColor : AppColors.primaryRedColor, - textColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor, - iconColor: canSwitch ? AppColors.primaryRedColor : AppColors.whiteColor, + textColor: canSwitch ? AppColors.primaryRedColor : Colors.white, + iconColor: canSwitch ? AppColors.primaryRedColor : Colors.white, height: isFoldable ? 50.h : 45.h, fontSize: 14.f, ).paddingOnly(top: 12.h, right: 16.w, left: 16.w, bottom: 16.h); diff --git a/lib/presentation/radiology/radiology_result_page.dart b/lib/presentation/radiology/radiology_result_page.dart index 2328d0ea..7b3f11d4 100644 --- a/lib/presentation/radiology/radiology_result_page.dart +++ b/lib/presentation/radiology/radiology_result_page.dart @@ -85,14 +85,14 @@ class _RadiologyResultPageState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 14, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 40.h, icon: AppAssets.download, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 20.h, ), SizedBox(height: 16.h), @@ -145,14 +145,14 @@ class _RadiologyResultPageState extends State { }, backgroundColor: AppColors.successColor, borderColor: AppColors.successColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, fontSize: 16, fontWeight: FontWeight.w500, borderRadius: 12, padding: EdgeInsets.fromLTRB(10, 0, 10, 0), height: 45.h, icon: AppAssets.download, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, iconSize: 20.h, ).paddingSymmetrical(24.h, 24.h), ), diff --git a/lib/presentation/radiology/search_radiology.dart b/lib/presentation/radiology/search_radiology.dart index 8d63a59a..7c14fd1d 100644 --- a/lib/presentation/radiology/search_radiology.dart +++ b/lib/presentation/radiology/search_radiology.dart @@ -59,7 +59,7 @@ class _SearchRadiologyContentContentState extends State title: LocaleKeys.radiology.tr(), isClose: true, bottomChild: Container( - color: Colors.white, + color: AppColors.whiteColor, padding: EdgeInsets.all(ResponsiveExtension(20).h), child: CustomButton( text: LocaleKeys.search.tr(), @@ -144,7 +144,8 @@ class SuggestionChip extends StatelessWidget { borderRadius: BorderRadius.circular(8), ), child: label.toText12( - color: isSelected ? Colors.white : Colors.black87, + // color: isSelected ? Colors.white : Colors.black87, + color: AppColors.textColor, fontWeight: FontWeight.w500, ), ), diff --git a/lib/presentation/smartwatches/widgets/health_chart.dart b/lib/presentation/smartwatches/widgets/health_chart.dart index fe6ae78f..37474133 100644 --- a/lib/presentation/smartwatches/widgets/health_chart.dart +++ b/lib/presentation/smartwatches/widgets/health_chart.dart @@ -19,7 +19,7 @@ class HealthChart extends StatelessWidget { height: 200, padding: const EdgeInsets.all(16), decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(16), boxShadow: [ BoxShadow( diff --git a/lib/presentation/symptoms_checker/possible_conditions_screen.dart b/lib/presentation/symptoms_checker/possible_conditions_screen.dart index 80c70714..323a13c2 100644 --- a/lib/presentation/symptoms_checker/possible_conditions_screen.dart +++ b/lib/presentation/symptoms_checker/possible_conditions_screen.dart @@ -49,7 +49,7 @@ class PossibleConditionsPage extends StatelessWidget { child: Container( height: 80.h, decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(10.r), ), ), diff --git a/lib/presentation/symptoms_checker/risk_factors_screen.dart b/lib/presentation/symptoms_checker/risk_factors_screen.dart index 484ad2d7..462cffbd 100644 --- a/lib/presentation/symptoms_checker/risk_factors_screen.dart +++ b/lib/presentation/symptoms_checker/risk_factors_screen.dart @@ -184,7 +184,7 @@ class _RiskFactorsScreenState extends State { Container( height: 40.h, decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24.r), ), ).toShimmer2(isShow: true, radius: 24.r), diff --git a/lib/presentation/symptoms_checker/suggestions_screen.dart b/lib/presentation/symptoms_checker/suggestions_screen.dart index 8d32b7f4..cbfc15a1 100644 --- a/lib/presentation/symptoms_checker/suggestions_screen.dart +++ b/lib/presentation/symptoms_checker/suggestions_screen.dart @@ -160,7 +160,7 @@ class _SuggestionsScreenState extends State { Container( height: 40.h, decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24.r), ), ).toShimmer2(isShow: true, radius: 24.r), diff --git a/lib/presentation/symptoms_checker/symptoms_selector_screen.dart b/lib/presentation/symptoms_checker/symptoms_selector_screen.dart index cbbfc68e..d7fbf63c 100644 --- a/lib/presentation/symptoms_checker/symptoms_selector_screen.dart +++ b/lib/presentation/symptoms_checker/symptoms_selector_screen.dart @@ -222,7 +222,7 @@ class _SymptomsSelectorPageState extends State { Container( height: 40.h, decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24.r), ), ).toShimmer2(isShow: true, radius: 24.r), diff --git a/lib/presentation/symptoms_checker/triage_screen.dart b/lib/presentation/symptoms_checker/triage_screen.dart index 0231ef19..b4ceff4c 100644 --- a/lib/presentation/symptoms_checker/triage_screen.dart +++ b/lib/presentation/symptoms_checker/triage_screen.dart @@ -275,7 +275,7 @@ class _TriagePageState extends State { Container( height: 40.h, decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24.r), ), ).toShimmer2(isShow: true, radius: 24.r), diff --git a/lib/presentation/symptoms_checker/widgets/organ_dot_widget.dart b/lib/presentation/symptoms_checker/widgets/organ_dot_widget.dart index 0783dfb7..2ef4497c 100644 --- a/lib/presentation/symptoms_checker/widgets/organ_dot_widget.dart +++ b/lib/presentation/symptoms_checker/widgets/organ_dot_widget.dart @@ -34,7 +34,7 @@ class OrganDot extends StatelessWidget { child: Container( width: size.w * 0.25, height: size.h * 0.25, - decoration: const BoxDecoration( + decoration: BoxDecoration( shape: BoxShape.circle, color: AppColors.whiteColor, ), diff --git a/lib/presentation/todo_section/ancillary_order_payment_page.dart b/lib/presentation/todo_section/ancillary_order_payment_page.dart index b34bf212..9d75c769 100644 --- a/lib/presentation/todo_section/ancillary_order_payment_page.dart +++ b/lib/presentation/todo_section/ancillary_order_payment_page.dart @@ -264,6 +264,7 @@ class _AncillaryOrderPaymentPageState extends State { width: 200.h, height: 80.h, fit: BoxFit.contain, + applyThemeColor: false, ).paddingSymmetrical(24.h, 0.h).onPress(() { if (!todoSectionViewModel.isProcessingPayment) { if (Utils.havePrivilege(103)) { diff --git a/lib/presentation/todo_section/ancillary_procedures_details_page.dart b/lib/presentation/todo_section/ancillary_procedures_details_page.dart index eba80cd4..38d4f978 100644 --- a/lib/presentation/todo_section/ancillary_procedures_details_page.dart +++ b/lib/presentation/todo_section/ancillary_procedures_details_page.dart @@ -673,7 +673,7 @@ class _AncillaryOrderDetailsListState extends State { ); }, isDisabled: !isButtonEnabled, - textColor: AppColors.whiteColor, + textColor: Colors.white, borderRadius: 12.r, borderColor: Colors.transparent, padding: EdgeInsets.symmetric(vertical: 16.h), diff --git a/lib/presentation/water_monitor/water_consumption_page.dart b/lib/presentation/water_monitor/water_consumption_page.dart index 54dace58..7e6d1d5e 100644 --- a/lib/presentation/water_monitor/water_consumption_page.dart +++ b/lib/presentation/water_monitor/water_consumption_page.dart @@ -79,7 +79,7 @@ class _WaterConsumptionPageState extends State { subTitle.toText18(weight: FontWeight.w600), ], ), - Utils.buildSvgWithAssets(icon: AppAssets.greenTickIcon) + Utils.buildSvgWithAssets(icon: AppAssets.greenTickIcon, applyThemeColor: false) ], ).paddingSymmetrical(0, 8.h); } diff --git a/lib/presentation/water_monitor/water_monitor_settings_page.dart b/lib/presentation/water_monitor/water_monitor_settings_page.dart index a3c82c0c..81157c8a 100644 --- a/lib/presentation/water_monitor/water_monitor_settings_page.dart +++ b/lib/presentation/water_monitor/water_monitor_settings_page.dart @@ -75,7 +75,7 @@ class _WaterMonitorSettingsPageState extends State { message: "", child: Container( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 4.h, bottom: 4.h), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(20.r)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(20.r)), child: ListView.separated( shrinkWrap: true, itemCount: items.length, diff --git a/lib/theme/app_theme.dart b/lib/theme/app_theme.dart index c09d537f..51d2cbc2 100644 --- a/lib/theme/app_theme.dart +++ b/lib/theme/app_theme.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; class AppTheme { static ThemeData getTheme(isArabic) => ThemeData( @@ -14,33 +15,13 @@ class AppTheme { }, ), hintColor: Colors.grey[400], - // colorScheme: ColorScheme.fromSwatch(accentColor: MyColors.backgroundColor), disabledColor: Colors.grey[300], - // errorColor: const Colors, - // scaffoldBackgroundColor: MyColors.backgroundColor, textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), canvasColor: Colors.white, - // backgroundColor: const Color.fromRGBO(255, 255, 255, 1), highlightColor: Colors.grey[100]!.withOpacity(0.4), splashColor: Colors.transparent, - // primaryColor: primaryColor, - // primaryColorDark: primaryColor, - // toggleableActiveColor: secondaryColor, - // indicatorColor: secondaryColor, - // bottomSheetTheme: const BottomSheetThemeData( - // backgroundColor: Color(0xFFE0E0E0), - // ), bottomSheetTheme: BottomSheetThemeData( backgroundColor: Colors.black.withOpacity(0)), - // primaryTextTheme: const TextTheme( - // bodyText2: TextStyle(color: Colors.white), - // ), - // iconTheme: const IconThemeData(color: MyColors.darkTextColor), - // textTheme: const 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), - // ), floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), appBarTheme: AppBarTheme( color: const Color(0xff515A5D), @@ -52,6 +33,38 @@ class AppTheme { surfaceTintColor: Colors.transparent, ), ); + + static ThemeData getDarkTheme(isArabic) => ThemeData( + fontFamily: isArabic ? 'GESSTwo' : 'Poppins', + primarySwatch: Colors.red, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.dark, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder() + }, + ), + hintColor: Colors.grey[600], + disabledColor: Colors.grey[700], + textSelectionTheme: const TextSelectionThemeData(cursorColor: Colors.grey, selectionColor: Color.fromRGBO(80, 100, 253, 0.5), selectionHandleColor: Colors.grey), + canvasColor: AppColors.dark.scaffoldBgColor, + scaffoldBackgroundColor: AppColors.dark.scaffoldBgColor, + highlightColor: Colors.grey[800]!.withOpacity(0.4), + splashColor: Colors.transparent, + bottomSheetTheme: BottomSheetThemeData( + backgroundColor: Colors.black.withOpacity(0)), + floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2), + appBarTheme: AppBarTheme( + color: AppColors.dark.scaffoldBgColor, + elevation: 0.0, + actionsIconTheme: const IconThemeData( + color: Colors.white, + ), + systemOverlayStyle: SystemUiOverlayStyle.light, + surfaceTintColor: Colors.transparent, + ), + ); } extension ExtendedRevoCheckTheme on TextTheme { diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index f80085aa..514acfb4 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -1,118 +1,310 @@ import 'package:flutter/material.dart'; class AppColors { + /// Global dark-mode flag — toggled by ProfileSettingsViewModel. + /// When true, every getter below returns the dark palette value. + static bool isDarkMode = false; + static const transparent = Colors.transparent; - static const mainPurple = Color(0xFF7954F7); // #7954F7 - - static const scaffoldBgColor = Color(0xFFF8F8F8); // #F8F8F8 - static const bottomSheetBgColor = Color(0xFFF8F8FA); // #F8F8FA - static const lightGreyEFColor = Color(0xffeaeaff); // #EAEAFF - static const greyF7Color = Color(0xffF7F7F7); // #F7F7F7 - static const greyInfoTextColor = Color(0xff777777); // #777777 - static const lightGrayColor = Color(0xff808080); // #808080 - static const greyTextColorLight = Color(0xFFA2A2A2); // #A2A2A2 - -// New UI Colors - static const whiteColor = Color(0xFFffffff); // #FFFFFF - static const Color bgScaffoldColor = Color(0xffF8F8F8); // #F8F8F8 - static const Color primaryRedColor = Color(0xFFED1C2B); // #ED1C2B - static const Color primaryRedBorderColor = Color(0xFFED1C2B); // #ED1C2B - static const Color secondaryLightRedColor = Color(0xFFFEE9EA); // #FEE9EA - static const Color secondaryLightRedBorderColor = Color(0xFFFEE9EA); // #FEE9EA - static const Color bgRedLightColor = Color(0xFFFEE9EA); // #FEE9EA - static const Color bgGreenColor = Color(0xFF18C273); // #18C273 - static const Color textColor = Color(0xFF2E3039); // #2E3039 - static const Color borderGrayColor = Color(0x332E3039); // #2E3039 (20% opacity) - static const Color textColorLight = Color(0xFF5E5E5E); // #5E5E5E - static const Color borderOnlyColor = Color(0xFF2E3039); // #2E3039 - static const Color chipBorderColorOpacity20 = Color(0x332E3039); // #2E3039 (20% opacity) - static const Color dividerColor = Color(0x40D2D2D2); // #D2D2D2 (25% opacity) - static const Color warningColorYellow = Color(0xFFF4A308); // #F4A308 - static const Color blackBgColor = Color(0xFF2E3039); // #2E3039 - static const blackColor = textColor; // #2E3039 - static const Color inputLabelTextColor = Color(0xff898A8D); // #898A8D - static const Color greyTextColor = Color(0xFF8F9AA3); // #8F9AA3 - static const Color lightGrayBGColor = Color(0x142E3039); // #2E3039 (8% opacity) - static const Color checkBoxBorderColor = Color(0xffD2D2D2); // #D2D2D2 - - static const Color pharmacyBGColor = Color(0xFF359846); // #359846 - - static const lightGreenColor = Color(0xFF0ccedde); // #0CCEDDE - static const textGreenColor = Color(0xFF18C273); // #18C273 - static const Color ratingColorYellow = Color(0xFFFFAF15); // #FFAF15 - static const Color spacerLineColor = Color(0x2E30391A); // #2E3039 (10% opacity) - - //Chips - static const Color successColor = Color(0xff18C273); // #18C273 - static const Color successLightBgColor = Color(0xffDDF6EA); // #DDF6EA - static const Color errorColor = Color(0xFFED1C2B); // #ED1C2B - static const Color alertColor = Color(0xFFD48D05); // #D48D05 - static const Color infoColor = Color(0xFF0B85F7); // #0B85F7 - static const Color warningColor = Color(0xFFFFCC00); // #FFCC00 - static const Color greyColor = Color(0xFFEFEFF0); // #EFEFF0 - static const Color chipPrimaryRedBorderColor = Color(0xFFED1C2B); // #ED1C2B - static const Color chipSecondaryLightRedColor = Color(0xFFFEE9EA); // #FEE9EA - // static const Color chipSecondaryLightRedColor = Color(0xFFFF9E15); // #FEE9EA - - static const Color successLightColor = Color(0xFF18C273); // #18C273 - static const Color errorLightColor = Color(0xFFED1C2B); // #ED1C2B - static const Color alertLightColor = Color(0xFFD48D05); // #D48D05 - static const Color infoLightColor = Color(0xFF0B85F7); // #0B85F7 - static const Color warningLightColor = Color(0xFFFFCC00); // #FFCC00 - static const Color greyLightColor = Color(0xFFEFEFF0); // #EFEFF0 - static const Color thumbColor = Color(0xFF18C273); // #18C273 - static const Color switchBackgroundColor = Color(0x2618C273); // #18C273 (15% opacity) - - static const Color bottomNAVBorder = Color(0xFFEEEEEE); // #EEEEEE - - static const Color quickLoginColor = Color(0xFF666666); // #666666 - - static const Color tooltipTextColor = Color(0xFF414D55); // #414D55 - static const Color graphGridColor = Color(0x4D18C273); // #18C273 (30% opacity) - static const Color criticalLowAndHigh = Color(0xFFED1C2B); // #ED1C2B - static const Color highAndLow = Color(0xFFFFAF15); // #FFAF15 - static const Color labelTextColor = Color(0xFF838383); // #838383 - static const Color calenderTextColor = Color(0xFFD0D0D0); // #D0D0D0 - static const Color lightGreenButtonColor = Color(0x2618C273); // #18C273 (15% opacity) - - static const Color lightRedButtonColor = Color(0x1AED1C2B); // #ED1C2B (10% opacity) - - // Status Colors - static const Color statusPendingColor = Color(0xffCC9B14); // #CC9B14 - static const Color statusProcessingColor = Color(0xff2E303A); // #2E303A - static const Color statusCompletedColor = Color(0xff359846); // #359846 - static const Color statusRejectedColor = Color(0xffD02127); // #D02127 - - // Info Banner Colors - static const Color infoBannerBgColor = Color(0xFFFFF4E6); // #FFF4E6 - static const Color infoBannerBorderColor = Color(0xFFFFE5B4); // #FFE5B4 - static const Color infoBannerIconColor = Color(0xFFCC9B14); // #CC9B14 - static const Color infoBannerTextColor = Color(0xFF856404); // #856404 - - // SymptomsChecker - - static const Color chipColorSeekMedicalAdvice = Color(0xFFFFAF15); // #FFAF15 - static const Color chipTextColorSeekMedicalAdvice = Color(0xFFD48D05); // #AB7103 - static const Color chipColorMonitor = Color(0xFF18C273); // #18C273 - static const Color chipColorEmergency = Color(0xFFED1C2B); // #ED1C2B - - // Services Page Colors - static const Color eReferralCardColor = Color(0xFFFF8012); // #FF8012 - static const Color bloodDonationCardColor = Color(0xFFFF5662); // #FF5662 - static const Color myChildVaccineCardColor = Color(0xFFFF2D78); // #FF5662 - static const Color bookAppointment = Color(0xFF415364); // #415364 + + // ── Scaffold / Background ───────────────────────────────────────────────── + static Color get scaffoldBgColor => isDarkMode ? dark.scaffoldBgColor : const Color(0xFFF8F8F8); + static Color get bottomSheetBgColor => isDarkMode ? dark.bottomSheetBgColor : const Color(0xFFF8F8FA); + static Color get lightGreyEFColor => isDarkMode ? dark.lightGreyEFColor : const Color(0xffeaeaff); + static Color get greyF7Color => isDarkMode ? dark.greyF7Color : const Color(0xffF7F7F7); + static Color get greyInfoTextColor => isDarkMode ? dark.greyInfoTextColor : const Color(0xff777777); + static Color get lightGrayColor => isDarkMode ? dark.lightGrayColor : const Color(0xff808080); + static Color get greyTextColorLight => isDarkMode ? dark.greyTextColorLight : const Color(0xFFA2A2A2); + static Color get mainPurple => isDarkMode ? dark.mainPurple : const Color(0xFF7954F7); + + // ── Core Colors ─────────────────────────────────────────────────────────── + static Color get whiteColor => isDarkMode ? dark.whiteColor : const Color(0xFFffffff); + // static const Color primaryRedColor = Color(0xFFED1C2B); + static Color get primaryRedColor => isDarkMode ? dark.primaryRedColor : Color(0xFFED1C2B); + static Color get secondaryLightRedColor => isDarkMode ? dark.secondaryLightRedColor : const Color(0xFFFEE9EA); + static const Color successColor = Color(0xFF18C273); + static Color get successLightBgColor => isDarkMode ? dark.successLightBgColor : const Color(0xffDDF6EA); + static Color get greyColor => isDarkMode ? dark.greyColor : const Color(0xFFEFEFF0); + static Color get chipBgColor => isDarkMode ? dark.chipBgColor : const Color(0xFFEFEFF0); + static Color get textColor => isDarkMode ? dark.textColor : const Color(0xFF2E3039); + static Color get iconColor => isDarkMode ? dark.iconColor : const Color(0xFF2E3039); + static Color get borderGrayColor => isDarkMode ? dark.borderGrayColor : const Color(0x332E3039); + static Color get textColorLight => isDarkMode ? dark.textColorLight : const Color(0xFF5E5E5E); + static Color get dividerColor => isDarkMode ? dark.dividerColor : const Color(0x40D2D2D2); + static Color get warningColorYellow => isDarkMode ? dark.warningColorYellow : const Color(0xFFF4A308); + static Color get inputLabelTextColor => isDarkMode ? dark.inputLabelTextColor : const Color(0xff898A8D); + static Color get greyTextColor => isDarkMode ? dark.greyTextColor : const Color(0xFF8F9AA3); + static Color get lightGrayBGColor => isDarkMode ? dark.lightGrayBGColor : const Color(0x142E3039); + static Color get checkBoxBorderColor => isDarkMode ? dark.checkBoxBorderColor : const Color(0xffD2D2D2); + static Color get pharmacyBGColor => isDarkMode ? dark.pharmacyBGColor : const Color(0xFF359846); + static Color get lightGreenColor => isDarkMode ? dark.lightGreenColor : const Color(0xFF0ccedde); + static Color get ratingColorYellow => isDarkMode ? dark.ratingColorYellow : const Color(0xFFFFAF15); + static Color get spacerLineColor => isDarkMode ? dark.spacerLineColor : const Color(0x2E30391A); + + // ── Semantic / Status Colors ────────────────────────────────────────────── + static Color get errorColor => isDarkMode ? dark.errorColor : const Color(0xFFED1C2B); + static Color get alertColor => isDarkMode ? dark.alertColor : const Color(0xFFD48D05); + static Color get infoColor => isDarkMode ? dark.infoColor : const Color(0xFF0B85F7); + static Color get warningColor => isDarkMode ? dark.warningColor : const Color(0xFFFFCC00); + static Color get switchBackgroundColor => isDarkMode ? dark.switchBackgroundColor : const Color(0x2618C273); + static Color get bottomNAVBorder => isDarkMode ? dark.bottomNAVBorder : const Color(0xFFEEEEEE); + static Color get quickLoginColor => isDarkMode ? dark.quickLoginColor : const Color(0xFF666666); + static Color get tooltipTextColor => isDarkMode ? dark.tooltipTextColor : const Color(0xFF414D55); + static Color get graphGridColor => isDarkMode ? dark.graphGridColor : const Color(0x4D18C273); + static Color get highAndLow => isDarkMode ? dark.highAndLow : const Color(0xFFFFAF15); + static Color get labelTextColor => isDarkMode ? dark.labelTextColor : const Color(0xFF838383); + static Color get calenderTextColor => isDarkMode ? dark.calenderTextColor : const Color(0xFFD0D0D0); + static Color get lightGreenButtonColor => isDarkMode ? dark.lightGreenButtonColor : const Color(0x2618C273); + static Color get lightRedButtonColor => isDarkMode ? dark.lightRedButtonColor : const Color(0x1AED1C2B); + + // ── Status Colors ───────────────────────────────────────────────────────── + static Color get statusPendingColor => isDarkMode ? dark.statusPendingColor : const Color(0xffCC9B14); + static Color get statusProcessingColor => isDarkMode ? dark.statusProcessingColor : const Color(0xff2E303A); + static Color get statusCompletedColor => isDarkMode ? dark.statusCompletedColor : const Color(0xff359846); + static Color get statusRejectedColor => isDarkMode ? dark.statusRejectedColor : const Color(0xffD02127); + + // ── Info Banner Colors ──────────────────────────────────────────────────── + static Color get infoBannerBgColor => isDarkMode ? dark.infoBannerBgColor : const Color(0xFFFFF4E6); + static Color get infoBannerBorderColor => isDarkMode ? dark.infoBannerBorderColor : const Color(0xFFFFE5B4); + static Color get infoBannerIconColor => isDarkMode ? dark.infoBannerIconColor : const Color(0xFFCC9B14); + static Color get infoBannerTextColor => isDarkMode ? dark.infoBannerTextColor : const Color(0xFF856404); + + // ── Symptoms Checker ─────────────────────────────────────────────��──────── + static Color get chipColorSeekMedicalAdvice => isDarkMode ? dark.chipColorSeekMedicalAdvice : const Color(0xFFFFAF15); + static Color get chipTextColorSeekMedicalAdvice => isDarkMode ? dark.chipTextColorSeekMedicalAdvice : const Color(0xFFD48D05); + + // ── Services Page Colors ────────────────────────────────────────────────── + static Color get eReferralCardColor => isDarkMode ? dark.eReferralCardColor : const Color(0xFFFF8012); + static Color get bloodDonationCardColor => isDarkMode ? dark.bloodDonationCardColor : const Color(0xFFFF5662); + static Color get myChildVaccineCardColor => isDarkMode ? dark.myChildVaccineCardColor : const Color(0xFFFF2D78); + static Color get bookAppointment => isDarkMode ? dark.bookAppointment : const Color(0xFF415364); + + // ── Water Monitor ───────────────────────────────────────────────────────── + static Color get blueColor => isDarkMode ? dark.blueColor : const Color(0xFF4EB5FF); + static Color get blueGradientColorOne => isDarkMode ? dark.blueGradientColorOne : const Color(0xFFF1F7FD); + static Color get blueGradientColorTwo => isDarkMode ? dark.blueGradientColorTwo : const Color(0xFFD9EFFF); + + // ── Shimmer ─────────────────────────────────────────────────────────────── + static Color get shimmerBaseColor => isDarkMode ? dark.shimmerBaseColor : const Color(0xFFE0E0E0); + static Color get shimmerHighlightColor => isDarkMode ? dark.shimmerHighlightColor : const Color(0xFFF5F5F5); + static Color get covid29Color => isDarkMode ? dark.covid29Color : const Color(0xff2563EB); + static Color get lightGreyTextColor => isDarkMode ? dark.lightGreyTextColor : const Color(0xFF959595); + static Color get labelColorYellow => isDarkMode ? dark.labelColorYellow : const Color(0xFFFBCB6E); + + static const LinearGradient aiLinearGradient = + LinearGradient(colors: [Color(0xFF8A38F5), Color(0xFFE20BBB)], begin: Alignment.topLeft, end: Alignment.bottomRight); + + // ── Aliases ─────────────────────────────────────────────────────────────── + static Color get bgScaffoldColor => scaffoldBgColor; + static Color get primaryRedBorderColor => primaryRedColor; + static Color get chipPrimaryRedBorderColor => primaryRedColor; + static Color get criticalLowAndHigh => primaryRedColor; + static Color get chipColorEmergency => primaryRedColor; + static Color get errorLightColor => primaryRedColor; + static Color get secondaryLightRedBorderColor => secondaryLightRedColor; + static Color get bgRedLightColor => secondaryLightRedColor; + static Color get chipSecondaryLightRedColor => secondaryLightRedColor; + static Color get blackBgColor => textColor; + static Color get blackColor => textColor; + static Color get borderOnlyColor => textColor; + static Color get chipBorderColorOpacity20 => borderGrayColor; + static Color get bgGreenColor => successColor; + static Color get textGreenColor => successColor; + static Color get successLightColor => successColor; + static Color get thumbColor => successColor; + static Color get chipColorMonitor => successColor; + static Color get greyLightColor => greyColor; + static Color get alertLightColor => alertColor; + static Color get infoLightColor => infoColor; + static Color get warningLightColor => warningColor; + + // ── Dark Mode Palette ───────────────────────────────────────────────────── + static const AppColorsDark dark = AppColorsDark(); +} + +// --------------------------------------------------------------------------- +// Dark palette — mirrors every color in AppColors with a dark-friendly value. +// --------------------------------------------------------------------------- +class AppColorsDark { + const AppColorsDark(); + + // Scaffold / Background + Color get scaffoldBgColor => const Color(0xFF191919); + Color get bottomSheetBgColor => const Color(0xFF1C1C1E); + Color get lightGreyEFColor => const Color(0xFF2A2A3A); + Color get greyF7Color => const Color(0xFF1E1E1E); + Color get greyInfoTextColor => const Color(0xFF9E9E9E); + Color get lightGrayColor => const Color(0xFF9E9E9E); + Color get greyTextColorLight => const Color(0xFF757575); + + // ⚠️ NEW — was missing from AppColorsDark + Color get mainPurple => const Color(0xFF9B7AFF); // brighter purple for dark surfaces + + // Core + Color get baseColor => const Color(0xFF1E1E1E); + // ⚠️ NEW — maps whiteColor → dark surface color + Color get whiteColor => const Color(0xFF1E1E1E); // surface replacement for white + Color get primaryRedColor => const Color(0xFFDE5C5D); + Color get secondaryLightRedColor => const Color(0xFF3A1015); + Color get successColor => const Color(0xFF18C273); + Color get successLightBgColor => const Color(0xFF0D2E1F); + Color get textColor => const Color(0xFFFFFFFF); + Color get iconColor => const Color(0xFFFFFFFF); + Color get borderGrayColor => const Color(0x55ECECEC); + Color get textColorLight => const Color(0xFFB0B0B0); + Color get dividerColor => const Color(0x33FFFFFF); + Color get warningColorYellow => const Color(0xFFF4A308); + Color get inputLabelTextColor => const Color(0xFF9E9E9E); + Color get greyTextColor => const Color(0xFF8F9AA3); + Color get lightGrayBGColor => const Color(0x22FFFFFF); + Color get checkBoxBorderColor => const Color(0xFF555555); + Color get pharmacyBGColor => const Color(0xFF359846); + // ⚠️ NEW — was missing from AppColorsDark + Color get lightGreenColor => const Color(0xFF0ccedde); // same teal accent — works on dark + Color get ratingColorYellow => const Color(0xFFFFAF15); + Color get spacerLineColor => const Color(0x22FFFFFF); + + // Semantic / Status + Color get errorColor => const Color(0xFFD63D48); + Color get alertColor => const Color(0xFFD48D05); + Color get infoColor => const Color(0xFF4DA6FF); + Color get warningColor => const Color(0xFFFFCC00); + Color get greyColor => const Color(0xFF2C2C2E); + Color get chipBgColor => const Color(0xFF3E3E3E); + Color get cardDarkBorderColor => const Color(0x0DEAEAEA); + Color get serviceCardButtonColor => const Color(0xFF3E3E3E); + Color get switchBackgroundColor => const Color(0x2618C273); + Color get bottomNAVBorder => const Color(0xFF2C2C2E); + Color get quickLoginColor => const Color(0xFF9E9E9E); + Color get tooltipTextColor => const Color(0xFFCFD8DC); + Color get graphGridColor => const Color(0x4D18C273); + Color get highAndLow => const Color(0xFFFFAF15); + Color get labelTextColor => const Color(0xFF9E9E9E); + Color get calenderTextColor => const Color(0xFF555555); + Color get lightGreenButtonColor => const Color(0x2618C273); + Color get lightRedButtonColor => const Color(0x1AED1C2B); + + // Status + Color get statusPendingColor => const Color(0xFFCC9B14); + Color get statusProcessingColor => const Color(0xFFECECEC); + Color get statusCompletedColor => const Color(0xFF359846); + Color get statusRejectedColor => const Color(0xFFD02127); + + // Info Banner + Color get infoBannerBgColor => const Color(0xFF2A1F0A); + Color get infoBannerBorderColor => const Color(0xFF5A3D0A); + Color get infoBannerIconColor => const Color(0xFFCC9B14); + Color get infoBannerTextColor => const Color(0xFFFFCB6B); + + // Symptoms Checker + Color get chipColorSeekMedicalAdvice => const Color(0xFFFFAF15); + Color get chipTextColorSeekMedicalAdvice => const Color(0xFFD48D05); + + // Services Page + Color get eReferralCardColor => const Color(0xFFFF8012); + Color get bloodDonationCardColor => const Color(0xFFFF5662); + Color get myChildVaccineCardColor => const Color(0xFFFF2D78); + Color get bookAppointment => const Color(0xFF415364); + + // Water Monitor + Color get blueColor => const Color(0xFF4EB5FF); + Color get blueGradientColorOne => const Color(0xFF101C2A); + Color get blueGradientColorTwo => const Color(0xFF0D2235); + + // Shimmer + Color get shimmerBaseColor => const Color(0xFF2C2C2C); + Color get shimmerHighlightColor => const Color(0xFF3D3D3D); + Color get covid29Color => const Color(0xFF2563EB); + Color get lightGreyTextColor => const Color(0xFF757575); + Color get labelColorYellow => const Color(0xFFFBCB6E); + + // Aliases + Color get bgScaffoldColor => scaffoldBgColor; + Color get primaryRedBorderColor => primaryRedColor; + Color get chipPrimaryRedBorderColor => primaryRedColor; + Color get criticalLowAndHigh => primaryRedColor; + Color get chipColorEmergency => primaryRedColor; + Color get errorLightColor => primaryRedColor; + Color get secondaryLightRedBorderColor => secondaryLightRedColor; + Color get bgRedLightColor => secondaryLightRedColor; + Color get chipSecondaryLightRedColor => secondaryLightRedColor; + Color get blackBgColor => textColor; + Color get blackColor => textColor; + Color get borderOnlyColor => textColor; + Color get chipBorderColorOpacity20 => borderGrayColor; + Color get bgGreenColor => successColor; + Color get textGreenColor => successColor; + Color get successLightColor => successColor; + Color get thumbColor => successColor; + Color get chipColorMonitor => successColor; + Color get greyLightColor => greyColor; + Color get alertLightColor => alertColor; + Color get infoLightColor => infoColor; + Color get warningLightColor => warningColor; +} + +// --------------------------------------------------------------------------- +// BuildContext extension — resolves the right palette based on theme brightness +// --------------------------------------------------------------------------- +extension AppColorsContext on BuildContext { + bool get _isDark => Theme.of(this).brightness == Brightness.dark; + + // Scaffold / Background + Color get scaffoldBgColor => _isDark ? AppColors.dark.scaffoldBgColor : const Color(0xFFF8F8F8); + Color get bottomSheetBgColor => _isDark ? AppColors.dark.bottomSheetBgColor : const Color(0xFFF8F8FA); + Color get greyF7Color => _isDark ? AppColors.dark.greyF7Color : const Color(0xffF7F7F7); + Color get greyInfoTextColor => _isDark ? AppColors.dark.greyInfoTextColor : const Color(0xff777777); + Color get lightGrayColor => _isDark ? AppColors.dark.lightGrayColor : const Color(0xff808080); + + // Core + Color get cardBaseColor => _isDark ? AppColors.dark.baseColor : const Color(0xFFFFFFFF); + Color get primaryRedColor => _isDark ? AppColors.dark.primaryRedColor : AppColors.primaryRedColor; + Color get secondaryLightRedColor => _isDark ? AppColors.dark.serviceCardButtonColor : const Color(0xFFFEE9EA); + Color get secondaryLightRedForegroundColor => _isDark ? const Color(0xFFFFFFFF) : AppColors.primaryRedColor; + Color get successColor => AppColors.successColor; + Color get successLightBgColor => _isDark ? AppColors.dark.successLightBgColor : const Color(0xffDDF6EA); + Color get textColor => _isDark ? AppColors.dark.textColor : const Color(0xFF2E3039); + Color get iconColor => _isDark ? AppColors.dark.iconColor : const Color(0xFF2E3039); + Color get borderGrayColor => _isDark ? AppColors.dark.borderGrayColor : const Color(0x332E3039); + Color get textColorLight => _isDark ? AppColors.dark.textColorLight : const Color(0xFF5E5E5E); + Color get dividerColor => _isDark ? AppColors.dark.dividerColor : const Color(0x40D2D2D2); + Color get inputLabelTextColor => _isDark ? AppColors.dark.inputLabelTextColor : const Color(0xff898A8D); + Color get greyTextColor => AppColors.greyTextColor; + Color get lightGrayBGColor => _isDark ? AppColors.dark.lightGrayBGColor : const Color(0x142E3039); + Color get checkBoxBorderColor => _isDark ? AppColors.dark.checkBoxBorderColor : const Color(0xffD2D2D2); + + // Status / Semantic + Color get errorColor => _isDark ? AppColors.dark.errorColor : const Color(0xFFED1C2B); + Color get alertColor => AppColors.alertColor; + Color get infoColor => _isDark ? AppColors.dark.infoColor : const Color(0xFF0B85F7); + Color get warningColor => AppColors.warningColor; + Color get greyColor => _isDark ? AppColors.dark.greyColor : const Color(0xFFEFEFF0); + Color get chipBgColor => _isDark ? AppColors.dark.chipBgColor : const Color(0xFFEFEFF0); + Color get cardDarkBorderColor => _isDark ? AppColors.dark.cardDarkBorderColor : Colors.transparent; + Color get serviceCardButtonColor => _isDark ? AppColors.dark.serviceCardButtonColor : const Color(0xFF2E3039); + Color get bottomNAVBorder => _isDark ? AppColors.dark.bottomNAVBorder : const Color(0xFFEEEEEE); + Color get labelTextColor => _isDark ? AppColors.dark.labelTextColor : const Color(0xFF838383); + Color get lightGreyTextColor => _isDark ? AppColors.dark.lightGreyTextColor : const Color(0xFF959595); + + // Info Banner + Color get infoBannerBgColor => _isDark ? AppColors.dark.infoBannerBgColor : const Color(0xFFFFF4E6); + Color get infoBannerBorderColor => _isDark ? AppColors.dark.infoBannerBorderColor : const Color(0xFFFFE5B4); + Color get infoBannerIconColor => AppColors.infoBannerIconColor; + Color get infoBannerTextColor => _isDark ? AppColors.dark.infoBannerTextColor : const Color(0xFF856404); // Water Monitor - static const Color blueColor = Color(0xFF4EB5FF); // #4EB5FF - static const Color blueGradientColorOne = Color(0xFFF1F7FD); // #F1F7FD - static const Color blueGradientColorTwo = Color(0xFFD9EFFF); // #D9EFFF + Color get blueColor => AppColors.blueColor; + Color get blueGradientColorOne => _isDark ? AppColors.dark.blueGradientColorOne : const Color(0xFFF1F7FD); + Color get blueGradientColorTwo => _isDark ? AppColors.dark.blueGradientColorTwo : const Color(0xFFD9EFFF); // Shimmer - static const Color shimmerBaseColor = Color(0xFFE0E0E0); // #E0E0E0 - static const Color shimmerHighlightColor = Color(0xFFF5F5F5); // #F5F5F5 - static const Color covid29Color = Color(0xff2563EB); // #2563EB - static const Color lightGreyTextColor = Color(0xFF959595); - static const Color labelColorYellow = Color(0xFFFBCB6E); + Color get shimmerBaseColor => _isDark ? AppColors.dark.shimmerBaseColor : const Color(0xFFE0E0E0); + Color get shimmerHighlightColor => _isDark ? AppColors.dark.shimmerHighlightColor : const Color(0xFFF5F5F5); - static const LinearGradient aiLinearGradient = LinearGradient(colors: [Color(0xFF8A38F5), Color(0xFFE20BBB)], begin: Alignment.topLeft, end: Alignment.bottomRight); + // Aliases + Color get bgScaffoldColor => scaffoldBgColor; + Color get bgGreenColor => successColor; + Color get bgRedLightColor => secondaryLightRedColor; + Color get blackColor => textColor; + Color get blackBgColor => textColor; } diff --git a/lib/widgets/appbar/app_bar_widget.dart b/lib/widgets/appbar/app_bar_widget.dart index 942a93f2..05db7724 100644 --- a/lib/widgets/appbar/app_bar_widget.dart +++ b/lib/widgets/appbar/app_bar_widget.dart @@ -57,7 +57,7 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget { ), // Logo - if (!hideLogoAndLang) Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, height: 24.h), + if (!hideLogoAndLang) Utils.buildSvgWithAssets(icon: AppAssets.habiblogo, height: 24.h, applyThemeColor: false), if (!hideLogoAndLang) Expanded( diff --git a/lib/widgets/appbar/collapsing_toolbar.dart b/lib/widgets/appbar/collapsing_toolbar.dart index 8bf1e4b4..9b1d4854 100644 --- a/lib/widgets/appbar/collapsing_toolbar.dart +++ b/lib/widgets/appbar/collapsing_toolbar.dart @@ -96,7 +96,7 @@ class _CollapsingToolbarState extends State { ? Transform.flip( flipX: appState.isArabic(), child: IconButton( - icon: Utils.buildSvgWithAssets(icon: widget.isClose ? AppAssets.closeBottomNav : AppAssets.arrow_back, width: 32.h, height: 32.h), + icon: Utils.buildSvgWithAssets(icon: widget.isClose ? AppAssets.closeBottomNav : AppAssets.arrow_back, width: 32.h, height: 32.h, applyThemeColor: false), padding: EdgeInsets.only(left: 12), onPressed: () => Navigator.pop(context), highlightColor: Colors.transparent, diff --git a/lib/widgets/arrow_back.dart b/lib/widgets/arrow_back.dart index cf3e52ef..4446ea9b 100644 --- a/lib/widgets/arrow_back.dart +++ b/lib/widgets/arrow_back.dart @@ -3,12 +3,13 @@ import 'package:flutter/material.dart'; class ArrowBack extends StatelessWidget { final Function? onTap; - final Color color; + final Color? color; - ArrowBack({Key? key, this.onTap, this.color = AppColors.whiteColor}) : super(key: key); + ArrowBack({Key? key, this.onTap, this.color}) : super(key: key); @override Widget build(BuildContext context) { + final resolvedColor = color ?? AppColors.whiteColor; // ProjectViewModel projectViewModel = Provider.of(context); return GestureDetector( behavior: HitTestBehavior.opaque, @@ -17,7 +18,7 @@ class ArrowBack extends StatelessWidget { }, context), child: Icon( Icons.arrow_back_ios, - color: color, + color: resolvedColor, ), ); } diff --git a/lib/widgets/bottom_navigation/bottom_navigation.dart b/lib/widgets/bottom_navigation/bottom_navigation.dart index 46067dfe..9d390388 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation.dart @@ -28,9 +28,7 @@ class BottomNavigation extends StatelessWidget { icon: AppAssets.bookAppoBottom, fillIcon: AppAssets.bookAppoBottom, label: LocaleKeys.appointment.tr(context: context), - iconSize: 32, - isSpecial: true, - ), + iconSize: 32, isSpecial: true), appState.isAuthenticated // ? BottomNavItem(icon: AppAssets.toDoBottom, label: LocaleKeys.todoList.tr(context: context)) ? BottomNavItem(icon: AppAssets.symptomCheckerBottomIcon, fillIcon: AppAssets.symptomCheckerBottomFillIcon, label: LocaleKeys.symptoms.tr(context: context)) @@ -39,8 +37,16 @@ class BottomNavigation extends StatelessWidget { ]; return Container( - decoration: _containerDecoration, - padding: _containerPadding, + decoration: BoxDecoration( + color: AppColors.whiteColor, + border: Border( + top: BorderSide( + color: AppColors.bottomNAVBorder, + width: 0.5, + ), + ), + ), + padding: const EdgeInsets.all(15), // height: 84.h, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -69,6 +75,7 @@ class BottomNavigation extends StatelessWidget { icon: isSelected ? item.fillIcon : item.icon, height: item.iconSize.h, width: item.iconSize.w, + applyThemeColor: !item.isSpecial // iconColor: isSelected ? Colors.black87 : Colors.black87, ), // const SizedBox(height: 10), @@ -100,14 +107,3 @@ class BottomNavItem { }); } -// Constants -const EdgeInsets _containerPadding = EdgeInsets.all(15); -const BoxDecoration _containerDecoration = BoxDecoration( - color: Colors.white, - border: Border( - top: BorderSide( - color: AppColors.bottomNAVBorder, - width: 0.5, - ), - ), -); diff --git a/lib/widgets/bottom_sheet.dart b/lib/widgets/bottom_sheet.dart index 4aef0efa..ee70782b 100644 --- a/lib/widgets/bottom_sheet.dart +++ b/lib/widgets/bottom_sheet.dart @@ -1,5 +1,6 @@ import 'package:hmg_patient_app_new/extensions/int_extensions.dart'; import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; void showMyBottomSheet(BuildContext context, {required Widget child, required VoidCallback callBackFunc, String? type}) { showModalBottomSheet( @@ -10,8 +11,8 @@ void showMyBottomSheet(BuildContext context, {required Widget child, required Vo return Container( constraints: BoxConstraints( maxHeight: type =='CONTINUE_ACTION' ? MediaQuery.of(context).size.height *.75 : double.infinity,), - decoration: const BoxDecoration( - color: Colors.white, + decoration: BoxDecoration( + color: AppColors.whiteColor, borderRadius: BorderRadius.only( topRight: Radius.circular(25), topLeft: Radius.circular(25), diff --git a/lib/widgets/buttons/default_button.dart b/lib/widgets/buttons/default_button.dart index d8d8cacd..f6a47a1c 100644 --- a/lib/widgets/buttons/default_button.dart +++ b/lib/widgets/buttons/default_button.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; extension WithContainer on Widget { Widget get insideContainer => Container( - color: Colors.white, + color: AppColors.whiteColor, padding: const EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this, ); diff --git a/lib/widgets/chip/app_custom_chip_widget.dart b/lib/widgets/chip/app_custom_chip_widget.dart index 8597b3ed..77345933 100644 --- a/lib/widgets/chip/app_custom_chip_widget.dart +++ b/lib/widgets/chip/app_custom_chip_widget.dart @@ -9,23 +9,24 @@ class AppCustomChipWidget extends StatelessWidget { const AppCustomChipWidget({ super.key, this.labelText, - this.textColor = AppColors.textColor, - this.backgroundColor = AppColors.greyColor, + this.textColor, + this.backgroundColor, this.iconSize, this.icon = "", - this.iconColor = AppColors.textColor, + this.iconColor, this.richText, this.iconHasColor = true, this.shape, this.deleteIcon, this.deleteIconSize, - this.deleteIconColor = AppColors.textColor, + this.deleteIconColor, this.deleteIconHasColor = false, this.padding = EdgeInsets.zero, this.isIconPNG = false, this.onChipTap, this.labelPadding, this.onDeleteTap, + this.applyThemeColor = true, }); final String? labelText; @@ -36,7 +37,7 @@ class AppCustomChipWidget extends StatelessWidget { final String icon; final String? deleteIcon; final Size? deleteIconSize; - final Color iconColor; + final Color? iconColor; final Color? deleteIconColor; final bool iconHasColor; final bool deleteIconHasColor; @@ -46,10 +47,15 @@ class AppCustomChipWidget extends StatelessWidget { final bool isIconPNG; final void Function()? onChipTap; final void Function()? onDeleteTap; + final bool applyThemeColor; @override Widget build(BuildContext context) { final iconS = iconSize ?? 12.w; + final resolvedTextColor = textColor ?? AppColors.textColor; + final resolvedBackgroundColor = backgroundColor ?? AppColors.greyColor; + final resolvedIconColor = iconColor ?? AppColors.textColor; + final resolvedDeleteIconColor = deleteIconColor ?? AppColors.textColor; return GestureDetector( onTap: onChipTap, child: SizedBox( @@ -74,15 +80,16 @@ class AppCustomChipWidget extends StatelessWidget { icon: icon, width: iconS, height: iconS, - iconColor: iconHasColor ? iconColor : null, + iconColor: iconHasColor ? resolvedIconColor : null, fit: BoxFit.contain, + applyThemeColor: applyThemeColor, ) : SizedBox.shrink(), - label: richText ?? (labelText?? "").toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor), + label: richText ?? (labelText?? "").toText10(weight: FontWeight.w500, letterSpacing: 0, color: resolvedTextColor), padding: padding, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, labelPadding: labelPadding ?? EdgeInsetsDirectional.only(end: deleteIcon?.isNotEmpty == true ? 2.w : 8.w), - backgroundColor: backgroundColor, + backgroundColor: resolvedBackgroundColor, shape: shape ?? SmoothRectangleBorder( borderRadius: BorderRadius.circular(8.r), @@ -96,7 +103,8 @@ class AppCustomChipWidget extends StatelessWidget { icon: deleteIcon!, width: iconS, height: iconS, - iconColor: deleteIconHasColor ? deleteIconColor : null, + iconColor: deleteIconHasColor ? resolvedDeleteIconColor : null, + applyThemeColor: applyThemeColor, ), ) : null, @@ -104,9 +112,9 @@ class AppCustomChipWidget extends StatelessWidget { ) : Chip( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - label: richText ?? (labelText?? "").toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor, isCenter: true), + label: richText ?? (labelText?? "").toText10(weight: FontWeight.w500, letterSpacing: 0, color: resolvedTextColor, isCenter: true), padding: EdgeInsets.zero, - backgroundColor: backgroundColor, + backgroundColor: resolvedBackgroundColor, shape: shape ?? SmoothRectangleBorder( borderRadius: BorderRadius.circular(8.r), @@ -118,7 +126,7 @@ class AppCustomChipWidget extends StatelessWidget { ? InkWell( onTap: onDeleteTap, child: Utils.buildSvgWithAssets( - icon: deleteIcon!, width: iconS, height: iconS, iconColor: deleteIconHasColor ? deleteIconColor : null)) + icon: deleteIcon!, width: iconS, height: iconS, iconColor: deleteIconHasColor ? resolvedDeleteIconColor : null, applyThemeColor: applyThemeColor)) : null, onDeleted: deleteIcon?.isNotEmpty == true ? () {} : null, ), diff --git a/lib/widgets/chip/custom_selectable_chip.dart b/lib/widgets/chip/custom_selectable_chip.dart index be42bfd9..06ccb95f 100644 --- a/lib/widgets/chip/custom_selectable_chip.dart +++ b/lib/widgets/chip/custom_selectable_chip.dart @@ -9,7 +9,7 @@ class CustomSelectableChip extends StatelessWidget { final Color activeColor; final Color activeTextColor; final Color inactiveBorderColor; - final Color inactiveTextColor; + final Color? inactiveTextColor; const CustomSelectableChip({ super.key, @@ -19,11 +19,12 @@ class CustomSelectableChip extends StatelessWidget { this.activeColor = const Color(0xFFD03C32), // red accent this.activeTextColor = Colors.white, this.inactiveBorderColor = const Color(0xFFE8E8E8), - this.inactiveTextColor = const Color(0xFF222222), + this.inactiveTextColor, }); @override Widget build(BuildContext context) { + final resolvedInactiveTextColor = inactiveTextColor ?? AppColors.textColor; final double radius = 8.0; return AnimatedContainer( duration: const Duration(milliseconds: 180), @@ -44,7 +45,7 @@ class CustomSelectableChip extends StatelessWidget { style: TextStyle( fontSize: 12.f, fontWeight: FontWeight.w500, - color: selected ? activeTextColor : inactiveTextColor, + color: selected ? activeTextColor : resolvedInactiveTextColor, letterSpacing: -0.02 * 18, height: 1.0, ), diff --git a/lib/widgets/common_bottom_sheet.dart b/lib/widgets/common_bottom_sheet.dart index 515d1f72..5269a8dc 100644 --- a/lib/widgets/common_bottom_sheet.dart +++ b/lib/widgets/common_bottom_sheet.dart @@ -134,7 +134,7 @@ class ButtonSheetContent extends StatelessWidget { padding: EdgeInsets.symmetric( horizontal: 16, ), - child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32).onPress(() { + child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32, applyThemeColor: false).onPress(() { Navigator.of(context).pop(); }), ) @@ -169,9 +169,10 @@ void showCommonBottomSheetWithoutHeight( bool useSafeArea = false, bool hasBottomPadding = true, EdgeInsets? padding, - Color backgroundColor = AppColors.bottomSheetBgColor, + Color? backgroundColor, VoidCallback? onCloseClicked, }) { + final resolvedBgColor = backgroundColor ?? AppColors.bottomSheetBgColor; showModalBottomSheet( sheetAnimationStyle: AnimationStyle( duration: Duration(milliseconds: 500), @@ -184,7 +185,7 @@ void showCommonBottomSheetWithoutHeight( showDragHandle: false, isDismissible: isDismissible, enableDrag: isDismissible, - backgroundColor: backgroundColor, + backgroundColor: resolvedBgColor, useSafeArea: useSafeArea, builder: (BuildContext context) { return SafeArea( @@ -228,7 +229,7 @@ void showCommonBottomSheetWithoutHeight( if (isCloseButtonVisible) ...[ Utils.buildSvgWithAssets( icon: AppAssets.close_bottom_sheet_icon, - iconColor: Color(0xff2B353E), + iconColor: AppColors.textColor, ).onPress(() { onCloseClicked?.call(); Navigator.of(context).pop(); diff --git a/lib/widgets/countdown_timer.dart b/lib/widgets/countdown_timer.dart index 1722ebfa..7f8304e6 100644 --- a/lib/widgets/countdown_timer.dart +++ b/lib/widgets/countdown_timer.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; Widget buildTime(Duration duration, {bool isHomePage = false}) { String twoDigits(int n) => n.toString().padLeft(2, '0'); @@ -41,7 +42,7 @@ Widget buildDigit(String digit) { padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), // margin: const EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: BorderRadius.circular(8), ), child: ClipRect( diff --git a/lib/widgets/custom_tab_bar.dart b/lib/widgets/custom_tab_bar.dart index c30c0700..0fd354e0 100644 --- a/lib/widgets/custom_tab_bar.dart +++ b/lib/widgets/custom_tab_bar.dart @@ -16,20 +16,20 @@ class CustomTabBarModel { class CustomTabBar extends StatefulWidget { final int initialIndex; final List tabs; - final Color activeTextColor; - final Color activeBackgroundColor; - final Color inActiveTextColor; - final Color inActiveBackgroundColor; + final Color? activeTextColor; + final Color? activeBackgroundColor; + final Color? inActiveTextColor; + final Color? inActiveBackgroundColor; final Function(int)? onTabChange; const CustomTabBar({ super.key, required this.tabs, this.initialIndex = 0, - this.activeTextColor = const Color(0xff2E3039), - this.inActiveTextColor = const Color(0xff898A8D), - this.activeBackgroundColor = const Color(0x142E3039), - this.inActiveBackgroundColor = Colors.white, + this.activeTextColor, + this.inActiveTextColor, + this.activeBackgroundColor, + this.inActiveBackgroundColor, this.onTabChange, }); @@ -57,6 +57,10 @@ class CustomTabBarState extends State { @override Widget build(BuildContext context) { + final resolvedActiveTextColor = widget.activeTextColor ?? AppColors.textColor; + final resolvedInActiveTextColor = widget.inActiveTextColor ?? AppColors.inputLabelTextColor; + final resolvedActiveBgColor = widget.activeBackgroundColor ?? AppColors.lightGrayBGColor; + final resolvedInActiveBgColor = widget.inActiveBackgroundColor ?? AppColors.whiteColor; late Widget parentWidget; if (widget.tabs.length > 3) { @@ -65,7 +69,7 @@ class CustomTabBarState extends State { scrollDirection: Axis.horizontal, padding: EdgeInsets.zero, physics: const BouncingScrollPhysics(), - itemBuilder: (cxt, index) => myTab(widget.tabs[index], index), + itemBuilder: (cxt, index) => myTab(widget.tabs[index], index, resolvedActiveTextColor, resolvedInActiveTextColor, resolvedActiveBgColor, resolvedInActiveBgColor), separatorBuilder: (cxt, index) => 4.width, itemCount: widget.tabs.length, ); @@ -73,7 +77,7 @@ class CustomTabBarState extends State { parentWidget = Row( mainAxisAlignment: MainAxisAlignment.center, spacing: 4.w, - children: [for (int i = 0; i < widget.tabs.length; i++) myTab(widget.tabs[i], i).expanded], + children: [for (int i = 0; i < widget.tabs.length; i++) myTab(widget.tabs[i], i, resolvedActiveTextColor, resolvedInActiveTextColor, resolvedActiveBgColor, resolvedInActiveBgColor).expanded], ); } @@ -87,14 +91,14 @@ class CustomTabBarState extends State { child: Center(child: parentWidget)); } - Widget myTab(CustomTabBarModel tabBar, int currentIndex) { + Widget myTab(CustomTabBarModel tabBar, int currentIndex, Color activeTextColor, Color inActiveTextColor, Color activeBgColor, Color inActiveBgColor) { bool isSelected = selectedIndex == currentIndex; return Container( height: (isTablet || isFoldable) ? 60.h : 54.h, padding: EdgeInsets.only(top: 4.h, bottom: 4.h, left: 14.w, right: 14.w), alignment: Alignment.center, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: isSelected ? widget.activeBackgroundColor : widget.inActiveBackgroundColor, + color: isSelected ? activeBgColor : inActiveBgColor, borderRadius: 10.r, ), child: Row( @@ -106,11 +110,11 @@ class CustomTabBarState extends State { icon: tabBar.image!, height: 18.h, width: 18.w, - iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor, + iconColor: isSelected ? activeTextColor : inActiveTextColor, ), tabBar.title.toText13( weight: isSelected ? FontWeight.w600 : FontWeight.w500, - color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, + color: isSelected ? activeTextColor : inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1), ], )).onPress(() { diff --git a/lib/widgets/date_range_selector/date_range_calender.dart b/lib/widgets/date_range_selector/date_range_calender.dart index 89725f32..0f6c9b99 100644 --- a/lib/widgets/date_range_selector/date_range_calender.dart +++ b/lib/widgets/date_range_selector/date_range_calender.dart @@ -87,15 +87,15 @@ class _DateRangeSelectorState extends State { thickness: 1, ).paddingOnly(bottom: 16.h, top: 16.h), Material( - color: Colors.white, + color: AppColors.whiteColor, child: SfDateRangePicker( controller: _calendarController, selectionMode: DateRangePickerSelectionMode.range, showNavigationArrow: true, headerHeight: 40.h, - backgroundColor: Colors.white, + backgroundColor: AppColors.whiteColor, headerStyle: DateRangePickerHeaderStyle( - backgroundColor: Colors.white, + backgroundColor: AppColors.whiteColor, textAlign: TextAlign.start, textStyle: TextStyle( fontSize: 18.f, @@ -107,7 +107,7 @@ class _DateRangeSelectorState extends State { ), monthViewSettings: DateRangePickerMonthViewSettings( viewHeaderStyle: DateRangePickerViewHeaderStyle( - backgroundColor: Colors.white, + backgroundColor: AppColors.whiteColor, textStyle: TextStyle( fontSize: 14.f, fontWeight: FontWeight.w600, diff --git a/lib/widgets/datepicker_widget.dart b/lib/widgets/datepicker_widget.dart index 6ca9fe1f..1a5444a0 100644 --- a/lib/widgets/datepicker_widget.dart +++ b/lib/widgets/datepicker_widget.dart @@ -33,7 +33,7 @@ class DatePickerWidget extends StatelessWidget { padding: padding, alignment: Alignment.center, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: isAllowRadius ? 15 : null, side: isBorderAllowed ? BorderSide(color: const Color(0xffefefef), width: 1) : null, ), diff --git a/lib/widgets/dialogs/confirm_dialog.dart b/lib/widgets/dialogs/confirm_dialog.dart index ce597c2d..5f7782fa 100644 --- a/lib/widgets/dialogs/confirm_dialog.dart +++ b/lib/widgets/dialogs/confirm_dialog.dart @@ -20,7 +20,7 @@ class ConfirmDialog extends StatelessWidget { @override Widget build(BuildContext context) { return Dialog( - backgroundColor: Colors.white, + backgroundColor: AppColors.whiteColor, shape: const RoundedRectangleBorder(), insetPadding: const EdgeInsets.only(left: 21, right: 21), child: Padding( @@ -35,7 +35,7 @@ class ConfirmDialog extends StatelessWidget { Expanded( child: Text( title ?? LocaleKeys.confirm.tr(), - style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: AppColors.blackColor, height: 35 / 24, letterSpacing: -0.96), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: AppColors.blackColor, height: 35 / 24, letterSpacing: -0.96), ).paddingOnly(top: 16), ), IconButton( diff --git a/lib/widgets/dropdown/country_dropdown_widget.dart b/lib/widgets/dropdown/country_dropdown_widget.dart index 1cd387f9..bc4b5edf 100644 --- a/lib/widgets/dropdown/country_dropdown_widget.dart +++ b/lib/widgets/dropdown/country_dropdown_widget.dart @@ -73,7 +73,7 @@ class CustomCountryDropdownState extends State { }, child: Row( children: [ - Utils.buildSvgWithAssets(icon: selectedCountry != null ? selectedCountry!.iconPath : AppAssets.ksa, width: 40.h, height: 40.h), + Utils.buildSvgWithAssets(icon: selectedCountry != null ? selectedCountry!.iconPath : AppAssets.ksa, width: 40.h, height: 40.h, applyThemeColor: false), SizedBox(width: 8.h), Utils.buildSvgWithAssets(icon: _isDropdownOpen ? AppAssets.dropdow_icon : AppAssets.dropdow_icon), ], @@ -189,7 +189,7 @@ class CustomCountryDropdownState extends State { decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 16.h), child: Row( children: [ - Utils.buildSvgWithAssets(icon: country.iconPath, width: 38.h, height: 38.h), + Utils.buildSvgWithAssets(icon: country.iconPath, width: 38.h, height: 38.h, applyThemeColor: false), if (!widget.isFromBottomSheet) SizedBox(width: 12.h), if (!widget.isFromBottomSheet) Text(appState.getLanguageCode() == "ar" ? country.nameArabic : country.displayName, diff --git a/lib/widgets/dropdown/dropdown_widget.dart b/lib/widgets/dropdown/dropdown_widget.dart index 5ef5e580..a78b8fa5 100644 --- a/lib/widgets/dropdown/dropdown_widget.dart +++ b/lib/widgets/dropdown/dropdown_widget.dart @@ -55,8 +55,8 @@ class DropdownWidget extends StatelessWidget { padding: padding, alignment: Alignment.center, // This might need adjustment based on layout decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, - borderRadius: isAllowRadius ? 15.h : null, + color: AppColors.whiteColor, + borderRadius: isAllowRadius ? 15.h : null, side: isBorderAllowed ? BorderSide(color: hasError! ? Colors.red: const Color(0xffefefef), width: 1) : null, ), child: Row( @@ -92,7 +92,8 @@ class DropdownWidget extends StatelessWidget { margin: EdgeInsets.only(right: 10.h), padding: EdgeInsets.all(8.h), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(borderRadius: 10.h, color: AppColors.greyColor), - child: Utils.buildSvgWithAssets(icon: leadingIcon!)); + child: Utils.buildSvgWithAssets(icon: leadingIcon!), + ); } Widget _buildLabelText(Color? labelColor) { @@ -142,7 +143,7 @@ class DropdownWidget extends StatelessWidget { borderRadius: BorderRadius.circular(12), ), - color: AppColors.scaffoldBgColor + color: Colors.black ); if (selected != null && onChange != null) { @@ -163,7 +164,8 @@ class DropdownWidget extends StatelessWidget { fontSize: 14.f, height: 21 / 14, fontWeight: FontWeight.w500, - color: (selectedValue != null && selectedValue!.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0), + // color: (selectedValue != null && selectedValue!.isNotEmpty) ? const Color(0xff2E3039) : const Color(0xffB0B0B0), + color: AppColors.textColor, letterSpacing: -0.2, ), ), diff --git a/lib/widgets/expandable_list_widget.dart b/lib/widgets/expandable_list_widget.dart index db4e3980..d6d2efdf 100644 --- a/lib/widgets/expandable_list_widget.dart +++ b/lib/widgets/expandable_list_widget.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; // ==================== MAIN CUSTOM WIDGET ==================== @@ -251,12 +252,12 @@ class ExpandableListTheme { }); factory ExpandableListTheme.defaultTheme(BuildContext context) { - final textColor = Theme.of(context).textTheme.bodyLarge?.color ?? Colors.black; + final textColor = Theme.of(context).textTheme.bodyLarge?.color ?? AppColors.textColor; return ExpandableListTheme( backgroundColor: Colors.transparent, expandedBackgroundColor: Colors.transparent, - dividerColor: Colors.grey.shade300, + dividerColor: AppColors.dividerColor, defaultTrailingIcon: Icon( Icons.keyboard_arrow_down, color: textColor, @@ -278,10 +279,10 @@ class ExpandableListTheme { }) { return ExpandableListTheme( backgroundColor: backgroundColor ?? Colors.transparent, - expandedBackgroundColor: expandedBackgroundColor ?? Colors.grey.shade50, - dividerColor: dividerColor ?? Colors.grey.shade300, + expandedBackgroundColor: expandedBackgroundColor ?? AppColors.whiteColor, + dividerColor: dividerColor ?? AppColors.dividerColor, defaultTrailingIcon: defaultTrailingIcon ?? - Icon(Icons.keyboard_arrow_down, color: Colors.black, size: 24), + Icon(Icons.keyboard_arrow_down, color: AppColors.textColor, size: 24), itemPadding: itemPadding ?? EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h), contentPadding: contentPadding ?? EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h), leadingSpacing: leadingSpacing ?? 12.w, diff --git a/lib/widgets/family_files/family_file_add_widget.dart b/lib/widgets/family_files/family_file_add_widget.dart index 15751e93..d8b4d13e 100644 --- a/lib/widgets/family_files/family_file_add_widget.dart +++ b/lib/widgets/family_files/family_file_add_widget.dart @@ -39,7 +39,7 @@ class _FamilyFileAddWidgetState extends State { widget.message.toText16(color: AppColors.textColor, weight: FontWeight.w500), SizedBox(height: 20.h), Container( - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(24)), + decoration: BoxDecoration(color: AppColors.whiteColor, borderRadius: BorderRadius.circular(24)), padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h), child: Column( children: [ diff --git a/lib/widgets/graph/custom_graph.dart b/lib/widgets/graph/custom_graph.dart index f1145212..d9a69a99 100644 --- a/lib/widgets/graph/custom_graph.dart +++ b/lib/widgets/graph/custom_graph.dart @@ -51,12 +51,12 @@ class CustomGraph extends StatelessWidget { final double? maxY; final double? maxX; final double? minX; - final Color spotColor; - final Color graphColor; + final Color? spotColor; + final Color? graphColor; final Color? secondaryGraphColor; // Color for secondary line - final Color graphShadowColor; - final Color graphGridColor; - final Color bottomLabelColor; + final Color? graphShadowColor; + final Color? graphGridColor; + final Color? bottomLabelColor; final double? bottomLabelSize; final FontWeight? bottomLabelFontWeight; final double? leftLabelInterval; @@ -92,12 +92,12 @@ class CustomGraph extends StatelessWidget { this.maxX, this.showBottomTitleDates = true, this.isFullScreeGraph = false, - this.spotColor = AppColors.bgGreenColor, - this.graphColor = AppColors.bgGreenColor, + this.spotColor, + this.graphColor, this.secondaryGraphColor, - this.graphShadowColor = AppColors.graphGridColor, - this.graphGridColor = AppColors.graphGridColor, - this.bottomLabelColor = AppColors.textColor, + this.graphShadowColor, + this.graphGridColor, + this.bottomLabelColor, this.bottomLabelFontWeight = FontWeight.w500, this.bottomLabelSize, this.leftLabelInterval, @@ -117,8 +117,13 @@ class CustomGraph extends StatelessWidget { @override Widget build(BuildContext context) { + final resolvedSpotColor = spotColor ?? AppColors.bgGreenColor; + final resolvedGraphColor = graphColor ?? AppColors.bgGreenColor; + final resolvedGraphShadowColor = graphShadowColor ?? AppColors.graphGridColor; + final resolvedGraphGridColor = graphGridColor ?? AppColors.graphGridColor; + return Material( - color: Colors.white, + color: AppColors.whiteColor, child: SizedBox( width: width, height: height, @@ -138,7 +143,7 @@ class CustomGraph extends StatelessWidget { // Show custom marker for touched spot with correct color per line return indicators.map((int index) { // Determine which line is being touched based on barData - Color dotColor = spotColor; + Color dotColor = resolvedSpotColor; if (secondaryDataPoints != null && barData.spots.length > 0) { // Check if this is the secondary line by comparing the first spot's color final gradient = barData.gradient; @@ -218,7 +223,7 @@ class CustomGraph extends StatelessWidget { top: BorderSide.none, ), ), - lineBarsData: _buildColoredLineSegments(dataPoints, showLinePoints), + lineBarsData: _buildColoredLineSegments(dataPoints, showLinePoints, resolvedGraphColor, resolvedGraphShadowColor), gridData: FlGridData( show: showGridLines ?? true, drawVerticalLine: false, @@ -228,7 +233,7 @@ class CustomGraph extends StatelessWidget { getDrawingHorizontalLine: getDrawingHorizontalLine ?? (value) { return FlLine( - color: graphGridColor, + color: resolvedGraphGridColor, strokeWidth: 1, dashArray: [5, 5], ); @@ -240,7 +245,7 @@ class CustomGraph extends StatelessWidget { ); } - List _buildColoredLineSegments(List dataPoints, bool showLinePoints) { + List _buildColoredLineSegments(List dataPoints, bool showLinePoints, Color resolvedGraphColor, Color resolvedGraphShadowColor) { final List allSpots = dataPoints.asMap().entries.map((entry) { double value = (makeGraphBasedOnActualValue) ? double.tryParse(entry.value.actualValue) ?? 0.0 : entry.value.value; return FlSpot(entry.key.toDouble(), value); @@ -254,7 +259,7 @@ class CustomGraph extends StatelessWidget { isStrokeJoinRound: true, barWidth: 2, gradient: LinearGradient( - colors: [graphColor, graphColor], + colors: [resolvedGraphColor, resolvedGraphColor], begin: Alignment.centerLeft, end: Alignment.centerRight, ), @@ -265,7 +270,7 @@ class CustomGraph extends StatelessWidget { cutOffY: cutOffY ?? 0, gradient: LinearGradient( colors: [ - graphShadowColor, + resolvedGraphShadowColor, Colors.white, ], begin: Alignment.topCenter, diff --git a/lib/widgets/image_picker.dart b/lib/widgets/image_picker.dart index e25b1176..eb3021f5 100644 --- a/lib/widgets/image_picker.dart +++ b/lib/widgets/image_picker.dart @@ -182,12 +182,13 @@ class _BottomSheetItem extends StatelessWidget { final Function onTap; final IconData icon; final String title; - final Color color; + final Color? color; - _BottomSheetItem({Key? key, required this.onTap, required this.title, required this.icon, this.color = AppColors.mainPurple}) : super(key: key); + _BottomSheetItem({Key? key, required this.onTap, required this.title, required this.icon, this.color}) : super(key: key); @override Widget build(BuildContext context) { + final resolvedColor = color ?? AppColors.mainPurple; return InkWell( onTap: () { if (onTap != null) { @@ -202,7 +203,7 @@ class _BottomSheetItem extends StatelessWidget { if (icon != null) Icon( icon, - color: color, + color: resolvedColor, size: 18.0, ), if (icon != null) const SizedBox(width: 24.0), diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index aae196cf..25dd4580 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -133,7 +133,7 @@ class TextInputWidget extends StatelessWidget { // height: isMultiline ? null : 64.h, alignment: Alignment.center, decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: Colors.white, + color: AppColors.whiteColor, borderRadius: isAllowRadius ? (12.r) : null, side: isBorderAllowed ? BorderSide(color: hasError ? errorColor : const Color(0xffefefef), width: 1) : null, ), @@ -210,7 +210,7 @@ class TextInputWidget extends StatelessWidget { borderRadius: 12.r, color: AppColors.greyColor, ), - child: Utils.buildSvgWithAssets(icon: leadingIcon!)); + child: Utils.buildSvgWithAssets(icon: leadingIcon!, applyThemeColor: false)); } Widget _buildTrailingIcon(BuildContext context, {bool isArrowTrailing = false}) { diff --git a/lib/widgets/loader/bottomsheet_loader.dart b/lib/widgets/loader/bottomsheet_loader.dart index 71b83415..bff293d0 100644 --- a/lib/widgets/loader/bottomsheet_loader.dart +++ b/lib/widgets/loader/bottomsheet_loader.dart @@ -7,6 +7,7 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; class LoaderBottomSheet { static final NavigationService _navService = GetIt.I(); @@ -27,8 +28,8 @@ class LoaderBottomSheet { builder: (_) { return Container( height: MediaQuery.of(context).size.height * 0.3, - decoration: const BoxDecoration( - color: Colors.white, + decoration: BoxDecoration( + color: AppColors.whiteColor, borderRadius: BorderRadius.vertical(top: Radius.circular(16)), ), child: Center( diff --git a/lib/widgets/map/map_utility_screen.dart b/lib/widgets/map/map_utility_screen.dart index cb3eb8ef..422809cf 100644 --- a/lib/widgets/map/map_utility_screen.dart +++ b/lib/widgets/map/map_utility_screen.dart @@ -80,7 +80,7 @@ class MapUtilityScreen extends StatelessWidget { ), Align( alignment: AlignmentDirectional.topStart, - child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32.h, height: 32.h).onPress(() { + child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32.h, height: 32.h, applyThemeColor: false).onPress(() { onCrossClicked?.call(); // context // .read() diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index b76b36fc..10228a94 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -18,7 +18,7 @@ void showNfcReader(BuildContext context, {required Function onNcfScan, required shape: RoundedRectangleBorder( borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12)), ), - backgroundColor: Colors.white, + backgroundColor: AppColors.whiteColor, builder: (context) { return NfcLayout( onNcfScan: onNcfScan, From 040ff6a80d17bdfc59508dfb56b121f689eef524 Mon Sep 17 00:00:00 2001 From: Haroon Amjad <> Date: Fri, 6 Mar 2026 15:31:10 +0300 Subject: [PATCH 6/9] Dark mode persistence added in the app --- lib/core/dependencies.dart | 2 +- .../profile_settings_view_model.dart | 18 ++++++++++++++++++ lib/main.dart | 3 +++ .../home/data/landing_page_data.dart | 4 ++-- lib/presentation/home/landing_page.dart | 6 +++--- .../home/widgets/welcome_widget.dart | 2 +- .../smartwatches/widgets/health_chart.dart | 1 + lib/widgets/datepicker_widget.dart | 1 + lib/widgets/phone_number_input.dart | 2 +- 9 files changed, 31 insertions(+), 8 deletions(-) diff --git a/lib/core/dependencies.dart b/lib/core/dependencies.dart index e7ac0515..4266aa3b 100644 --- a/lib/core/dependencies.dart +++ b/lib/core/dependencies.dart @@ -224,7 +224,7 @@ class AppDependencies { authenticationRepo: getIt(), cacheService: getIt(), navigationService: getIt(), dialogService: getIt(), appState: getIt(), errorHandlerService: getIt(), localAuthService: getIt()), ); - getIt.registerLazySingleton(() => ProfileSettingsViewModel()); + getIt.registerLazySingleton(() => ProfileSettingsViewModel(cacheService: getIt())); getIt.registerLazySingleton(() => DateRangeSelectorRangeViewModel()); diff --git a/lib/features/profile_settings/profile_settings_view_model.dart b/lib/features/profile_settings/profile_settings_view_model.dart index 2f788c69..e001d1bd 100644 --- a/lib/features/profile_settings/profile_settings_view_model.dart +++ b/lib/features/profile_settings/profile_settings_view_model.dart @@ -1,14 +1,32 @@ import 'package:flutter/foundation.dart'; +import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; class ProfileSettingsViewModel extends ChangeNotifier { + static const String _darkModeKey = 'is_dark_mode'; + + final CacheService _cacheService; + bool _isDarkMode = false; bool get isDarkMode => _isDarkMode; + ProfileSettingsViewModel({required CacheService cacheService}) + : _cacheService = cacheService; + + /// Call once at app startup (before the first frame) to restore the + /// persisted dark-mode preference. + void loadDarkMode() { + final saved = _cacheService.getBool(key: _darkModeKey); + _isDarkMode = saved ?? false; + AppColors.isDarkMode = _isDarkMode; + // No notifyListeners() here — we are called before build. + } + void toggleDarkMode(bool value) { _isDarkMode = value; AppColors.isDarkMode = value; + _cacheService.saveBool(key: _darkModeKey, value: value); notifyListeners(); } diff --git a/lib/main.dart b/lib/main.dart index 023404a6..d38c9aab 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,6 +111,9 @@ Future callInitializations() async { SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); HttpOverrides.global = MyHttpOverrides(); await callAppStateInitializations(); + + // Restore persisted dark-mode preference before the first frame. + getIt.get().loadDarkMode(); } void main() async { diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart index 1fefb8ce..b74e57f3 100644 --- a/lib/presentation/home/data/landing_page_data.dart +++ b/lib/presentation/home/data/landing_page_data.dart @@ -13,8 +13,8 @@ class LandingPageData { title: LocaleKeys.emergency, subtitle: LocaleKeys.services2, backgroundColor: AppColors.primaryRedColor, - iconColor: AppColors.whiteColor, - textColor: AppColors.whiteColor, + iconColor: Colors.white, + textColor: Colors.white, isBold: true, ), ServiceCardData( diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index e8482bf0..607a47f7 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -296,9 +296,9 @@ class _LandingPageState extends State { context.navigateWithName(AppRoutes.userInfoSelection); }, padding: EdgeInsetsGeometry.zero, - backgroundColor: Color(0xFF2B353E), - borderColor: Color(0xFF2B353E), - textColor: AppColors.whiteColor, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + textColor: Colors.white, fontSize: 14.f, fontWeight: FontWeight.w600, borderRadius: 12.r, diff --git a/lib/presentation/home/widgets/welcome_widget.dart b/lib/presentation/home/widgets/welcome_widget.dart index 1bb17b5b..4ccc126a 100644 --- a/lib/presentation/home/widgets/welcome_widget.dart +++ b/lib/presentation/home/widgets/welcome_widget.dart @@ -40,7 +40,7 @@ class WelcomeWidget extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Flexible(child: name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1)), - const Icon(Icons.keyboard_arrow_down, size: 20, color: Colors.black), + Icon(Icons.keyboard_arrow_down, size: 20, color: AppColors.greyTextColor), ], ), ], diff --git a/lib/presentation/smartwatches/widgets/health_chart.dart b/lib/presentation/smartwatches/widgets/health_chart.dart index 37474133..e3c368ba 100644 --- a/lib/presentation/smartwatches/widgets/health_chart.dart +++ b/lib/presentation/smartwatches/widgets/health_chart.dart @@ -1,5 +1,6 @@ import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; class HealthChart extends StatelessWidget { final List spots; diff --git a/lib/widgets/datepicker_widget.dart b/lib/widgets/datepicker_widget.dart index 1a5444a0..e2891da4 100644 --- a/lib/widgets/datepicker_widget.dart +++ b/lib/widgets/datepicker_widget.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/theme/colors.dart'; class DatePickerWidget extends StatelessWidget { final String labelText; diff --git a/lib/widgets/phone_number_input.dart b/lib/widgets/phone_number_input.dart index 83ddcf16..793c8062 100644 --- a/lib/widgets/phone_number_input.dart +++ b/lib/widgets/phone_number_input.dart @@ -67,7 +67,7 @@ class _PhoneNumberInputState extends State { ) .toList(), onChanged: _onCountryCodeChanged, - icon: const Icon( + icon: Icon( Icons.keyboard_arrow_down_rounded, color: AppColors.mainPurple, ), From 8de803909605ca8550c24f77259405ccdda75fe3 Mon Sep 17 00:00:00 2001 From: Haroon Amjad <> Date: Sat, 7 Mar 2026 03:06:19 +0300 Subject: [PATCH 7/9] updates --- .../NewPatientAppKeyStore.jks | Bin 0 -> 2658 bytes android/app/src/main/AndroidManifest.xml | 8 +++++--- lib/core/api_consts.dart | 2 +- lib/core/utils/push_notification_handler.dart | 2 +- .../authentication_view_model.dart | 3 ++- .../models/patient_sickleave_response_model.dart | 2 +- .../home/widgets/large_service_card.dart | 1 + lib/services/dialog_service.dart | 5 +++-- lib/splashPage.dart | 1 + lib/widgets/buttons/custom_button.dart | 4 +++- pubspec.yaml | 2 +- 11 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 New Patient App android keystore/NewPatientAppKeyStore.jks diff --git a/New Patient App android keystore/NewPatientAppKeyStore.jks b/New Patient App android keystore/NewPatientAppKeyStore.jks new file mode 100644 index 0000000000000000000000000000000000000000..e50988ea1abefbad0bb17b540620f302d5d43851 GIT binary patch literal 2658 zcma);XE+;*8pjij7_}R#ghX4h8+#Mfp{S86fIlyD&9DLpB=~q zEGDrWf=Dd8ND|8ylEhf~UlLZwPvLi7_ zwSPu7q%;W9DL!JaVa>V@+{Jd|O>0wXocb0S7!X_xKp2t@%>3_*3@nTQBoxeojW-73 z&wzkZAg(Uks*mc?mVd=p>6DvS9ZZ2pprNA8zN3N-DCg?JPQJotyQe43{bG~eJ%;!w zI~6X$WTSJJ0vlbdWW~)ZCxsfII`0GhB8wJu40gzU^uK7w(UdX&-H{9HYV(m<4d=Z& zqEd+(CwY}CJKE22KUz2SQ2FM*QjYf}d}JASDEvh;!r>;`-0SYbnA)zTZq4Ngm)Yyh z0}cbKGNNI9bEgYJH`N+Drf>-xu}wL(3(2ON^AEF+X##G(Nn_7P%2ferkKWjpIYn&8 za&}=nSggGpxH3muQT1~ED?#t-4U@iW(*tKcVv~n=2V>H(o%_abE{H|J?bfHXQ#y-` zeIJhp&O7#SnK=mEnslKv;0Ah$I^SbynP7YrR4PY`oRRnC#wATOUs)00-ALz+13M#1t=?Z^v1|=4>`E4D&XWSBqr-#f#Jx9zS=h2G%@i~_Jj_H4%iGIkh}?a4SxT0LO*pC=opto8MvXyFZ=p0P_)+o}o7g@<4KUSwuc@~gRi5N=JExGi2 z{1cxUw&{auEw!sCQ-eEq=eU*MN4b@?ZMDqYma*LO-sOB%@cE-|xlsg0p}M}>Wx`}V zoA?o5^~4`eh$Mtf6pFqhDE4wnlY0{T+qG_FvSS=e1iJKjLetxEBOSs1q(wv9xef`U z7-^P&5-*KyXi>Zy?bQyMa!t}&j{Ch}(D)Kc?DlC%K*wcs{DYX04buQuO9BPqu(rdJ$>{U@+zKg1k&sG@u)E{Vex6Y5Zl-w*m%upsm?o8Mw`?gT`bKj} zw|&rZb8e5u!Iz;fnP!$Yvx+Z>(JD04*D~H~Ho8~dQAFkPkXZq!y_y!&_kh3dQjDiJ1^N6>Zo^3Uyym|hp&|fMlw`H0xd!3riVY5AE zW=!G750UO5`tq+DCSANChGws`V4by*dO*oq%mXL~7&x^-A?PrrqdGaGSi*HoWqzjE z8J#qV+if^DN2#tI;kpau-U~sCkXwiyfiY-^a?txKx}@Sdi%l>Fc%1wRu@My3f@NsG z!(V~UXRZ4X^XP@l5JMy|>h%)?-X?h4NP2D|ogIYmMlJNZH!_}9mnfjsLQ#hC5*1YS zmGV?6O=qXc9AaHz0;>eW>FUcuuv>Mas=?A;juY4CD*O+*sn@uWf-M4}+7Ab=F9;T< zT|<QW=ggr*Mfq-CR_wGmmX zgu_F^GHC0$V?&P!6c%uERd7e$cV3fHXL7O+v^$?2n(*?KYsM)nn^@ZbHEdi=58NHt zdT~sPDzfV9@V!e!td(HCV{EzpJz#wF-HxpYH97>CrpDJ|pofC8i*(_f)s#n6xi0%! zM~_pVIWc+4oRs+BXGHFWV^F!;ey+((Be`!wM_MUUAg>lqHMn(_+&p9cXdW5Dd<*V4 zOK~`j!>qm_R}f-aU$KOY?M8Y?VLLpkRDyN!yqQbr#nk4&;I5ajF0Ot zK`(B)k#+irFZ2T_+8%{TlRQ_h;%@Ra0>rJXm)$WXlWY>@V4dH9@am62b_?2l)7_`} zvn0^mwS-TL==}-1xmr!?@N=t)?|HDHX6%onp8FbET^Z9A6Ah6uUKTEe`UydP4bFo} zH`j#dydwri;xabq-O04k$mECsK@0GSs?XLan>Akd*$T=!w`QJkr?#-F$F<68NcD5H z{tVU89#XJ(dNXbM#Fj-VRFK{5%RQP6!cV>RsRCqKdc&?X-08I6V$c|7cyT5>F^u(3 zmJa*+q}TPMI$`Vbi_1gN81L*+zar_GX2HkRh$%*0+Vv{ z5_Km&zXi?x)qu)r>ta7&eEi$|FdQSyT{9joAEa}UYiNylzniJRE7+Ab|KZy?A8?&| zzV%wljU`y~9~a!Lv&`Gf&=yePK=)F|_+vWc&^6@XeI~ literal 0 HcmV?d00001 diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 7267f0ac..0e77b6b6 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -49,7 +49,7 @@ - + @@ -62,7 +62,6 @@ - + = 33) { - // await FlutterCallkitIncoming.requestFullIntentPermission(); + await FlutterCallkitIncoming.requestFullIntentPermission(); } } } diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index fe025f93..6fc36191 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -1033,7 +1033,8 @@ class AuthenticationViewModel extends ChangeNotifier { label: LocaleKeys.notice.tr(), onOkPressed: () { _dialogService.showPhoneNumberPickerSheet( - label: "Where would you like to receive OTP?", + // label: "Where would you like to receive OTP?", + label: LocaleKeys.receiveOtpToast.tr(), message: "Please select from the below options to receive OTP.", onSMSPress: () { checkUserAuthentication(otpTypeEnum: OTPTypeEnum.sms); diff --git a/lib/features/medical_file/models/patient_sickleave_response_model.dart b/lib/features/medical_file/models/patient_sickleave_response_model.dart index 53c886f6..601bb598 100644 --- a/lib/features/medical_file/models/patient_sickleave_response_model.dart +++ b/lib/features/medical_file/models/patient_sickleave_response_model.dart @@ -122,7 +122,7 @@ class PatientSickLeavesResponseModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); startDate = json['StartDate']; status = json['Status']; strRequestDate = json['StrRequestDate']; diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index e65eb1d8..7c86dd09 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -82,6 +82,7 @@ class LargeServiceCard extends StatelessWidget { icon: serviceCardData.icon, iconColor: serviceCardData.iconColor, fit: BoxFit.contain, + applyThemeColor: false, ), ), ), diff --git a/lib/services/dialog_service.dart b/lib/services/dialog_service.dart index 6347a389..c4dfb7c4 100644 --- a/lib/services/dialog_service.dart +++ b/lib/services/dialog_service.dart @@ -306,7 +306,7 @@ Widget showPhoneNumberPickerWidget({required BuildContext context, String? messa onPressed: onSMSPress, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedBorderColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, icon: AppAssets.message, ), ), @@ -325,11 +325,12 @@ Widget showPhoneNumberPickerWidget({required BuildContext context, String? messa child: CustomButton( text: LocaleKeys.sendOTPWHATSAPP.tr(context: context), onPressed: onWhatsappPress, - backgroundColor: Colors.white, + backgroundColor: AppColors.whiteColor, borderColor: AppColors.borderOnlyColor, textColor: AppColors.textColor, icon: AppAssets.whatsapp, iconColor: null, + applyThemeColor: false, ), ), ], diff --git a/lib/splashPage.dart b/lib/splashPage.dart index dc7a7c98..64518f30 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -101,6 +101,7 @@ class _SplashScreenState extends State { print('Call Canceled : ------->'); try { + FlutterCallkitIncoming.unsilenceEvents(); FlutterCallkitIncoming.onEvent.listen((event) async { switch (event!.event) { case Event.actionCallIncoming: diff --git a/lib/widgets/buttons/custom_button.dart b/lib/widgets/buttons/custom_button.dart index 8500ce8e..de3b598a 100644 --- a/lib/widgets/buttons/custom_button.dart +++ b/lib/widgets/buttons/custom_button.dart @@ -25,6 +25,7 @@ class CustomButton extends StatelessWidget { final double? iconSize; final TextOverflow? textOverflow; final BorderSide? borderSide; + final bool applyThemeColor; const CustomButton({ super.key, @@ -47,6 +48,7 @@ class CustomButton extends StatelessWidget { this.iconSize, this.textOverflow, this.borderSide, + this.applyThemeColor = true, }); @override @@ -76,7 +78,7 @@ class CustomButton extends StatelessWidget { if (icon != null) Padding( padding: text.isNotEmpty ? EdgeInsets.only(right: 4.w, left: 4.w) : EdgeInsets.zero, - child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconS, height: iconS), + child: Utils.buildSvgWithAssets(icon: icon!, iconColor: iconColor, isDisabled: isDisabled, width: iconS, height: iconS, applyThemeColor: applyThemeColor), ), if (text.isNotEmpty) Text( diff --git a/pubspec.yaml b/pubspec.yaml index c4b1e51a..43969000 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: hmg_patient_app_new description: "New HMG Patient App" publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 0.0.1+4 +version: 0.0.11+8 environment: sdk: ">=3.6.0 <4.0.0" From fdeeed10d686bbb040cdf357862aed1bb876e978 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 8 Mar 2026 15:09:19 +0300 Subject: [PATCH 8/9] updates --- .../book_appointments_view_model.dart | 3 + .../region_list_widget.dart | 60 ++++++++++++++++--- .../book_appointment/widgets/doctor_card.dart | 55 ++++++++++++++--- 3 files changed, 104 insertions(+), 14 deletions(-) diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 3132dc8c..4dd103b8 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -692,6 +692,9 @@ class BookAppointmentsViewModel extends ChangeNotifier { result.fold( (failure) async { print(failure); + if (onError != null) { + onError(failure.message); + } }, (apiResponse) { if (apiResponse.messageStatus == 2) { diff --git a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart index fad96965..489ee8b7 100644 --- a/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart +++ b/lib/presentation/appointments/widgets/region_bottomsheet/region_list_widget.dart @@ -1,14 +1,21 @@ import 'dart:async'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart' show Utils; +import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/book_appointments/book_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/appointment_via_region_viewmodel.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/appointments/widgets/region_bottomsheet/region_list_item.dart' show RegionListItem; import 'package:hmg_patient_app_new/theme/colors.dart'; +import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; +import 'package:lottie/lottie.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../../../../widgets/common_bottom_sheet.dart'; @@ -31,13 +38,52 @@ class _RegionBottomSheetBodyState extends State { } else if (regionalViewModel.regionBottomSheetType == RegionBottomSheetType.FOR_CLINIIC) { myAppointmentsViewModel.getMappedDoctors(onError: (err) { Navigator.pop(context); - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: err), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); + if (myAppointmentsViewModel.selectedClinic.clinicID == 23) { + showCommonBottomSheetWithoutHeight( + context, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), + SizedBox(height: 8.h), + ("For booking appointments in the Physiotherapy clinic, please contact: 920066666").toText16(color: AppColors.blackColor), + SizedBox(height: 16.h), + CustomButton( + height: 40.h, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + text: LocaleKeys.callNow.tr(), + textColor: AppColors.whiteColor, + iconColor: AppColors.whiteColor, + onPressed: () { + launchUrl( + Uri.parse("tel://920066666"), + ); + }, + icon: AppAssets.call), + ], + ).center, + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } else { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } + // showCommonBottomSheetWithoutHeight( + // context, + // child: Utils.getErrorWidget(loadingText: err), + // callBackFunc: () {}, + // isFullScreen: false, + // isCloseButtonVisible: true, + // ); }); } }); diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index 9e3c69d1..6eecf5f8 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -15,6 +15,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; +import 'package:lottie/lottie.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorCard extends StatelessWidget { const DoctorCard({ @@ -198,13 +200,52 @@ class DoctorCard extends StatelessWidget { }, onError: (err) { LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - context, - child: Utils.getErrorWidget(loadingText: err), - callBackFunc: () {}, - isFullScreen: false, - isCloseButtonVisible: true, - ); + if (bookAppointmentsViewModel.selectedClinic.clinicID == 23) { + showCommonBottomSheetWithoutHeight( + context, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill), + SizedBox(height: 8.h), + ("For booking appointments in the Physiotherapy clinic, please contact: 920066666").toText16(color: AppColors.blackColor), + SizedBox(height: 16.h), + CustomButton( + height: 40.h, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + text: LocaleKeys.callNow.tr(), + textColor: AppColors.whiteColor, + iconColor: AppColors.whiteColor, + onPressed: () { + launchUrl( + Uri.parse("tel://920066666"), + ); + }, + icon: AppAssets.call), + ], + ).center, + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } else { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } + // showCommonBottomSheetWithoutHeight( + // context, + // child: Utils.getErrorWidget(loadingText: err), + // callBackFunc: () {}, + // isFullScreen: false, + // isCloseButtonVisible: true, + // ); }); }, backgroundColor: Color(0xffFEE9EA), From 6e71aa7f13a516054ba399a6ee6b8e0e63fe2a7c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 9 Mar 2026 12:39:05 +0300 Subject: [PATCH 9/9] updates & fixes --- lib/core/api/api_client.dart | 2 +- lib/features/lab/lab_view_model.dart | 5 ++++- .../widgets/ask_doctor_request_type_select.dart | 1 + .../widgets/ask_doctor_appointment_card.dart | 13 ++++++++++++- lib/presentation/authentication/login.dart | 6 ++++-- lib/widgets/bottomsheet/exception_bottom_sheet.dart | 2 +- 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 106b8fd4..b17db626 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -195,7 +195,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 4772997; + // body['PatientID'] = 4773715; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/features/lab/lab_view_model.dart b/lib/features/lab/lab_view_model.dart index cd062b9e..07cbbde3 100644 --- a/lib/features/lab/lab_view_model.dart +++ b/lib/features/lab/lab_view_model.dart @@ -527,7 +527,10 @@ class LabViewModel extends ChangeNotifier { rangeEnd = 100.0; break; default: - throw ArgumentError('Invalid flag: $flag'); + rangeStart = 40.0; + rangeEnd = 59.0; + break; + // throw ArgumentError('Invalid flag: $flag'); } // Clamp input value to 0-100 and map it to the range bounds diff --git a/lib/presentation/appointments/widgets/ask_doctor_request_type_select.dart b/lib/presentation/appointments/widgets/ask_doctor_request_type_select.dart index 376c27a9..3002c1c9 100644 --- a/lib/presentation/appointments/widgets/ask_doctor_request_type_select.dart +++ b/lib/presentation/appointments/widgets/ask_doctor_request_type_select.dart @@ -5,6 +5,7 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/features/ask_doctor/models/ask_doctor_appointments_list.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ask_doctor_request_type_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; diff --git a/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart b/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart index e4185e72..d58b75e9 100644 --- a/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart +++ b/lib/presentation/ask_doctor/widgets/ask_doctor_appointment_card.dart @@ -171,7 +171,18 @@ class AskDoctorAppointmentCard extends StatelessWidget { child: AskDoctorRequestTypeSelect( askDoctorRequestTypeList: myAppointmentsViewModel.askDoctorRequestTypeList, myAppointmentsViewModel: myAppointmentsViewModel, - patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel() + patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel( + appointmentNo: askDoctorAppointmentHistoryList.appointmentNo, + doctorID: askDoctorAppointmentHistoryList.doctorID!, + doctorName: askDoctorAppointmentHistoryList.doctorName!, + doctorTitle: askDoctorAppointmentHistoryList.doctorTitle!, + doctorImageURL: askDoctorAppointmentHistoryList.doctorImageURL!, + clinicID: askDoctorAppointmentHistoryList.clinicID!, + clinicName: askDoctorAppointmentHistoryList.clinicName!, + projectID: askDoctorAppointmentHistoryList.projectID!, + projectName: askDoctorAppointmentHistoryList.projectName!, + appointmentDate: askDoctorAppointmentHistoryList.appointmentDate!, + ), // myAppointmentsVM.patientAppointmentsHistoryList[index], ), callBackFunc: () {}, diff --git a/lib/presentation/authentication/login.dart b/lib/presentation/authentication/login.dart index 9f64bde4..28b47304 100644 --- a/lib/presentation/authentication/login.dart +++ b/lib/presentation/authentication/login.dart @@ -188,7 +188,8 @@ class LoginScreenState extends State { }, backgroundColor: AppColors.primaryRedColor, borderColor: AppColors.primaryRedBorderColor, - textColor: AppColors.whiteColor, + textColor: Colors.white, + iconColor: Colors.white, icon: AppAssets.message, ), ), @@ -219,9 +220,10 @@ class LoginScreenState extends State { }, backgroundColor: Colors.white, borderColor: AppColors.borderOnlyColor, - textColor: AppColors.textColor, + textColor: AppColors.whiteColor, icon: AppAssets.whatsapp, iconColor: null, + applyThemeColor: false, ), ), ], diff --git a/lib/widgets/bottomsheet/exception_bottom_sheet.dart b/lib/widgets/bottomsheet/exception_bottom_sheet.dart index 16531bdb..ea5f8d83 100644 --- a/lib/widgets/bottomsheet/exception_bottom_sheet.dart +++ b/lib/widgets/bottomsheet/exception_bottom_sheet.dart @@ -47,7 +47,7 @@ class _ExceptionBottomSheetState extends State { child: Container( padding: EdgeInsets.all(24.h), decoration: BoxDecoration( - color: Color(0xFFF8F8FA), + color: AppColors.whiteColor, borderRadius: const BorderRadius.vertical(top: Radius.circular(16)), ), child: Column(