fix(#173): motif de refus plus visible sur les congés refusés

Affiche « Motif : … » pour les co-parents (réponse API ou payload),
et retire la capture flutter_01.png locale.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-05 12:03:54 +02:00
co-authored by Cursor
parent f3b2da4b4d
commit 6c8ef32a11
2 changed files with 14 additions and 5 deletions
+9
View File
@@ -84,6 +84,15 @@ class CarteBulle {
String? get dateFin => payload['date_fin']?.toString(); String? get dateFin => payload['date_fin']?.toString();
String? get motif => payload['motif']?.toString(); String? get motif => payload['motif']?.toString();
/// Motif de refus : réponse API, sinon motif payload (co-parent / reload).
String? get motifRefus {
final fromResponse = lastRefuseComment?.trim();
if (fromResponse != null && fromResponse.isNotEmpty) return fromResponse;
final fromPayload = motif?.trim();
if (fromPayload != null && fromPayload.isNotEmpty) return fromPayload;
return null;
}
/// Libellé UI (sémantique produit) — pas le titre brut API. /// Libellé UI (sémantique produit) — pas le titre brut API.
String get titreAffiche { String get titreAffiche {
switch (typeCode) { switch (typeCode) {
@@ -592,16 +592,16 @@ class _BulleTile extends StatelessWidget {
], ],
if (card.isCongeAm && if (card.isCongeAm &&
card.statut == CarteStatut.refusee && card.statut == CarteStatut.refusee &&
card.lastRefuseComment != null && card.motifRefus != null) ...[
card.lastRefuseComment!.trim().isNotEmpty) ...[
const SizedBox(height: 8), const SizedBox(height: 8),
Text( Text(
'Motif : ${card.lastRefuseComment}', 'Motif : ${card.motifRefus}',
maxLines: 2, maxLines: 4,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: GoogleFonts.merriweather( style: GoogleFonts.merriweather(
fontSize: 12, fontSize: 13,
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
height: 1.3,
color: encre.ink, color: encre.ink,
), ),
), ),