feat: Consolidate group and account creation into a single method and improve error handling in trip creation

This commit is contained in:
Dayron
2025-10-23 11:39:13 +02:00
parent 7cfc5eab6b
commit 5b8d3ec45f
2 changed files with 31 additions and 61 deletions

View File

@@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:travel_mate/blocs/group/group_bloc.dart';
import 'package:travel_mate/blocs/group/group_event.dart';
import 'package:travel_mate/blocs/trip/trip_bloc.dart';
import 'package:travel_mate/blocs/trip/trip_event.dart';
import 'package:travel_mate/components/home/create_trip_content.dart';
@@ -142,7 +140,6 @@ class _ShowTripDetailsContentState extends State<ShowTripDetailsContent> {
TextButton(
onPressed: () {
context.read<TripBloc>().add(TripDeleteRequested(tripId: widget.trip.id!));
context.read<GroupBloc>().add(DeleteGroup(widget.trip.id!));
Navigator.pop(context); // Fermer le dialogue
Navigator.pop(context, true); // Retourner à l'écran précédent
},