feat: Enhance group and trip management with group creation and account linking

NOT FUNCTIONNAL
This commit is contained in:
Dayron
2025-10-22 12:23:26 +02:00
parent 4edbd1cf34
commit 905948379a
4 changed files with 178 additions and 70 deletions

View File

@@ -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'));

View File

@@ -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;

View File

@@ -21,7 +21,6 @@ class TripLoaded extends TripState {
List<Object?> get props => [trips];
}
// NOUVEAU : État pour indiquer qu'un voyage a été créé avec succès
class TripCreated extends TripState {
final String tripId;
final String message;