diff --git a/lib/presentation/book_appointment/select_clinic_page.dart b/lib/presentation/book_appointment/select_clinic_page.dart index 1cbe0e58..131b4d3d 100644 --- a/lib/presentation/book_appointment/select_clinic_page.dart +++ b/lib/presentation/book_appointment/select_clinic_page.dart @@ -62,7 +62,8 @@ class _SelectClinicPageState extends State { scheduleMicrotask(() { bookAppointmentsViewModel.getClinics(); }); - name = (widget.calculatorType!.name.toLowerCase() =="bmi"? widget.calculatorType!.name.toUpperCase(): widget.calculatorType!.name.toCamelCase)??""; + + name = (widget.calculatorType?.name.toLowerCase() =="bmi"? widget.calculatorType?.name.toUpperCase(): widget.calculatorType?.name.toCamelCase)??""; super.initState(); } diff --git a/lib/presentation/hmg_services/widgets/weather_widget.dart b/lib/presentation/hmg_services/widgets/weather_widget.dart index 4c353763..6c055e76 100644 --- a/lib/presentation/hmg_services/widgets/weather_widget.dart +++ b/lib/presentation/hmg_services/widgets/weather_widget.dart @@ -32,7 +32,7 @@ class WeatherWidget extends StatelessWidget { } String _formatDateTime(DateTime dateTime) { - final formatter = DateFormat('MMMM dd, yyyy - EEEE, HH:mm'); + final formatter = DateFormat('MMMM dd, yyyy - EEEE, HH:mm', 'en_US'); return formatter.format(dateTime); } diff --git a/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart b/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart index 3a287a44..b1d7b331 100644 --- a/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart +++ b/lib/presentation/prescriptions/prescription_delivery_order_summary_page.dart @@ -7,11 +7,13 @@ 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/prescriptions/prescriptions_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; +import 'package:hmg_patient_app_new/presentation/prescriptions/prescription_delivery_orders_list_page.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.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:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; class PrescriptionDeliveryOrderSummaryPage extends StatelessWidget { @@ -130,6 +132,12 @@ class PrescriptionDeliveryOrderSummaryPage extends StatelessWidget { child: Utils.getSuccessWidget(loadingText: LocaleKeys.requestSubmittedSuccessfully.tr(context: context)), callBackFunc: () { Navigator.of(context).pop(); + prescriptionsViewModel.getPrescriptionOrdersList(); + Navigator.of(context).push( + CustomPageRoute( + page: PrescriptionDeliveryOrdersListPage(), + ), + ); }, title: "", isCloseButtonVisible: true, diff --git a/lib/presentation/weather/weather_details_page.dart b/lib/presentation/weather/weather_details_page.dart index 0057f9b6..6943b3ee 100644 --- a/lib/presentation/weather/weather_details_page.dart +++ b/lib/presentation/weather/weather_details_page.dart @@ -42,6 +42,58 @@ class WeatherDetailsPage extends StatelessWidget { } } + /// Get color based on category label + Color _getColorFromCategory(String? categoryLabel) { + if (categoryLabel == null) return AppColors.successColor; + + final category = categoryLabel.toLowerCase().trim(); + + // Green: Low, Beneficial + if (category.contains('low') || category.contains('beneficial')) { + return AppColors.successColor; + } + // Yellow: Fair + else if (category.contains('fair')) { + return AppColors.warningColorYellow; + } + // Red: Very High, At High Risk + else if (category.contains('very high') || category.contains('at high risk')) { + return AppColors.errorColor; + } + // Orange: Risk, High (but not "very high" or "at high risk") + else if (category.contains('risk') || category.contains('high')) { + return AppColors.warningColor; + } + + return AppColors.successColor; // Default to green + } + + /// Get background color based on category label + Color _getBackgroundFromCategory(String? categoryLabel) { + if (categoryLabel == null) return AppColors.successLightColor.withValues(alpha: 0.1); + + final category = categoryLabel.toLowerCase().trim(); + + // Green: Low, Beneficial + if (category.contains('low') || category.contains('beneficial')) { + return AppColors.successLightColor.withValues(alpha: 0.1); + } + // Yellow: Fair + else if (category.contains('fair')) { + return AppColors.warningColorYellow.withValues(alpha: 0.1); + } + // Red: Very High, At High Risk + else if (category.contains('very high') || category.contains('at high risk')) { + return AppColors.errorLightColor.withValues(alpha: 0.1); + } + // Orange: Risk, High (but not "very high" or "at high risk") + else if (category.contains('risk') || category.contains('high')) { + return AppColors.warningLightColor.withValues(alpha: 0.1); + } + + return AppColors.successLightColor.withValues(alpha: 0.1); // Default to green + } + IconData _getIconFromCategory(String? category) { if (category == null) return Icons.wb_sunny_outlined; @@ -84,8 +136,8 @@ class WeatherDetailsPage extends StatelessWidget { return _buildCategoryCard( description: cityInfo.name ?? '', categoryLabel: cityInfo.category ?? '', - color: _getColorFromColorName(cityInfo.colorName), - backgroundColor: _getBackgroundColorFromColorName(cityInfo.colorName), + color: _getColorFromCategory(cityInfo.category), + backgroundColor: _getBackgroundFromCategory(cityInfo.category), icon: _getIconFromCategory(cityInfo.category), ); }), @@ -173,7 +225,7 @@ class WeatherDetailsPage extends StatelessWidget { ), child: categoryLabel.toText12( color: color, - fontWeight: FontWeight.w600, + isBold: true, maxLine: 1 ), ),