From 138398a4a0c346171a246a921b931c4768b5a870 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Thu, 24 Sep 2026 00:35:34 +0200 Subject: [PATCH] fix(ui): remove opacity on dropdown items and assign unique bandeau colors by index Co-authored-by: Cursor --- .../quotidien/couple_selector_bandeau.dart | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/frontend/lib/widgets/quotidien/couple_selector_bandeau.dart b/frontend/lib/widgets/quotidien/couple_selector_bandeau.dart index 572c237..771890e 100644 --- a/frontend/lib/widgets/quotidien/couple_selector_bandeau.dart +++ b/frontend/lib/widgets/quotidien/couple_selector_bandeau.dart @@ -64,6 +64,7 @@ class CoupleSelectorBandeau extends StatelessWidget { mode: mode, couple: selected, showChevron: multi, + colorIndex: couples.indexOf(selected), ); if (!multi) return card; @@ -102,6 +103,7 @@ class CoupleSelectorBandeau extends StatelessWidget { showChevron: false, selected: false, isMenuItem: true, + colorIndex: couples.indexOf(c), ), ), ), @@ -120,6 +122,7 @@ class _CoupleCard extends StatelessWidget { final bool showChevron; final bool selected; final bool isMenuItem; + final int colorIndex; const _CoupleCard({ required this.mode, @@ -127,63 +130,54 @@ class _CoupleCard extends StatelessWidget { required this.showChevron, this.selected = true, this.isMenuItem = false, + required this.colorIndex, }); @override Widget build(BuildContext context) { - // Dans le menu, les non-sélectionnés sont un peu translucides - final opacity = (!selected && isMenuItem) ? 0.65 : 1.0; - return Container( height: 90, decoration: BoxDecoration( image: DecorationImage( - image: AssetImage(QuotidienTheme.bandeauAssetForCouple(couple.id)), + image: AssetImage(QuotidienTheme.bandeauColors[colorIndex % QuotidienTheme.bandeauColors.length]), fit: BoxFit.fill, - opacity: opacity, ), ), padding: const EdgeInsets.symmetric(horizontal: 24), child: Row( children: [ Expanded( - child: Opacity( - opacity: opacity, - child: _MembreTile( - photoUrl: couple.enfant.photoUrl, - name: couple.enfant.displayName(fallback: 'Enfant'), - fallbackIcon: Icons.child_care, - ), + child: _MembreTile( + photoUrl: couple.enfant.photoUrl, + name: couple.enfant.displayName(fallback: 'Enfant'), + fallbackIcon: Icons.child_care, ), ), Container( width: 1, height: 44, margin: const EdgeInsets.symmetric(horizontal: 12), - color: QuotidienTheme.ink.withValues(alpha: 0.15 * opacity), + color: QuotidienTheme.ink.withValues(alpha: 0.15), ), Expanded( - child: Opacity( - opacity: opacity, - child: _MembreTile( - photoUrl: couple.am.photoUrl, - name: couple.am.displayName( - fallback: mode == CoupleBandeauMode.parent - ? 'Nounou' - : 'Parent', - ), - fallbackIcon: mode == CoupleBandeauMode.parent - ? Icons.volunteer_activism - : Icons.person_outline, + child: _MembreTile( + photoUrl: couple.am.photoUrl, + name: couple.am.displayName( + fallback: mode == CoupleBandeauMode.parent + ? 'Nounou' + : 'Parent', ), + fallbackIcon: mode == CoupleBandeauMode.parent + ? Icons.volunteer_activism + : Icons.person_outline, ), ), if (showChevron) - Padding( - padding: const EdgeInsets.only(left: 4), + const Padding( + padding: EdgeInsets.only(left: 4), child: Icon( Icons.keyboard_arrow_down, - color: QuotidienTheme.ink.withValues(alpha: opacity), + color: QuotidienTheme.ink, ), ), ],