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
This commit is contained in:
Dayron
2025-10-14 10:53:28 +02:00
parent a467b92979
commit c4588a65c0
31 changed files with 1500 additions and 689 deletions

View File

@@ -0,0 +1,71 @@
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];
}