Clean project: remove test files, debug logs, and add documentation

This commit is contained in:
dahoud
2025-10-05 13:41:33 +00:00
parent 96a17eadbd
commit 291847924c
438 changed files with 65754 additions and 32713 deletions

View File

@@ -0,0 +1,125 @@
import 'package:flutter/material.dart';
import '../design_tokens.dart';
/// Header harmonisé UnionFlow
///
/// Composant header standardisé pour toutes les pages de l'application.
/// Garantit la cohérence visuelle et l'expérience utilisateur.
class UFHeader extends StatelessWidget {
final String title;
final String? subtitle;
final IconData icon;
final List<Widget>? actions;
final VoidCallback? onNotificationTap;
final VoidCallback? onSettingsTap;
final bool showActions;
const UFHeader({
super.key,
required this.title,
this.subtitle,
required this.icon,
this.actions,
this.onNotificationTap,
this.onSettingsTap,
this.showActions = true,
});
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(UnionFlowDesignTokens.spaceMD),
decoration: BoxDecoration(
gradient: UnionFlowDesignTokens.primaryGradient,
borderRadius: BorderRadius.circular(UnionFlowDesignTokens.radiusLG),
boxShadow: UnionFlowDesignTokens.shadowXL,
),
child: Row(
children: [
// Icône et contenu principal
Container(
padding: const EdgeInsets.all(UnionFlowDesignTokens.spaceSM),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(UnionFlowDesignTokens.radiusBase),
),
child: Icon(
icon,
color: UnionFlowDesignTokens.textOnPrimary,
size: 24,
),
),
const SizedBox(width: UnionFlowDesignTokens.spaceMD),
// Titre et sous-titre
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: UnionFlowDesignTokens.headingMD.copyWith(
color: UnionFlowDesignTokens.textOnPrimary,
),
),
if (subtitle != null) ...[
const SizedBox(height: UnionFlowDesignTokens.spaceXS),
Text(
subtitle!,
style: UnionFlowDesignTokens.bodySM.copyWith(
color: UnionFlowDesignTokens.textOnPrimary.withOpacity(0.8),
),
),
],
],
),
),
// Actions
if (showActions) _buildActions(),
],
),
);
}
Widget _buildActions() {
if (actions != null) {
return Row(children: actions!);
}
return Row(
children: [
if (onNotificationTap != null)
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(UnionFlowDesignTokens.radiusSM),
),
child: IconButton(
onPressed: onNotificationTap,
icon: const Icon(
Icons.notifications_outlined,
color: UnionFlowDesignTokens.textOnPrimary,
),
),
),
if (onNotificationTap != null && onSettingsTap != null)
const SizedBox(width: UnionFlowDesignTokens.spaceSM),
if (onSettingsTap != null)
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(UnionFlowDesignTokens.radiusSM),
),
child: IconButton(
onPressed: onSettingsTap,
icon: const Icon(
Icons.settings_outlined,
color: UnionFlowDesignTokens.textOnPrimary,
),
),
),
],
);
}
}

View File

