Enhance model and service documentation with detailed comments and descriptions

- Updated Group, Trip, User, and other model classes to include comprehensive documentation for better understanding and maintainability.
- Improved error handling and logging in services, including AuthService, ErrorService, and StorageService.
- Added validation and business logic explanations in ExpenseService and TripService.
- Refactored method comments to follow a consistent format across the codebase.
- Translated error messages and comments from French to English for consistency.
This commit is contained in:
Dayron
2025-10-30 15:56:17 +01:00
parent 1eeea6997e
commit 2faf37f145
46 changed files with 2656 additions and 220 deletions

View File

@@ -1,24 +1,47 @@
/// Abstract base class for all user-related events.
///
/// All user events in the application should inherit from this class.
/// This provides a common interface for user-related operations.
abstract class UserEvent {}
/// Event to initialize the current user's data.
///
/// This event is typically dispatched when the app starts or when
/// a user signs in to load their profile information from Firestore.
class UserInitialized extends UserEvent {}
class UserLoaded extends UserEvent {
/// Event to load a specific user's data by their ID.
///
/// This event is used to fetch user information from Firestore
/// when you need to display or work with a specific user's data.
class LoadUser extends UserEvent {
/// The ID of the user to load.
final String userId;
UserLoaded(this.userId);
/// Creates a [LoadUser] event with the specified [userId].
LoadUser(this.userId);
}
/// Event to update the current user's data.
///
/// This event is dispatched when the user modifies their profile
/// information and the changes need to be saved to Firestore.
class UserUpdated extends UserEvent {
/// Map containing the user data fields to update.
///
/// Only the fields present in this map will be updated in Firestore.
/// This allows for partial updates of user information.
final Map<String, dynamic> userData;
/// Creates a [UserUpdated] event with the specified [userData].
UserUpdated(this.userData);
}
/// Event to handle user logout.
///
/// This event is dispatched when the user signs out of the application,
/// clearing their data from the user bloc state.
class UserLoggedOut extends UserEvent {
/// Creates a [UserLoggedOut] event.
UserLoggedOut();
}
class LoadUser extends UserEvent {
final String userId;
LoadUser(this.userId);
}