diff --git a/assets/new_design_icons/weather_icons/cloudy_left_icon.svg b/assets/new_design_icons/weather_icons/cloudy_left_icon.svg new file mode 100644 index 0000000..786df06 --- /dev/null +++ b/assets/new_design_icons/weather_icons/cloudy_left_icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/new_design_icons/weather_icons/cloudy_right_icon.svg b/assets/new_design_icons/weather_icons/cloudy_right_icon.svg new file mode 100644 index 0000000..62af7da --- /dev/null +++ b/assets/new_design_icons/weather_icons/cloudy_right_icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/new_design_icons/weather_icons/cold_left_icon.svg b/assets/new_design_icons/weather_icons/cold_left_icon.svg new file mode 100644 index 0000000..b7ea0a9 --- /dev/null +++ b/assets/new_design_icons/weather_icons/cold_left_icon.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/cold_right_icon.svg b/assets/new_design_icons/weather_icons/cold_right_icon.svg new file mode 100644 index 0000000..afaeb07 --- /dev/null +++ b/assets/new_design_icons/weather_icons/cold_right_icon.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/hot_left_icon.svg b/assets/new_design_icons/weather_icons/hot_left_icon.svg new file mode 100644 index 0000000..1a932c4 --- /dev/null +++ b/assets/new_design_icons/weather_icons/hot_left_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/hot_right_icon.svg b/assets/new_design_icons/weather_icons/hot_right_icon.svg new file mode 100644 index 0000000..a34bb63 --- /dev/null +++ b/assets/new_design_icons/weather_icons/hot_right_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/mostly_sunny_left_icon.svg b/assets/new_design_icons/weather_icons/mostly_sunny_left_icon.svg new file mode 100644 index 0000000..72016ca --- /dev/null +++ b/assets/new_design_icons/weather_icons/mostly_sunny_left_icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/new_design_icons/weather_icons/mostly_sunny_right_icon.svg b/assets/new_design_icons/weather_icons/mostly_sunny_right_icon.svg new file mode 100644 index 0000000..0025601 --- /dev/null +++ b/assets/new_design_icons/weather_icons/mostly_sunny_right_icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/new_design_icons/weather_icons/rainy_left_icon.svg b/assets/new_design_icons/weather_icons/rainy_left_icon.svg new file mode 100644 index 0000000..e04504d --- /dev/null +++ b/assets/new_design_icons/weather_icons/rainy_left_icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/rainy_right_icon.svg b/assets/new_design_icons/weather_icons/rainy_right_icon.svg new file mode 100644 index 0000000..8336a5a --- /dev/null +++ b/assets/new_design_icons/weather_icons/rainy_right_icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/sunny_left_icon.svg b/assets/new_design_icons/weather_icons/sunny_left_icon.svg new file mode 100644 index 0000000..d436205 --- /dev/null +++ b/assets/new_design_icons/weather_icons/sunny_left_icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/sunny_right_icon.svg b/assets/new_design_icons/weather_icons/sunny_right_icon.svg new file mode 100644 index 0000000..208f390 --- /dev/null +++ b/assets/new_design_icons/weather_icons/sunny_right_icon.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/windy_left_icon.svg b/assets/new_design_icons/weather_icons/windy_left_icon.svg new file mode 100644 index 0000000..cdb9a8c --- /dev/null +++ b/assets/new_design_icons/weather_icons/windy_left_icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/new_design_icons/weather_icons/windy_right_icon.svg b/assets/new_design_icons/weather_icons/windy_right_icon.svg new file mode 100644 index 0000000..0e6396b --- /dev/null +++ b/assets/new_design_icons/weather_icons/windy_right_icon.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/lib/constants/app_constants.dart b/lib/constants/app_constants.dart index 3b03a28..d2db732 100644 --- a/lib/constants/app_constants.dart +++ b/lib/constants/app_constants.dart @@ -129,12 +129,19 @@ class AppAssets { static String mosqueIcon = "assets/icons/mosque.svg"; static String weatherIcon = "assets/icons/weather.svg"; - static String cloudIcon = "assets/icons/cloudy.svg"; - static String coldIcon = "assets/icons/cold.svg"; - static String hotIcon = "assets/icons/hot.svg"; - static String rainIcon = "assets/icons/rainy.svg"; - static String sunnyIcon = "assets/icons/sunny.svg"; - static String windIcon = "assets/icons/windy.svg"; + static String cloudyLeftIcon = "assets/new_design_icons/weather_icons/cloudy_left_icon.svg"; + static String coldLeftIcon = "assets/new_design_icons/weather_icons/cold_left_icon.svg"; + static String hotLeftIcon = "assets/new_design_icons/weather_icons/hot_left_icon.svg"; + static String rainyLeftIcon = "assets/new_design_icons/weather_icons/rainy_left_icon.svg"; + static String sunnyLeftIcon = "assets/new_design_icons/weather_icons/sunny_left_icon.svg"; + static String windyLeftIcon = "assets/new_design_icons/weather_icons/windy_left_icon.svg"; + + static String cloudyRightIcon = "assets/new_design_icons/weather_icons/cloudy_right_icon.svg"; + static String coldRightIcon = "assets/new_design_icons/weather_icons/cold_right_icon.svg"; + static String hotRightIcon = "assets/new_design_icons/weather_icons/hot_right_icon.svg"; + static String rainyRightIcon = "assets/new_design_icons/weather_icons/rainy_right_icon.svg"; + static String sunnyRightIcon = "assets/new_design_icons/weather_icons/sunny_right_icon.svg"; + static String windyRightIcon = "assets/new_design_icons/weather_icons/windy_right_icon.svg"; //Tones static String callTone = "assets/tones/call_tone.mp3"; diff --git a/lib/models/weathers_widget_model.dart b/lib/models/weathers_widget_model.dart index 1e75539..8c60bdb 100644 --- a/lib/models/weathers_widget_model.dart +++ b/lib/models/weathers_widget_model.dart @@ -13,7 +13,8 @@ class WeathersWidgetModel { double? windSpeed; String? windDirection; double? windDegrees; - String? weatherIconPath; + String? weatherIconPathLeft; + String? weatherIconPathRight; WeathersWidgetModel({ this.id, @@ -28,7 +29,8 @@ class WeathersWidgetModel { this.windSpeed, this.windDirection, this.windDegrees, - this.weatherIconPath, + this.weatherIconPathLeft, + this.weatherIconPathRight, }); WeathersWidgetModel.fromJson(Map json) { @@ -44,20 +46,21 @@ class WeathersWidgetModel { windSpeed = json['windSpeed']; windDirection = json['windDirection']; windDegrees = json['windDegrees']; - weatherIconPath = getWeatherIconPath(json['iconPhrase']); + weatherIconPathLeft = getWeatherIconPath(json['iconPhrase'], true); + weatherIconPathRight = getWeatherIconPath(json['iconPhrase'], false); } - String getWeatherIconPath(String iconPhrase) { + String getWeatherIconPath(String iconPhrase, bool isLeft) { if (iconPhrase == "Rain" || iconPhrase == "Showers" || iconPhrase == "ThunderStorms") { - return AppAssets.rainIcon; + return isLeft ? AppAssets.rainyLeftIcon : AppAssets.rainyRightIcon; } else if (iconPhrase == "Hot") { - return AppAssets.hotIcon; + return isLeft ? AppAssets.hotLeftIcon : AppAssets.hotRightIcon; } else if (iconPhrase == "Windy") { - return AppAssets.windIcon; + return isLeft ? AppAssets.windyLeftIcon : AppAssets.windyRightIcon; } else if (iconPhrase == "Cloudy" || iconPhrase == "Mostly cloudy" || iconPhrase == "Intermittent clouds") { - return AppAssets.cloudIcon; + return isLeft ? AppAssets.cloudyLeftIcon : AppAssets.cloudyRightIcon; } else if (iconPhrase == "Sunny" || iconPhrase == "Mostly sunny" || iconPhrase == "Partly sunny" || iconPhrase == "Hazy sunshine") { - return AppAssets.sunnyIcon; + return isLeft ? AppAssets.sunnyLeftIcon : AppAssets.sunnyRightIcon; } else { return AppAssets.weatherIcon; } @@ -65,6 +68,6 @@ class WeathersWidgetModel { @override String toString() { - return 'WeathersWidgetModel{id: $id, headline: $headline, maxTemp: $maxTemp, minTemp: $minTemp, iconPhrase: $iconPhrase, forecastDate: $forecastDate, cityID: $cityID, forecastDay: $forecastDay, createDateTime: $createDateTime, windSpeed: $windSpeed, windDirection: $windDirection, windDegrees: $windDegrees, weatherIconPath: $weatherIconPath}'; + return 'WeathersWidgetModel{id: $id, headline: $headline, maxTemp: $maxTemp, minTemp: $minTemp, iconPhrase: $iconPhrase, forecastDate: $forecastDate, cityID: $cityID, forecastDay: $forecastDay, createDateTime: $createDateTime, windSpeed: $windSpeed, windDirection: $windDirection, windDegrees: $windDegrees, weatherIconPathLeft: $weatherIconPathLeft, weatherIconPathRight: $weatherIconPathRight}'; } } diff --git a/lib/repositories/screen_details_repo.dart b/lib/repositories/screen_details_repo.dart index d61deaa..86e6bfb 100644 --- a/lib/repositories/screen_details_repo.dart +++ b/lib/repositories/screen_details_repo.dart @@ -131,7 +131,8 @@ class ScreenDetailsRepoImp implements ScreenDetailsRepo { windSpeed: 12.5, windDirection: "NW", windDegrees: 315.0, - weatherIconPath: AppAssets.sunnyIcon, + weatherIconPathRight: AppAssets.sunnyLeftIcon, + weatherIconPathLeft: AppAssets.sunnyRightIcon, ); try { final body = {"cityID": cityId}; diff --git a/lib/utilities/extensions.dart b/lib/utilities/extensions.dart index ba9b4e0..42b45ec 100644 --- a/lib/utilities/extensions.dart +++ b/lib/utilities/extensions.dart @@ -286,3 +286,12 @@ extension XCallTypeInt on int { return CallTypeEnum.vitalSign; } } + +extension XString on String { + String extractNumbersIfLong() { + if (length > 4) { + return replaceAll(RegExp(r'\D'), ''); + } + return this; + } +} diff --git a/lib/views/common_widgets/app_footer.dart b/lib/views/common_widgets/app_footer.dart index c95e0ae..a87f69e 100644 --- a/lib/views/common_widgets/app_footer.dart +++ b/lib/views/common_widgets/app_footer.dart @@ -441,7 +441,7 @@ class _AppFooterState extends State { children: [ Row( children: [ - buildWeatherIcon(screenConfigVM.weathersWidgetModel.weatherIconPath ?? AppAssets.weatherIcon), + buildWeatherIcon(screenConfigVM.weathersWidgetModel.weatherIconPathLeft ?? AppAssets.cloudyLeftIcon), SizedBox(width: SizeConfig.getWidthMultiplier() * 1.2), buildCurrentCityTemp("الرياض", "21 °C", true), SizedBox(width: SizeConfig.getWidthMultiplier() * 1.2), @@ -454,7 +454,7 @@ class _AppFooterState extends State { SizedBox(width: SizeConfig.getWidthMultiplier() * 1.2), buildTempDetails(screenConfigVM.weathersWidgetModel.iconPhrase, screenConfigVM.weathersWidgetModel.maxTemp, screenConfigVM.weathersWidgetModel.minTemp, false), SizedBox(width: SizeConfig.getWidthMultiplier() * 1.2), - buildWeatherIcon(screenConfigVM.weathersWidgetModel.weatherIconPath ?? AppAssets.weatherIcon), + buildWeatherIcon(screenConfigVM.weathersWidgetModel.weatherIconPathRight ?? AppAssets.cloudyRightIcon), ], ), ], diff --git a/lib/views/common_widgets/app_general_widgets.dart b/lib/views/common_widgets/app_general_widgets.dart index 75976e3..b9c2a02 100644 --- a/lib/views/common_widgets/app_general_widgets.dart +++ b/lib/views/common_widgets/app_general_widgets.dart @@ -45,7 +45,7 @@ Widget getWeatherWidget(ScreenConfigViewModel screenConfigViewModel) { ), const SizedBox(width: 15), SvgPicture.asset( - screenConfigViewModel.weathersWidgetModel.weatherIconPath ?? AppAssets.weatherIcon, + screenConfigViewModel.weathersWidgetModel.weatherIconPathLeft ?? AppAssets.cloudyLeftIcon, height: SizeConfig.getHeightMultiplier() * 0.5, ), ], @@ -300,7 +300,6 @@ Widget engArabicTextWithSeparatorWidget({ ); } - Widget buildTextContainer(bool isForArabic) { return Container( padding: EdgeInsets.all(SizeConfig.getHeightMultiplier() * 0.2), diff --git a/lib/views/common_widgets/date_display_widget.dart b/lib/views/common_widgets/date_display_widget.dart index 0bfe512..dac07d3 100644 --- a/lib/views/common_widgets/date_display_widget.dart +++ b/lib/views/common_widgets/date_display_widget.dart @@ -1,4 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:hmg_qline/constants/app_constants.dart'; +import 'package:hmg_qline/views/common_widgets/app_texts_widget.dart'; +import 'package:hmg_qline/views/view_helpers/size_config.dart'; class SimpleDateDisplay extends StatelessWidget { final bool isForArabic; @@ -46,14 +49,17 @@ class SimpleDateDisplay extends StatelessWidget { final String arabicDateString = '$arabicDayOfWeek | $arabicDayDigits $arabicMonthName'; return isForArabic // Use widget.isForArabic to access the property - ? Text( - arabicDateString, - style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), - textDirection: TextDirection.rtl, // Crucial for Arabic text + ? AppText( + arabicDateString.toString(), + fontSize: SizeConfig.getWidthMultiplier()! * 1.5, + fontFamily: AppStrings.fontNameGesTwo, + fontWeight: FontWeight.bold, ) - : Text( - englishDateString, - style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), + : AppText( + englishDateString.toString(), + fontSize: SizeConfig.getWidthMultiplier()! * 1.5, + fontFamily: AppStrings.fontNamePoppins, + fontWeight: FontWeight.bold, ); } } diff --git a/lib/views/main_queue_screen/components/ticket_item_calling_card.dart b/lib/views/main_queue_screen/components/ticket_item_calling_card.dart index 05dc158..fc1f9f4 100644 --- a/lib/views/main_queue_screen/components/ticket_item_calling_card.dart +++ b/lib/views/main_queue_screen/components/ticket_item_calling_card.dart @@ -91,7 +91,7 @@ class QueueItemCallingCard extends StatelessWidget { padding: EdgeInsets.all(SizeConfig.getHeightMultiplier() * 0.1), color: callTypeEnum.getColorByCallType(), child: engArabicTextWithSeparatorWidget( - englishText: roomNo, + englishText: roomNo.extractNumbersIfLong(), arabicText: roomTextAr, color: AppColors.whiteColor, mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/views/main_queue_screen/components/ticket_item_normal_card.dart b/lib/views/main_queue_screen/components/ticket_item_normal_card.dart index b22f568..87b49fa 100644 --- a/lib/views/main_queue_screen/components/ticket_item_normal_card.dart +++ b/lib/views/main_queue_screen/components/ticket_item_normal_card.dart @@ -116,7 +116,7 @@ class QueueItemNormalCard extends StatelessWidget { color: callTypeEnum.getColorByCallType(), child: engArabicTextWithSeparatorWidget( fontSize: SizeConfig.getWidthMultiplier()! * 1.8, - englishText: roomNo, + englishText: roomNo.extractNumbersIfLong(), arabicText: roomTextAr, color: AppColors.whiteColor, mainAxisAlignment: MainAxisAlignment.center, diff --git a/pubspec.yaml b/pubspec.yaml index 8005cc0..58323f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,6 +91,7 @@ flutter: - assets/tones/ - assets/icons/ - assets/new_design_icons/ + - assets/new_design_icons/weather_icons/ fonts: