fix(#153): peaufiner cartes dossiers et recherche.
Cartes neutres avec accent icône, photo AM si dispo, hint court et infobulle de critères sur la barre de recherche. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:p_tits_pas/widgets/admin/common/admin_user_card.dart';
|
||||
|
||||
/// Carte dossier unifiée (#153) — pending et liste complète.
|
||||
/// Carte dossier unifiée (#153) — fond neutre, accent couleur sur l’icône.
|
||||
class DossierListCard extends StatelessWidget {
|
||||
final String numeroDossier;
|
||||
final String namesLine;
|
||||
final bool isFamille;
|
||||
final VoidCallback onOpen;
|
||||
/// Photo AM (si absente → icône fallback).
|
||||
final String? photoUrl;
|
||||
|
||||
static const Color familleBg = Color(0xFFF3EEF8);
|
||||
static const Color familleBorder = Color(0xFFB39DDB);
|
||||
static const Color familleAccent = Color(0xFF7E57C2);
|
||||
static const Color amBg = Color(0xFFE8F5F3);
|
||||
static const Color amBorder = Color(0xFF80CBC4);
|
||||
static const Color amAccent = Color(0xFF00897B);
|
||||
/// Lavande — Famille / Parents.
|
||||
static const Color familleAccent = Color(0xFFB289C9);
|
||||
|
||||
/// Menthe logo — AM.
|
||||
static const Color amAccent = Color(0xFF5A9D94);
|
||||
|
||||
const DossierListCard({
|
||||
super.key,
|
||||
@@ -21,24 +22,24 @@ class DossierListCard extends StatelessWidget {
|
||||
required this.namesLine,
|
||||
required this.isFamille,
|
||||
required this.onOpen,
|
||||
this.photoUrl,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bg = isFamille ? familleBg : amBg;
|
||||
final border = isFamille ? familleBorder : amBorder;
|
||||
final accent = isFamille ? familleAccent : amAccent;
|
||||
final num = numeroDossier.trim().isEmpty ? '–' : numeroDossier.trim();
|
||||
final names = namesLine.trim();
|
||||
final avatar = (photoUrl ?? '').trim();
|
||||
|
||||
return AdminUserCard(
|
||||
title: num,
|
||||
subtitleLines: names.isEmpty ? const [] : [names],
|
||||
avatarUrl: !isFamille && avatar.isNotEmpty ? avatar : null,
|
||||
fallbackIcon:
|
||||
isFamille ? Icons.family_restroom_outlined : Icons.person_outline,
|
||||
backgroundColor: bg,
|
||||
borderColor: border,
|
||||
titleColor: accent,
|
||||
isFamille ? Icons.family_restroom_outlined : Icons.face,
|
||||
// N° = titre neutre (comme Parents / AM) ; accent = icône seule.
|
||||
avatarIconColor: accent,
|
||||
infoColor: Colors.black87,
|
||||
onCardTap: onOpen,
|
||||
actions: [
|
||||
|
||||
Reference in New Issue
Block a user