feat: Implement account management functionality with loading, creation, and error handling

This commit is contained in:
Dayron
2025-10-21 10:48:12 +02:00
parent c69618cbd9
commit 62eb434548
9 changed files with 520 additions and 245 deletions

View File

@@ -4,12 +4,14 @@ class Account {
final String id;
final String tripId;
final String groupId;
final String name;
final List<GroupMember> members;
Account({
required this.id,
required this.tripId,
required this.groupId,
required this.name,
List<GroupMember>? members,
}) : members = members ?? [];
@@ -19,6 +21,7 @@ class Account {
id: map['id'] as String,
tripId: map['tripId'] as String,
groupId: map['groupId'] as String,
name: map['name'] as String,
members: [],
);
}
@@ -28,6 +31,7 @@ class Account {
'id': id,
'tripId': tripId,
'groupId': groupId,
'name': name,
'members': members.map((member) => member.toMap()).toList(),
};
}
@@ -36,12 +40,14 @@ class Account {
String? id,
String? tripId,
String? groupId,
String? name,
List<GroupMember>? members,
}) {
return Account(
id: id ?? this.id,
tripId: tripId ?? this.tripId,
groupId: groupId ?? this.groupId,
name: name ?? this.name,
members: members ?? this.members,
);
}