feat: Enhance group and trip management with group creation and account linking
NOT FUNCTIONNAL
This commit is contained in:
@@ -79,10 +79,11 @@ class GroupBloc extends Bloc<GroupEvent, GroupState> {
|
||||
) async {
|
||||
try {
|
||||
emit(GroupLoading());
|
||||
await _repository.createGroupWithMembers(
|
||||
final groupId = await _repository.createGroupWithMembers(
|
||||
group: event.group,
|
||||
members: [],
|
||||
);
|
||||
emit(GroupCreated(groupId: groupId));
|
||||
emit(const GroupOperationSuccess('Groupe créé avec succès'));
|
||||
} catch (e) {
|
||||
emit(GroupError('Erreur lors de la création: $e'));
|
||||
|
||||
@@ -30,6 +30,18 @@ class GroupLoaded extends GroupState {
|
||||
const GroupLoaded(this.groups);
|
||||
}
|
||||
|
||||
class GroupCreated extends GroupState {
|
||||
final String groupId;
|
||||
final String message;
|
||||
|
||||
const GroupCreated({
|
||||
required this.groupId,
|
||||
this.message = 'Groupe créé avec succès',
|
||||
});
|
||||
@override
|
||||
List<Object?> get props => [groupId, message];
|
||||
}
|
||||
|
||||
// Succès d'une opération
|
||||
class GroupOperationSuccess extends GroupState {
|
||||
final String message;
|
||||
|
||||
Reference in New Issue
Block a user