Skip to content

Commit

Permalink
feat(ui): set special UI for the King's Charles boat
Browse files Browse the repository at this point in the history
  • Loading branch information
vareversat committed Sep 18, 2023
1 parent 73dec9e commit e79452b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/const.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class Const {
static const List<String> 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';
Expand Down
6 changes: 5 additions & 1 deletion lib/models/boat_forecast.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit e79452b

Please sign in to comment.