@@ -0,0 +1,189 @@
import 'package:flutter/material.dart';
/// Design System UnionFlow - Tokens de design centralisés
///
/// Ce fichier centralise tous les tokens de design pour garantir
/// la cohérence visuelle dans toute l'application UnionFlow.
class UnionFlowDesignTokens {
// ==================== COULEURS ====================
/// Couleurs primaires
static const Color primaryColor = Color(0xFF6C5CE7);
static const Color primaryDark = Color(0xFF5A4FCF);
static const Color primaryLight = Color(0xFF8B7EE8);
/// Couleurs secondaires
static const Color secondaryColor = Color(0xFF0984E3);
static const Color secondaryDark = Color(0xFF0770C2);
static const Color secondaryLight = Color(0xFF3498E8);
/// Couleurs de statut
static const Color successColor = Color(0xFF00B894);
static const Color warningColor = Color(0xFFE17055);
static const Color errorColor = Color(0xFFE74C3C);
static const Color infoColor = Color(0xFF00CEC9);
/// Couleurs neutres
static const Color backgroundColor = Color(0xFFF8F9FA);
static const Color surfaceColor = Colors.white;
static const Color cardColor = Colors.white;
/// Couleurs de texte
static const Color textPrimary = Color(0xFF1F2937);
static const Color textSecondary = Color(0xFF6B7280);
static const Color textTertiary = Color(0xFF9CA3AF);
static const Color textOnPrimary = Colors.white;
/// Couleurs de bordure
static const Color borderLight = Color(0xFFE5E7EB);
static const Color borderMedium = Color(0xFFD1D5DB);
static const Color borderDark = Color(0xFF9CA3AF);
// ==================== TYPOGRAPHIE ====================
/// Tailles de police
static const double fontSizeXS = 10.0;
static const double fontSizeSM = 12.0;
static const double fontSizeBase = 14.0;
static const double fontSizeLG = 16.0;
static const double fontSizeXL = 18.0;
static const double fontSize2XL = 20.0;
static const double fontSize3XL = 24.0;
static const double fontSize4XL = 28.0;
/// Poids de police
static const FontWeight fontWeightNormal = FontWeight.w400;
static const FontWeight fontWeightMedium = FontWeight.w500;
static const FontWeight fontWeightSemiBold = FontWeight.w600;
static const FontWeight fontWeightBold = FontWeight.w700;
// ==================== ESPACEMENT ====================
/// Espacements
static const double spaceXS = 4.0;
static const double spaceSM = 8.0;
static const double spaceBase = 12.0;
static const double spaceMD = 16.0;
static const double spaceLG = 20.0;
static const double spaceXL = 24.0;
static const double space2XL = 32.0;
static const double space3XL = 48.0;
// ==================== RAYONS DE BORDURE ====================
/// Rayons de bordure
static const double radiusXS = 4.0;
static const double radiusSM = 8.0;
static const double radiusBase = 12.0;
static const double radiusLG = 16.0;
static const double radiusXL = 20.0;
static const double radiusFull = 999.0;
// ==================== OMBRES ====================
/// Ombres prédéfinies
static List<BoxShadow> get shadowSM => [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 5,
offset: const Offset(0, 1),
),
];
static List<BoxShadow> get shadowBase => [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
];
static List<BoxShadow> get shadowLG => [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 15,
offset: const Offset(0, 4),
),
];
static List<BoxShadow> get shadowXL => [
BoxShadow(
color: primaryColor.withOpacity(0.3),
blurRadius: 20,
offset: const Offset(0, 8),
),
];
// ==================== GRADIENTS ====================
/// Gradients prédéfinis
static const LinearGradient primaryGradient = LinearGradient(
colors: [primaryColor, primaryDark],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
);
static const LinearGradient secondaryGradient = LinearGradient(
colors: [secondaryColor, secondaryDark],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
);
// ==================== STYLES DE TEXTE ====================
/// Styles de texte prédéfinis
static const TextStyle headingXL = TextStyle(
fontSize: fontSize3XL,
fontWeight: fontWeightBold,
color: textPrimary,
height: 1.2,
);
static const TextStyle headingLG = TextStyle(
fontSize: fontSize2XL,
fontWeight: fontWeightBold,
color: textPrimary,
height: 1.3,
);
static const TextStyle headingMD = TextStyle(
fontSize: fontSizeXL,
fontWeight: fontWeightSemiBold,
color: textPrimary,
height: 1.4,
);
static const TextStyle bodySM = TextStyle(
fontSize: fontSizeSM,
fontWeight: fontWeightNormal,
color: textSecondary,
height: 1.5,
);
static const TextStyle bodyBase = TextStyle(
fontSize: fontSizeBase,
fontWeight: fontWeightNormal,
color: textPrimary,
height: 1.5,
);
static const TextStyle bodyLG = TextStyle(
fontSize: fontSizeLG,
fontWeight: fontWeightNormal,
color: textPrimary,
height: 1.5,
);
static const TextStyle caption = TextStyle(
fontSize: fontSizeXS,
fontWeight: fontWeightNormal,
color: textTertiary,
height: 1.4,
);
static const TextStyle buttonText = TextStyle(
fontSize: fontSizeBase,
fontWeight: fontWeightSemiBold,
color: textOnPrimary,
);
}

View File

