/// Constantes globales de l'application library app_constants; /// Constantes de l'application UnionFlow class AppConstants { // Empêcher l'instanciation AppConstants._(); // ============================================================================ // API & BACKEND // ============================================================================ /// URL de base de l'API backend static const String baseUrl = 'http://192.168.1.11:8080'; /// URL de base de Keycloak static const String keycloakUrl = 'http://192.168.1.11:8180'; /// Realm Keycloak static const String keycloakRealm = 'unionflow'; /// Client ID Keycloak static const String keycloakClientId = 'unionflow-mobile'; /// Redirect URI pour l'authentification static const String redirectUri = 'dev.lions.unionflow-mobile://auth/callback'; // ============================================================================ // PAGINATION // ============================================================================ /// Taille de page par défaut pour les listes paginées static const int defaultPageSize = 20; /// Taille de page maximale static const int maxPageSize = 100; /// Taille de page minimale static const int minPageSize = 5; /// Page initiale static const int initialPage = 0; // ============================================================================ // TIMEOUTS // ============================================================================ /// Timeout de connexion (en secondes) static const Duration connectTimeout = Duration(seconds: 30); /// Timeout d'envoi (en secondes) static const Duration sendTimeout = Duration(seconds: 30); /// Timeout de réception (en secondes) static const Duration receiveTimeout = Duration(seconds: 30); // ============================================================================ // CACHE // ============================================================================ /// Durée d'expiration du cache (en heures) static const Duration cacheExpiration = Duration(hours: 1); /// Durée d'expiration du cache pour les données statiques (en jours) static const Duration staticCacheExpiration = Duration(days: 7); /// Taille maximale du cache (en MB) static const int maxCacheSize = 100; // ============================================================================ // UI & DESIGN // ============================================================================ /// Padding par défaut static const double defaultPadding = 16.0; /// Padding petit static const double smallPadding = 8.0; /// Padding large static const double largePadding = 24.0; /// Padding extra large static const double extraLargePadding = 32.0; /// Rayon de bordure par défaut static const double defaultRadius = 8.0; /// Rayon de bordure petit static const double smallRadius = 4.0; /// Rayon de bordure large static const double largeRadius = 12.0; /// Rayon de bordure extra large static const double extraLargeRadius = 16.0; /// Hauteur de l'AppBar static const double appBarHeight = 56.0; /// Hauteur du BottomNavigationBar static const double bottomNavBarHeight = 60.0; /// Largeur maximale pour les écrans larges (tablettes, desktop) static const double maxContentWidth = 1200.0; // ============================================================================ // ANIMATIONS // ============================================================================ /// Durée d'animation par défaut static const Duration defaultAnimationDuration = Duration(milliseconds: 300); /// Durée d'animation rapide static const Duration fastAnimationDuration = Duration(milliseconds: 150); /// Durée d'animation lente static const Duration slowAnimationDuration = Duration(milliseconds: 500); // ============================================================================ // VALIDATION // ============================================================================ /// Longueur minimale du mot de passe static const int minPasswordLength = 8; /// Longueur maximale du mot de passe static const int maxPasswordLength = 128; /// Longueur minimale du nom static const int minNameLength = 2; /// Longueur maximale du nom static const int maxNameLength = 100; /// Longueur maximale de la description static const int maxDescriptionLength = 1000; /// Longueur maximale du titre static const int maxTitleLength = 200; // ============================================================================ // FORMATS // ============================================================================ /// Format de date par défaut (dd/MM/yyyy) static const String defaultDateFormat = 'dd/MM/yyyy'; /// Format de date et heure (dd/MM/yyyy HH:mm) static const String defaultDateTimeFormat = 'dd/MM/yyyy HH:mm'; /// Format de date court (dd/MM/yy) static const String shortDateFormat = 'dd/MM/yy'; /// Format de date long (EEEE dd MMMM yyyy) static const String longDateFormat = 'EEEE dd MMMM yyyy'; /// Format d'heure (HH:mm) static const String timeFormat = 'HH:mm'; /// Format d'heure avec secondes (HH:mm:ss) static const String timeWithSecondsFormat = 'HH:mm:ss'; // ============================================================================ // DEVISE // ============================================================================ /// Devise par défaut static const String defaultCurrency = 'EUR'; /// Symbole de la devise par défaut static const String defaultCurrencySymbol = '€'; // ============================================================================ // IMAGES // ============================================================================ /// Taille maximale d'upload d'image (en MB) static const int maxImageUploadSize = 5; /// Formats d'image acceptés static const List acceptedImageFormats = ['jpg', 'jpeg', 'png', 'gif', 'webp']; /// Qualité de compression d'image (0-100) static const int imageCompressionQuality = 85; // ============================================================================ // DOCUMENTS // ============================================================================ /// Taille maximale d'upload de document (en MB) static const int maxDocumentUploadSize = 10; /// Formats de document acceptés static const List acceptedDocumentFormats = ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'txt']; // ============================================================================ // NOTIFICATIONS // ============================================================================ /// Durée d'affichage des snackbars (en secondes) static const Duration snackbarDuration = Duration(seconds: 3); /// Durée d'affichage des snackbars d'erreur (en secondes) static const Duration errorSnackbarDuration = Duration(seconds: 5); /// Durée d'affichage des snackbars de succès (en secondes) static const Duration successSnackbarDuration = Duration(seconds: 2); // ============================================================================ // RECHERCHE // ============================================================================ /// Délai de debounce pour la recherche (en millisecondes) static const Duration searchDebounce = Duration(milliseconds: 500); /// Nombre minimum de caractères pour déclencher une recherche static const int minSearchLength = 2; // ============================================================================ // REFRESH // ============================================================================ /// Intervalle de rafraîchissement automatique (en minutes) static const Duration autoRefreshInterval = Duration(minutes: 5); // ============================================================================ // STORAGE KEYS // ============================================================================ /// Clé pour le token d'accès static const String accessTokenKey = 'access_token'; /// Clé pour le refresh token static const String refreshTokenKey = 'refresh_token'; /// Clé pour l'ID token static const String idTokenKey = 'id_token'; /// Clé pour les données utilisateur static const String userDataKey = 'user_data'; /// Clé pour les préférences de thème static const String themePreferenceKey = 'theme_preference'; /// Clé pour les préférences de langue static const String languagePreferenceKey = 'language_preference'; /// Clé pour le mode hors ligne static const String offlineModeKey = 'offline_mode'; // ============================================================================ // REGEX PATTERNS // ============================================================================ /// Pattern pour valider un email static const String emailPattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'; /// Pattern pour valider un numéro de téléphone français static const String phonePattern = r'^(?:(?:\+|00)33|0)\s*[1-9](?:[\s.-]*\d{2}){4}$'; /// Pattern pour valider un code postal français static const String postalCodePattern = r'^\d{5}$'; /// Pattern pour valider une URL static const String urlPattern = r'^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$'; // ============================================================================ // FEATURES FLAGS // ============================================================================ /// Activer le mode debug static const bool enableDebugMode = true; /// Activer les logs static const bool enableLogging = true; /// Activer le mode offline static const bool enableOfflineMode = false; /// Activer les analytics static const bool enableAnalytics = false; /// Activer le crash reporting static const bool enableCrashReporting = false; // ============================================================================ // APP INFO // ============================================================================ /// Nom de l'application static const String appName = 'UnionFlow'; /// Version de l'application static const String appVersion = '1.0.0'; /// Build number static const String buildNumber = '1'; /// Email de support static const String supportEmail = 'support@unionflow.com'; /// URL du site web static const String websiteUrl = 'https://unionflow.com'; /// URL des conditions d'utilisation static const String termsOfServiceUrl = 'https://unionflow.com/terms'; /// URL de la politique de confidentialité static const String privacyPolicyUrl = 'https://unionflow.com/privacy'; }