Files
TravelMate/lib/blocs/trip/trip_state.dart
Dayron c4588a65c0 Refactor signup page to use BLoC pattern and implement authentication repository
- Updated signup.dart to replace Provider with BLoC for state management.
- Created AuthRepository to handle authentication logic and Firestore user management.
- Added TripRepository and UserRepository for trip and user data management.
- Implemented methods for user sign-in, sign-up, and data retrieval in repositories.
- Enhanced trip management with create, update, delete, and participant management functionalities.
- Updated AuthService to include new methods for sign-in and sign-up.
- Removed unnecessary print statements from TripService for cleaner code.
- Added dependencies for flutter_bloc and equatable in pubspec.yaml.

Not tested yet
2025-10-14 10:53:28 +02:00

40 lines
780 B
Dart

import 'package:equatable/equatable.dart';
import '../../data/models/trip.dart';
abstract class TripState extends Equatable {
const TripState();
@override
List<Object?> get props => [];
}
class TripInitial extends TripState {}
class TripLoading extends TripState {}
class TripLoaded extends TripState {
final List<Trip> trips;
const TripLoaded({required this.trips});
@override
List<Object?> get props => [trips];
}
class TripOperationSuccess extends TripState {
final String message;
const TripOperationSuccess({required this.message});
@override
List<Object?> get props => [message];
}
class TripError extends TripState {
final String message;
const TripError({required this.message});
@override
List<Object?> get props => [message];
}