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,
|
mode: mode,
|
||||||
couple: selected,
|
couple: selected,
|
||||||
showChevron: multi,
|
showChevron: multi,
|
||||||
|
colorIndex: couples.indexOf(selected),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!multi) return card;
|
if (!multi) return card;
|
||||||
@@ -102,6 +103,7 @@ class CoupleSelectorBandeau extends StatelessWidget {
|
|||||||
showChevron: false,
|
showChevron: false,
|
||||||
selected: false,
|
selected: false,
|
||||||
isMenuItem: true,
|
isMenuItem: true,
|
||||||
|
colorIndex: couples.indexOf(c),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -120,6 +122,7 @@ class _CoupleCard extends StatelessWidget {
|
|||||||
final bool showChevron;
|
final bool showChevron;
|
||||||
final bool selected;
|
final bool selected;
|
||||||
final bool isMenuItem;
|
final bool isMenuItem;
|
||||||
|
final int colorIndex;
|
||||||
|
|
||||||
const _CoupleCard({
|
const _CoupleCard({
|
||||||
required this.mode,
|
required this.mode,
|
||||||
@@ -127,44 +130,36 @@ class _CoupleCard extends StatelessWidget {
|
|||||||
required this.showChevron,
|
required this.showChevron,
|
||||||
this.selected = true,
|
this.selected = true,
|
||||||
this.isMenuItem = false,
|
this.isMenuItem = false,
|
||||||
|
required this.colorIndex,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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(
|
return Container(
|
||||||
height: 90,
|
height: 90,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage(QuotidienTheme.bandeauAssetForCouple(couple.id)),
|
image: AssetImage(QuotidienTheme.bandeauColors[colorIndex % QuotidienTheme.bandeauColors.length]),
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
opacity: opacity,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Opacity(
|
|
||||||
opacity: opacity,
|
|
||||||
child: _MembreTile(
|
child: _MembreTile(
|
||||||
photoUrl: couple.enfant.photoUrl,
|
photoUrl: couple.enfant.photoUrl,
|
||||||
name: couple.enfant.displayName(fallback: 'Enfant'),
|
name: couple.enfant.displayName(fallback: 'Enfant'),
|
||||||
fallbackIcon: Icons.child_care,
|
fallbackIcon: Icons.child_care,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
Container(
|
Container(
|
||||||
width: 1,
|
width: 1,
|
||||||
height: 44,
|
height: 44,
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 12),
|
margin: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
color: QuotidienTheme.ink.withValues(alpha: 0.15 * opacity),
|
color: QuotidienTheme.ink.withValues(alpha: 0.15),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Opacity(
|
|
||||||
opacity: opacity,
|
|
||||||
child: _MembreTile(
|
child: _MembreTile(
|
||||||
photoUrl: couple.am.photoUrl,
|
photoUrl: couple.am.photoUrl,
|
||||||
name: couple.am.displayName(
|
name: couple.am.displayName(
|
||||||
@@ -177,13 +172,12 @@ class _CoupleCard extends StatelessWidget {
|
|||||||
: Icons.person_outline,
|
: Icons.person_outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
if (showChevron)
|
if (showChevron)
|
||||||
Padding(
|
const Padding(
|
||||||
padding: const EdgeInsets.only(left: 4),
|
padding: EdgeInsets.only(left: 4),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.keyboard_arrow_down,
|
Icons.keyboard_arrow_down,
|
||||||
color: QuotidienTheme.ink.withValues(alpha: opacity),
|
color: QuotidienTheme.ink,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user