fix(ui): remove opacity on dropdown items and assign unique bandeau colors by index

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-24 00:35:52 +02:00
co-authored by Cursor
parent 5eb3468fe0
commit 138398a4a0
@@ -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,
),
),
],