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:
@@ -1,18 +1,37 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// Abstract base class for all authentication-related events.
|
||||
///
|
||||
/// This class extends [Equatable] to enable value equality for event comparison.
|
||||
/// All authentication events in the application should inherit from this class.
|
||||
abstract class AuthEvent extends Equatable {
|
||||
/// Creates a new [AuthEvent].
|
||||
const AuthEvent();
|
||||
|
||||
@override
|
||||
List<Object?> get props => [];
|
||||
}
|
||||
|
||||
/// Event to check the current authentication status.
|
||||
///
|
||||
/// This event is typically dispatched when the app starts to determine
|
||||
/// if a user is already authenticated.
|
||||
class AuthCheckRequested extends AuthEvent {}
|
||||
|
||||
/// Event to request user sign-in with email and password.
|
||||
///
|
||||
/// This event contains the user's credentials and triggers the authentication
|
||||
/// process when dispatched to the [AuthBloc].
|
||||
class AuthSignInRequested extends AuthEvent {
|
||||
/// The user's email address.
|
||||
final String email;
|
||||
|
||||
/// The user's password.
|
||||
final String password;
|
||||
|
||||
/// Creates a new [AuthSignInRequested] event.
|
||||
///
|
||||
/// Both [email] and [password] are required parameters.
|
||||
const AuthSignInRequested({
|
||||
required this.email,
|
||||
required this.password,
|
||||
@@ -22,12 +41,26 @@ class AuthSignInRequested extends AuthEvent {
|
||||
List<Object?> get props => [email, password];
|
||||
}
|
||||
|
||||
/// Event to request user registration with email, password, and personal information.
|
||||
///
|
||||
/// This event contains all necessary information to create a new user account
|
||||
/// and triggers the registration process when dispatched to the [AuthBloc].
|
||||
class AuthSignUpRequested extends AuthEvent {
|
||||
/// The user's email address.
|
||||
final String email;
|
||||
|
||||
/// The user's password.
|
||||
final String password;
|
||||
|
||||
/// The user's last name.
|
||||
final String nom;
|
||||
|
||||
/// The user's first name.
|
||||
final String prenom;
|
||||
|
||||
/// Creates a new [AuthSignUpRequested] event.
|
||||
///
|
||||
/// All parameters are required for user registration.
|
||||
const AuthSignUpRequested({
|
||||
required this.email,
|
||||
required this.password,
|
||||
@@ -39,15 +72,33 @@ class AuthSignUpRequested extends AuthEvent {
|
||||
List<Object?> get props => [email, password, nom, prenom];
|
||||
}
|
||||
|
||||
/// Event to request user sign-in using Google authentication.
|
||||
///
|
||||
/// This event triggers the Google sign-in flow when dispatched to the [AuthBloc].
|
||||
class AuthGoogleSignInRequested extends AuthEvent {}
|
||||
|
||||
/// Event to request user sign-in using Apple authentication.
|
||||
///
|
||||
/// This event triggers the Apple sign-in flow when dispatched to the [AuthBloc].
|
||||
class AuthAppleSignInRequested extends AuthEvent {}
|
||||
|
||||
/// Event to request user sign-out.
|
||||
///
|
||||
/// This event triggers the sign-out process and clears the user session
|
||||
/// when dispatched to the [AuthBloc].
|
||||
class AuthSignOutRequested extends AuthEvent {}
|
||||
|
||||
/// Event to request a password reset for a user account.
|
||||
///
|
||||
/// This event triggers the password reset process by sending a reset email
|
||||
/// to the specified email address.
|
||||
class AuthPasswordResetRequested extends AuthEvent {
|
||||
/// The email address to send the password reset link to.
|
||||
final String email;
|
||||
|
||||
/// Creates a new [AuthPasswordResetRequested] event.
|
||||
///
|
||||
/// The [email] parameter is required.
|
||||
const AuthPasswordResetRequested({required this.email});
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user