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,15 +1,32 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// State class for theme management.
|
||||
///
|
||||
/// This class represents the current theme state of the application,
|
||||
/// including the selected theme mode and provides utility methods
|
||||
/// for theme-related operations.
|
||||
class ThemeState extends Equatable {
|
||||
/// The current theme mode of the application.
|
||||
final ThemeMode themeMode;
|
||||
|
||||
/// Creates a new [ThemeState] with the specified [themeMode].
|
||||
///
|
||||
/// Defaults to [ThemeMode.system] if no theme mode is provided.
|
||||
const ThemeState({this.themeMode = ThemeMode.system});
|
||||
|
||||
/// Whether the current theme mode is explicitly set to dark.
|
||||
///
|
||||
/// Returns true only if the theme mode is [ThemeMode.dark].
|
||||
/// Returns false for [ThemeMode.light] and [ThemeMode.system].
|
||||
bool get isDarkMode {
|
||||
return themeMode == ThemeMode.dark;
|
||||
}
|
||||
|
||||
/// Creates a copy of this state with optionally modified properties.
|
||||
///
|
||||
/// Allows updating the theme mode while preserving other state properties.
|
||||
/// Useful for state transitions in the theme BLoC.
|
||||
ThemeState copyWith({ThemeMode? themeMode}) {
|
||||
return ThemeState(
|
||||
themeMode: themeMode ?? this.themeMode,
|
||||
|
||||
Reference in New Issue
Block a user