fixes and updates

pull/267/head
Sultan khan 7 hours ago
parent b18ddd1ad7
commit 1366518ce1

@ -234,14 +234,18 @@ final category5Values = EnumValues({
enum ColorName {
GREEN,
LIGHTGREEN,
ORANGE,
RED
RED,
YELLOW
}
final colorNameValues = EnumValues({
"green": ColorName.GREEN,
"lightgreen": ColorName.LIGHTGREEN,
"orange": ColorName.ORANGE,
"red": ColorName.RED
"red": ColorName.RED,
"yellow": ColorName.YELLOW
});
class EnumValues<T> {

@ -1767,6 +1767,10 @@ abstract class LocaleKeys {
static const locationServicesDisabled = 'locationServicesDisabled';
static const selectDateTimeKey = 'selectDateTimeKey';
static const medicalKey = 'medicalKey';
static const doctors2 = 'doctors2';
static const illurgyInfomation = 'illurgyInfomation';
static const vaccineInfomation = 'vaccineInfomation';
static const approvals1 = 'approvals1';
static const convertBloodcholesterolInfo = 'convertBloodcholesterolInfo';
static const carbsAlert = 'carbsAlert';
static const bodyFatAlert = 'bodyFatAlert';

@ -163,7 +163,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
CustomButton(
text: LocaleKeys.startLiveChat.tr(),
onPressed: () async {
launchUrl(Uri.parse("tel://" + "011 525 9553"));
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
@ -171,6 +171,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State<ImmediateLiveCareP
textColor: AppColors.whiteColor,
fontSize: 16,
isBold: true,
isDisabled: !Utils.havePrivilege(118),
borderRadius: 12,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,

@ -1149,7 +1149,7 @@ class _LandingPageState extends State<LandingPage> {
SizedBox(height: 10.h),
SizedBox(height: 8.h),
_buildLiveCareQueueInfo(liveCareData.patCount),
SizedBox(height: 25.h),
SizedBox(height: 14.h),
],
),
CustomButton(
@ -1169,6 +1169,7 @@ class _LandingPageState extends State<LandingPage> {
height: 40.h,
iconColor: AppColors.whiteColor,
iconSize: 18.h,
),
// _buildLiveCareWaitingTime(),
],

@ -1,8 +1,6 @@
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/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/weather/models/waether_cities_model.dart';
@ -21,7 +19,10 @@ class WeatherDetailsPage extends StatelessWidget {
switch (colorName) {
case ColorName.GREEN:
case ColorName.LIGHTGREEN:
return AppColors.successColor;
case ColorName.YELLOW:
return AppColors.warningColorYellow;
case ColorName.ORANGE:
return AppColors.warningColor;
case ColorName.RED:
@ -34,7 +35,10 @@ class WeatherDetailsPage extends StatelessWidget {
switch (colorName) {
case ColorName.GREEN:
case ColorName.LIGHTGREEN:
return AppColors.successLightColor.withValues(alpha: 0.1);
case ColorName.YELLOW:
return AppColors.warningColorYellow.withValues(alpha: 0.1);
case ColorName.ORANGE:
return AppColors.warningLightColor.withValues(alpha: 0.1);
case ColorName.RED:
@ -42,8 +46,14 @@ class WeatherDetailsPage extends StatelessWidget {
}
}
/// Get color based on category label
Color _getColorFromCategory(String? categoryLabel) {
/// Get color based on colorName from API (language-independent)
Color _getColorFromColorNameOrCategory(ColorName? colorName, String? categoryLabel) {
// First priority: Use the colorName from API if available
if (colorName != null) {
return _getColorFromColorName(colorName);
}
// Fallback: Try to parse category label (for English)
if (categoryLabel == null) return AppColors.successColor;
final category = categoryLabel.toLowerCase().trim();
@ -68,8 +78,14 @@ class WeatherDetailsPage extends StatelessWidget {
return AppColors.successColor; // Default to green
}
/// Get background color based on category label
Color _getBackgroundFromCategory(String? categoryLabel) {
/// Get background color based on colorName from API (language-independent)
Color _getBackgroundFromColorNameOrCategory(ColorName? colorName, String? categoryLabel) {
// First priority: Use the colorName from API if available
if (colorName != null) {
return _getBackgroundColorFromColorName(colorName);
}
// Fallback: Try to parse category label (for English)
if (categoryLabel == null) return AppColors.successLightColor.withValues(alpha: 0.1);
final category = categoryLabel.toLowerCase().trim();
@ -136,8 +152,9 @@ class WeatherDetailsPage extends StatelessWidget {
return _buildCategoryCard(
description: cityInfo.name ?? '',
categoryLabel: cityInfo.category ?? '',
color: _getColorFromCategory(cityInfo.category),
backgroundColor: _getBackgroundFromCategory(cityInfo.category),
colorName: cityInfo.colorName,
color: _getColorFromColorNameOrCategory(cityInfo.colorName, cityInfo.category),
backgroundColor: _getBackgroundFromColorNameOrCategory(cityInfo.colorName, cityInfo.category),
icon: _getIconFromCategory(cityInfo.category),
);
}),
@ -154,6 +171,7 @@ class WeatherDetailsPage extends StatelessWidget {
Widget _buildCategoryCard({
required String description,
required String categoryLabel,
required ColorName? colorName,
required Color color,
required Color backgroundColor,
required IconData icon,

Loading…
Cancel
Save