create project

This commit is contained in:
2026-05-19 11:46:42 +08:00
commit dcdf1f60b1
60 changed files with 9309 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
class User {
final String id;
final String phone;
final String nickname;
final String? email;
final List<String> familyIds;
final String? activeFamilyId;
final String joinDate;
final String createdAt;
const User({
required this.id,
required this.phone,
required this.nickname,
this.email,
this.familyIds = const [],
this.activeFamilyId,
this.joinDate = '',
this.createdAt = '',
});
factory User.fromJson(Map<String, dynamic> json) {
return User(
id: json['id'] as String? ?? '',
phone: json['phone'] as String? ?? '',
nickname: json['nickname'] as String? ?? '',
email: json['email'] as String?,
familyIds: (json['familyIds'] as List<dynamic>?)?.cast<String>() ?? [],
activeFamilyId: json['activeFamilyId'] as String?,
joinDate: json['joinDate'] as String? ?? '',
createdAt: json['createdAt'] as String? ?? '',
);
}
Map<String, dynamic> toJson() => {
'id': id,
'phone': phone,
'nickname': nickname,
'email': email,
'familyIds': familyIds,
'activeFamilyId': activeFamilyId,
'joinDate': joinDate,
'createdAt': createdAt,
};
}