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:
@@ -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,44 +130,36 @@ 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,
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
@@ -177,13 +172,12 @@ class _CoupleCard extends StatelessWidget {
|
||||
: 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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user