From e79452b88aadda74d84d0ed89577dbc3480738fc Mon Sep 17 00:00:00 2001 From: Valentin REVERSAT Date: Mon, 18 Sep 2023 23:11:12 +0200 Subject: [PATCH] feat(ui): set special UI for the King's Charles boat --- lib/const.dart | 1 + lib/models/boat_forecast.dart | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/const.dart b/lib/const.dart index df4a798e..cdbb3d92 100644 --- a/lib/const.dart +++ b/lib/const.dart @@ -150,6 +150,7 @@ class Const { static const List vowelList = ['a', 'e', 'i', 'o', 'u', 'y']; static const String oflLicenseEntryName = 'google_fonts'; static const String specialWineFestivalBoatsEvent = 'Bateaux fete du vin'; + static const String specialKingCharlesBoats = 'IRON DUKE'; static const String sentryDSNEnvKey = 'SENTRY_DSN'; static const String envKey = 'ENV'; static const String defaultEnv = 'dev'; diff --git a/lib/models/boat_forecast.dart b/lib/models/boat_forecast.dart index 9ce25a32..411080b8 100644 --- a/lib/models/boat_forecast.dart +++ b/lib/models/boat_forecast.dart @@ -1,3 +1,4 @@ +import 'package:chabo_app/const.dart'; import 'package:chabo_app/cubits/time_format_cubit.dart'; import 'package:chabo_app/extensions/boats_extension.dart'; import 'package:chabo_app/extensions/color_scheme_extension.dart'; @@ -58,7 +59,10 @@ class BoatForecast extends AbstractForecast { bool isLeaving = false; final rawBoatName = json['fields']['bateau'] as String; final boatNames = rawBoatName.split(RegExp(r'/')); - for (final boatName in boatNames) { + for (var boatName in boatNames) { + if (rawBoatName == Const.specialKingCharlesBoats) { + boatName = '👑 $boatName 👑'; + } final trimmedBoatName = boatName.trim(); isLeaving = allBoatNames.contains(trimmedBoatName); boats.add(Boat(name: trimmedBoatName, isLeaving: isLeaving));