79 lines
1.6 KiB
Dart
79 lines
1.6 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
import '../../data/models/trip.dart';
|
|
|
|
abstract class TripEvent extends Equatable {
|
|
const TripEvent();
|
|
|
|
@override
|
|
List<Object?> get props => [];
|
|
}
|
|
|
|
class TripLoadRequested extends TripEvent {
|
|
final String userId;
|
|
|
|
const TripLoadRequested({required this.userId});
|
|
|
|
@override
|
|
List<Object?> get props => [userId];
|
|
}
|
|
|
|
class TripCreateRequested extends TripEvent {
|
|
final Trip trip;
|
|
|
|
const TripCreateRequested({required this.trip});
|
|
|
|
@override
|
|
List<Object?> get props => [trip];
|
|
}
|
|
|
|
class TripUpdateRequested extends TripEvent {
|
|
final Trip trip;
|
|
|
|
const TripUpdateRequested({required this.trip});
|
|
|
|
@override
|
|
List<Object?> get props => [trip];
|
|
}
|
|
|
|
class TripDeleteRequested extends TripEvent {
|
|
final String tripId;
|
|
|
|
const TripDeleteRequested({required this.tripId});
|
|
|
|
@override
|
|
List<Object?> get props => [tripId];
|
|
}
|
|
|
|
class TripParticipantAddRequested extends TripEvent {
|
|
final String tripId;
|
|
final String participantEmail;
|
|
|
|
const TripParticipantAddRequested({
|
|
required this.tripId,
|
|
required this.participantEmail,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [tripId, participantEmail];
|
|
}
|
|
|
|
class TripParticipantRemoveRequested extends TripEvent {
|
|
final String tripId;
|
|
final String participantEmail;
|
|
|
|
const TripParticipantRemoveRequested({
|
|
required this.tripId,
|
|
required this.participantEmail,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [tripId, participantEmail];
|
|
}
|
|
|
|
// NOUVEAU : Événement pour réinitialiser les trips
|
|
class ResetTrips extends TripEvent {
|
|
const ResetTrips();
|
|
|
|
@override
|
|
List<Object?> get props => [];
|
|
} |