Merge branch 'feature/167-selecteur-couple-enfant-nounou' into develop
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,47 +130,52 @@ 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: Padding(
|
||||
padding: const EdgeInsets.only(right: 12),
|
||||
child: _MembreTile(
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
width: 8,
|
||||
height: 44,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 12),
|
||||
color: QuotidienTheme.ink.withValues(alpha: 0.15 * opacity),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(QuotidienTheme.pencilLineVerticalAsset),
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Opacity(
|
||||
opacity: opacity,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: _MembreTile(
|
||||
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
|
||||
? 'Nounou'
|
||||
: 'Parent',
|
||||
@@ -178,13 +186,14 @@ class _CoupleCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (showChevron)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: Icon(
|
||||
SizedBox(
|
||||
width: 28,
|
||||
child: showChevron
|
||||
? const Icon(
|
||||
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) {
|
||||
return Row(
|
||||
children: [
|
||||
_Avatar(photoUrl: photoUrl, fallbackIcon: fallbackIcon, size: 48),
|
||||
const SizedBox(width: 10),
|
||||
_Avatar(photoUrl: photoUrl, fallbackIcon: fallbackIcon, size: 64),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: GoogleFonts.merienda(
|
||||
fontSize: 15,
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: QuotidienTheme.ink,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user