Merge branch 'feature/167-selecteur-couple-enfant-nounou' into develop (#167)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,6 +19,39 @@ abstract final class QuotidienTheme {
|
||||
/// couleur charte par section ; l'inactive est la même, plus transparente.
|
||||
static const double pillInactiveOpacity = 0.45;
|
||||
static const String pillIvoryAsset = 'assets/images/bg_ivoire_pill.png';
|
||||
static const String pillBlueAsset = 'assets/images/bg_blue_pill.png';
|
||||
|
||||
// Bandeaux pour les couples (ratio 10:1, dessinés au crayon, couleur dynamique)
|
||||
static const String bandeauLime = 'assets/images/bandeau_lime.png';
|
||||
static const String bandeauBlue = 'assets/images/bandeau_blue.png';
|
||||
static const String bandeauPeach = 'assets/images/bandeau_peach.png';
|
||||
static const String bandeauYellow = 'assets/images/bandeau_yellow.png';
|
||||
static const String bandeauLavender = 'assets/images/bandeau_lavender.png';
|
||||
|
||||
static const List<String> bandeauColors = [
|
||||
bandeauLime,
|
||||
bandeauBlue,
|
||||
bandeauPeach,
|
||||
bandeauYellow,
|
||||
bandeauLavender,
|
||||
];
|
||||
|
||||
/// Retourne un asset bandeau fixe pour un couple donné.
|
||||
/// Si un [colorIndex] est fourni, il sera utilisé (pour garantir l'unicité).
|
||||
static String bandeauAssetForCouple(String coupleId, {int? colorIndex}) {
|
||||
if (colorIndex != null) {
|
||||
return bandeauColors[colorIndex % bandeauColors.length];
|
||||
}
|
||||
|
||||
if (coupleId.isEmpty) return bandeauLime;
|
||||
|
||||
// Repli de secours
|
||||
int hash = 0;
|
||||
for (int i = 0; i < coupleId.length; i++) {
|
||||
hash = (hash * 31 + coupleId.codeUnitAt(i)) % 1000000007;
|
||||
}
|
||||
return bandeauColors[hash % bandeauColors.length];
|
||||
}
|
||||
static const String pillYellowAsset = 'assets/images/bg_yellow_pill.png';
|
||||
static const String pillPeachAsset = 'assets/images/bg_peach_pill.png';
|
||||
static const String pillTurquoiseAsset =
|
||||
|
||||
Reference in New Issue
Block a user