Merge branch 'feature/167-selecteur-couple-enfant-nounou' into develop

This commit is contained in:
2026-09-24 00:47:10 +02:00
@@ -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,47 +130,52 @@ 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( child: Padding(
opacity: opacity, padding: const EdgeInsets.only(right: 12),
child: _MembreTile( child: _MembreTile(
photoUrl: couple.enfant.photoUrl, photoUrl: couple.enfant.photoUrl,
name: couple.enfant.displayName(fallback: 'Enfant'), name: (couple.enfant.prenom != null && couple.enfant.prenom!.isNotEmpty)
? couple.enfant.prenom!
: couple.enfant.displayName(fallback: 'Enfant'),
fallbackIcon: Icons.child_care, fallbackIcon: Icons.child_care,
), ),
), ),
), ),
Container( Container(
width: 1, width: 8,
height: 44, height: 44,
margin: const EdgeInsets.symmetric(horizontal: 12), decoration: const BoxDecoration(
color: QuotidienTheme.ink.withValues(alpha: 0.15 * opacity), image: DecorationImage(
image: AssetImage(QuotidienTheme.pencilLineVerticalAsset),
fit: BoxFit.contain,
),
),
), ),
Expanded( Expanded(
child: Opacity( child: Padding(
opacity: opacity, padding: const EdgeInsets.only(left: 12),
child: _MembreTile( child: _MembreTile(
photoUrl: couple.am.photoUrl, photoUrl: couple.am.photoUrl,
name: couple.am.displayName( name: (couple.am.prenom != null && couple.am.prenom!.isNotEmpty)
? couple.am.prenom!
: couple.am.displayName(
fallback: mode == CoupleBandeauMode.parent fallback: mode == CoupleBandeauMode.parent
? 'Nounou' ? 'Nounou'
: 'Parent', : 'Parent',
@@ -178,13 +186,14 @@ class _CoupleCard extends StatelessWidget {
), ),
), ),
), ),
if (showChevron) SizedBox(
Padding( width: 28,
padding: const EdgeInsets.only(left: 4), child: showChevron
child: Icon( ? const Icon(
Icons.keyboard_arrow_down, Icons.keyboard_arrow_down,
color: QuotidienTheme.ink.withValues(alpha: opacity), color: QuotidienTheme.ink,
), )
: null,
), ),
], ],
), ),
@@ -208,15 +217,15 @@ class _MembreTile extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Row(
children: [ children: [
_Avatar(photoUrl: photoUrl, fallbackIcon: fallbackIcon, size: 48), _Avatar(photoUrl: photoUrl, fallbackIcon: fallbackIcon, size: 64),
const SizedBox(width: 10), const SizedBox(width: 12),
Expanded( Expanded(
child: Text( child: Text(
name, name,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: GoogleFonts.merienda( style: GoogleFonts.merienda(
fontSize: 15, fontSize: 22,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: QuotidienTheme.ink, color: QuotidienTheme.ink,
), ),