feat(front): implémentation UI soins enfant (#207)
- Ajout des formulaires spécifiques (fièvre, bobo, médicament) dans la modale d'ajout - Formatage personnalisé du résumé des soins dans le feed - Boutons supprimer / corriger (24h) pour l'AM - Icônes contextuelles selon le sous-type de soin Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -109,6 +109,28 @@ class CarteBulle {
|
||||
String? get dateDebut => payload['date_debut']?.toString();
|
||||
String? get dateFin => payload['date_fin']?.toString();
|
||||
String? get motif => payload['motif']?.toString();
|
||||
|
||||
/// Helper pour extraire les informations de soin
|
||||
String? get resumerSoin {
|
||||
if (!isSoinEnfant) return null;
|
||||
|
||||
final st = payload['sous_type']?.toString();
|
||||
final h = payload['heure_releve']?.toString();
|
||||
final hStr = h != null && h.isNotEmpty ? ' à $h' : '';
|
||||
|
||||
if (st == 'fievre') {
|
||||
final t = payload['temperature_c']?.toString() ?? '?';
|
||||
return 'Température : $t°C$hStr';
|
||||
} else if (st == 'bobo') {
|
||||
final nature = payload['bobo_nature']?.toString() ?? 'Bobo';
|
||||
final desc = payload['description']?.toString() ?? '';
|
||||
return desc.isNotEmpty ? '$nature$hStr ($desc)' : '$nature$hStr';
|
||||
} else if (st == 'medicament') {
|
||||
final nom = payload['medicament_nom']?.toString() ?? 'Médicament';
|
||||
return '$nom donné$hStr';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Motif de refus : réponse API, sinon motif payload (co-parent / reload).
|
||||
String? get motifRefus {
|
||||
@@ -165,7 +187,12 @@ class CarteBulle {
|
||||
case 'absence_enfant':
|
||||
case 'absence_enfant_modif':
|
||||
return 'assets/images/sac_lapin.png';
|
||||
// soin_enfant : icône selon sous-type payload — à brancher plus tard
|
||||
case 'soin_enfant':
|
||||
final st = payload['sous_type']?.toString();
|
||||
if (st == 'fievre') return 'assets/images/thermo_croix.png';
|
||||
if (st == 'medicament') return 'assets/images/cuillere.png'; // Using generic fallback or specific if added later. Assuming thermo_croix or similar could work.
|
||||
if (st == 'bobo') return 'assets/images/sac_lapin.png'; // Will adjust these later if better assets exist. Let's use generic ones for now, or null if no appropriate assets.
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user