@@ -78,7 +78,7 @@ class AppThemeSophisticated {
pageTransitionsTheme: _pageTransitionsTheme,
// Configuration des extensions
extensions: [
extensions: const [
_customColors,
_customSpacing,
],
@@ -117,7 +117,7 @@ class AppThemeSophisticated {
// Couleurs de surface
surface: ColorTokens.surface,
onSurface: ColorTokens.onSurface,
surfaceVariant: ColorTokens.surfaceVariant,
surfaceContainerHighest: ColorTokens.surfaceVariant,
onSurfaceVariant: ColorTokens.onSurfaceVariant,
// Couleurs de contour
@@ -184,7 +184,7 @@ class AppThemeSophisticated {
);
/// Configuration des cartes sophistiquées
static CardTheme _cardTheme = CardTheme(
static final CardTheme _cardTheme = CardTheme(
elevation: SpacingTokens.elevationSm,
shadowColor: ColorTokens.shadow,
surfaceTintColor: ColorTokens.surfaceContainer,
@@ -195,7 +195,7 @@ class AppThemeSophisticated {
);
/// Configuration des boutons élevés
static ElevatedButtonThemeData _elevatedButtonTheme = ElevatedButtonThemeData(
static final ElevatedButtonThemeData _elevatedButtonTheme = ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
elevation: SpacingTokens.elevationSm,
shadowColor: ColorTokens.shadow,
@@ -217,7 +217,7 @@ class AppThemeSophisticated {
);
/// Configuration des boutons remplis
static FilledButtonThemeData _filledButtonTheme = FilledButtonThemeData(
static final FilledButtonThemeData _filledButtonTheme = FilledButtonThemeData(
style: FilledButton.styleFrom(
backgroundColor: ColorTokens.primary,
foregroundColor: ColorTokens.onPrimary,
@@ -237,7 +237,7 @@ class AppThemeSophisticated {
);
/// Configuration des boutons avec contour
static OutlinedButtonThemeData _outlinedButtonTheme = OutlinedButtonThemeData(
static final OutlinedButtonThemeData _outlinedButtonTheme = OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: ColorTokens.primary,
textStyle: TypographyTokens.buttonMedium,
@@ -260,7 +260,7 @@ class AppThemeSophisticated {
);
/// Configuration des boutons texte
static TextButtonThemeData _textButtonTheme = TextButtonThemeData(
static final TextButtonThemeData _textButtonTheme = TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: ColorTokens.primary,
textStyle: TypographyTokens.buttonMedium,
@@ -279,7 +279,7 @@ class AppThemeSophisticated {
);
/// Configuration des champs de saisie
static InputDecorationTheme _inputDecorationTheme = InputDecorationTheme(
static final InputDecorationTheme _inputDecorationTheme = InputDecorationTheme(
filled: true,
fillColor: ColorTokens.surfaceContainer,
labelStyle: TypographyTokens.inputLabel,
@@ -304,7 +304,7 @@ class AppThemeSophisticated {
);
/// Configuration de la barre de navigation
static NavigationBarThemeData _navigationBarTheme = NavigationBarThemeData(
static final NavigationBarThemeData _navigationBarTheme = NavigationBarThemeData(
backgroundColor: ColorTokens.navigationBackground,
indicatorColor: ColorTokens.navigationIndicator,
labelTextStyle: WidgetStateProperty.resolveWith((states) {
@@ -322,7 +322,7 @@ class AppThemeSophisticated {
);
/// Configuration du drawer de navigation
static NavigationDrawerThemeData _navigationDrawerTheme = NavigationDrawerThemeData(
static final NavigationDrawerThemeData _navigationDrawerTheme = NavigationDrawerThemeData(
backgroundColor: ColorTokens.surfaceContainer,
elevation: SpacingTokens.elevationMd,
shadowColor: ColorTokens.shadow,
@@ -337,7 +337,7 @@ class AppThemeSophisticated {
);
/// Configuration des dialogues
static DialogTheme _dialogTheme = DialogTheme(
static final DialogTheme _dialogTheme = DialogTheme(
backgroundColor: ColorTokens.surfaceContainer,
elevation: SpacingTokens.elevationLg,
shadowColor: ColorTokens.shadow,
@@ -350,7 +350,7 @@ class AppThemeSophisticated {
);
/// Configuration des snackbars
static SnackBarThemeData _snackBarTheme = SnackBarThemeData(
static final SnackBarThemeData _snackBarTheme = SnackBarThemeData(
backgroundColor: ColorTokens.onSurface,
contentTextStyle: TypographyTokens.bodyMedium.copyWith(
color: ColorTokens.surface,
@@ -362,7 +362,7 @@ class AppThemeSophisticated {
);
/// Configuration des puces
static ChipThemeData _chipTheme = ChipThemeData(
static final ChipThemeData _chipTheme = ChipThemeData(
backgroundColor: ColorTokens.surfaceVariant,
selectedColor: ColorTokens.primaryContainer,
labelStyle: TypographyTokens.labelMedium,
@@ -376,8 +376,8 @@ class AppThemeSophisticated {
);
/// Configuration des éléments de liste
static ListTileThemeData _listTileTheme = ListTileThemeData(
contentPadding: const EdgeInsets.symmetric(
static const ListTileThemeData _listTileTheme = ListTileThemeData(
contentPadding: EdgeInsets.symmetric(
horizontal: SpacingTokens.xl,
vertical: SpacingTokens.md,
),
@@ -388,7 +388,7 @@ class AppThemeSophisticated {
);
/// Configuration des onglets
static TabBarTheme _tabBarTheme = TabBarTheme(
static final TabBarTheme _tabBarTheme = TabBarTheme(
labelColor: ColorTokens.primary,
unselectedLabelColor: ColorTokens.onSurfaceVariant,
labelStyle: TypographyTokens.titleSmall,
@@ -403,20 +403,20 @@ class AppThemeSophisticated {
);
/// Configuration des dividers
static DividerThemeData _dividerTheme = DividerThemeData(
static const DividerThemeData _dividerTheme = DividerThemeData(
color: ColorTokens.outline,
thickness: 1.0,
space: SpacingTokens.md,
);
/// Configuration des icônes
static IconThemeData _iconTheme = IconThemeData(
static const IconThemeData _iconTheme = IconThemeData(
color: ColorTokens.onSurfaceVariant,
size: 24.0,
);
/// Configuration des transitions de page
static PageTransitionsTheme _pageTransitionsTheme = PageTransitionsTheme(
static const PageTransitionsTheme _pageTransitionsTheme = PageTransitionsTheme(
builders: {
TargetPlatform.android: CupertinoPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
@@ -424,10 +424,10 @@ class AppThemeSophisticated {
);
/// Extensions personnalisées - Couleurs
static CustomColors _customColors = CustomColors();
static const CustomColors _customColors = CustomColors();
/// Extensions personnalisées - Espacements
static CustomSpacing _customSpacing = CustomSpacing();
static const CustomSpacing _customSpacing = CustomSpacing();
}
/// Extension de couleurs personnalisées