feat: Enhance trip management features and improve UI responsiveness
- Implemented AutomaticKeepAliveClientMixin in HomeContent to maintain state during navigation. - Modified trip loading logic to trigger after the first frame for better performance. - Updated trip loading events to use LoadTripsByUserId for consistency. - Added temporary success messages for trip creation and operations. - Improved UI elements for better user experience, including updated text styles and spacing. - Refactored trip model to support Firestore timestamps and improved error handling during parsing. - Streamlined trip repository methods for better clarity and performance. - Enhanced trip service methods to ensure correct mapping from Firestore documents. - Removed unnecessary trip reset logic on logout.
This commit is contained in:
@@ -15,16 +15,30 @@ class TripLoading extends TripState {}
|
||||
class TripLoaded extends TripState {
|
||||
final List<Trip> trips;
|
||||
|
||||
const TripLoaded({required this.trips});
|
||||
const TripLoaded(this.trips);
|
||||
|
||||
@override
|
||||
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;
|
||||
|
||||
const TripCreated({
|
||||
required this.tripId,
|
||||
this.message = 'Voyage créé avec succès',
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [tripId, message];
|
||||
}
|
||||
|
||||
class TripOperationSuccess extends TripState {
|
||||
final String message;
|
||||
|
||||
const TripOperationSuccess({required this.message});
|
||||
const TripOperationSuccess(this.message);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [message];
|
||||
@@ -33,7 +47,7 @@ class TripOperationSuccess extends TripState {
|
||||
class TripError extends TripState {
|
||||
final String message;
|
||||
|
||||
const TripError({required this.message});
|
||||
const TripError(this.message);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [message];
|
||||
|
||||
Reference in New Issue
Block a user