feat: Remove unused balance model import and add count bloc imports in create trip content
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../../data/models/expense.dart';
|
||||
import '../../data/models/balance.dart';
|
||||
import '../../services/count_service.dart';
|
||||
import '../../repositories/count_repository.dart';
|
||||
import 'count_event.dart';
|
||||
|
||||
@@ -9,6 +9,8 @@ import '../../blocs/trip/trip_event.dart';
|
||||
import '../../blocs/trip/trip_state.dart';
|
||||
import '../../blocs/group/group_bloc.dart';
|
||||
import '../../blocs/group/group_event.dart';
|
||||
import '../../blocs/count/count_bloc.dart';
|
||||
import '../../blocs/count/count_event.dart';
|
||||
import '../../data/models/group.dart';
|
||||
import '../../data/models/group_member.dart';
|
||||
import '../../services/user_service.dart';
|
||||
@@ -570,7 +572,7 @@ class _CreateTripContentState extends State<CreateTripContent> {
|
||||
final group = Group(
|
||||
id: '', // Sera généré par Firestore
|
||||
name: _titleController.text.trim(),
|
||||
tripId: tripId, // ✅ ID du voyage récupéré
|
||||
tripId: tripId,
|
||||
createdBy: currentUser.id,
|
||||
);
|
||||
|
||||
@@ -589,11 +591,15 @@ class _CreateTripContentState extends State<CreateTripContent> {
|
||||
)),
|
||||
];
|
||||
|
||||
// Créer le groupe
|
||||
context.read<GroupBloc>().add(CreateGroupWithMembers(
|
||||
group: group,
|
||||
members: groupMembers,
|
||||
));
|
||||
|
||||
// ✅ AJOUT : Attendre un court instant pour que le groupe soit créé
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
|
||||
Reference in New Issue
Block a user