class FamilyMember { final String id; final String name; final String iconUrl; final String emoji; final String color; final int order; const FamilyMember({ required this.id, required this.name, required this.iconUrl, required this.emoji, required this.color, required this.order, }); factory FamilyMember.fromJson(Map json) { return FamilyMember( id: json["_id"] as String? ?? "", name: json["name"] as String? ?? "", iconUrl: json["iconUrl"] as String? ?? "", emoji: json["emoji"] as String? ?? "", color: json["color"] as String? ?? "", order: (json["order"] as num?)?.toInt() ?? 0, ); } Map toJson() { return { "name": name, "iconUrl": iconUrl, "color": color, "order": order, }; } }