feat(#131): en-tête fiche parent avec nom et co-parent.

Affiche le prénom/nom du parent en titre et le co-parent en sous-titre ; note handoff back dans archive/temporaires.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-24 23:37:04 +02:00
co-authored by Cursor
parent d55f240f56
commit ebf794e1ac
4 changed files with 188 additions and 7 deletions
+9
View File
@@ -3,11 +3,13 @@ import 'package:p_tits_pas/models/user.dart';
class ParentModel {
final AppUser user;
final AppUser? coParent;
final int childrenCount;
final List<ParentChildSummary> children;
ParentModel({
required this.user,
this.coParent,
this.childrenCount = 0,
this.children = const [],
});
@@ -20,12 +22,19 @@ class ParentModel {
}
final user = AppUser.fromJson(userJson);
AppUser? coParent;
final coParentRaw = root['co_parent'];
if (coParentRaw is Map) {
coParent = AppUser.fromJson(Map<String, dynamic>.from(coParentRaw));
}
final children = _parseChildren(root);
final links = root['parentChildren'] ?? root['parent_children'];
final linkCount = links is List ? links.length : 0;
return ParentModel(
user: user,
coParent: coParent,
childrenCount: children.isNotEmpty ? children.length : linkCount,
children: children,
);