feat(shared): legacy presentation/ + shared design system + widgets
- lib/presentation : pages legacy (explore/network, notifications) avec BLoC - lib/shared/design_system : UnionFlow Design System v2 (tokens, components) + MD3 tokens + module_colors par feature - lib/shared/widgets : widgets transversaux (core_card, core_shimmer, error_widget, loading_widget, powered_by_lions_dev, etc.) - lib/shared/constants + utils
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'tokens/color_tokens.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
/// Gestionnaire de thèmes personnalisables pour le Dashboard
|
||||
class DashboardThemeManager {
|
||||
static const String _themeKey = 'dashboard_theme';
|
||||
static DashboardThemeData _currentTheme = DashboardThemeData.royalTeal();
|
||||
static DashboardThemeData _currentTheme = DashboardThemeData.unionFlow();
|
||||
static SharedPreferences? _prefs;
|
||||
|
||||
|
||||
/// Initialise le gestionnaire de thèmes
|
||||
static Future<void> initialize() async {
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
await _loadSavedTheme();
|
||||
}
|
||||
|
||||
|
||||
/// Charge le thème sauvegardé
|
||||
static Future<void> _loadSavedTheme() async {
|
||||
final themeName = _prefs?.getString(_themeKey) ?? 'royalTeal';
|
||||
final themeName = _prefs?.getString(_themeKey) ?? 'unionFlow';
|
||||
_currentTheme = _getThemeByName(themeName);
|
||||
}
|
||||
|
||||
@@ -31,6 +32,8 @@ class DashboardThemeManager {
|
||||
/// Obtient un thème par son nom
|
||||
static DashboardThemeData _getThemeByName(String name) {
|
||||
switch (name) {
|
||||
case 'unionFlow':
|
||||
return DashboardThemeData.unionFlow();
|
||||
case 'royalTeal':
|
||||
return DashboardThemeData.royalTeal();
|
||||
case 'oceanBlue':
|
||||
@@ -44,12 +47,13 @@ class DashboardThemeManager {
|
||||
case 'darkMode':
|
||||
return DashboardThemeData.darkMode();
|
||||
default:
|
||||
return DashboardThemeData.royalTeal();
|
||||
return DashboardThemeData.unionFlow();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Obtient la liste des thèmes disponibles
|
||||
static List<ThemeOption> get availableThemes => [
|
||||
ThemeOption('unionFlow', 'UnionFlow (défaut)', DashboardThemeData.unionFlow()),
|
||||
ThemeOption('royalTeal', 'Bleu Roi & Pétrole', DashboardThemeData.royalTeal()),
|
||||
ThemeOption('oceanBlue', 'Bleu Océan', DashboardThemeData.oceanBlue()),
|
||||
ThemeOption('forestGreen', 'Vert Forêt', DashboardThemeData.forestGreen()),
|
||||
@@ -108,7 +112,29 @@ class DashboardThemeData {
|
||||
this.isDark = false,
|
||||
});
|
||||
|
||||
/// Thème Bleu Roi & Pétrole (par défaut)
|
||||
/// Thème UnionFlow officiel — Bleu #297FFF → Violet #7616E8 (logo signature)
|
||||
factory DashboardThemeData.unionFlow() {
|
||||
return const DashboardThemeData(
|
||||
name: 'UnionFlow',
|
||||
primaryColor: Color(0xFF297FFF),
|
||||
secondaryColor: Color(0xFF7616E8),
|
||||
primaryLight: Color(0xFF69B7FF),
|
||||
primaryDark: Color(0xFF2170E7),
|
||||
secondaryLight: Color(0xFF9B59F0),
|
||||
secondaryDark: Color(0xFF5B0FBA),
|
||||
backgroundColor: Color(0xFFF5F8FF),
|
||||
surfaceColor: Color(0xFFFFFFFF),
|
||||
cardColor: Color(0xFFFFFFFF),
|
||||
textPrimary: Color(0xFF111827),
|
||||
textSecondary: Color(0xFF6B7280),
|
||||
success: Color(0xFF22C55E),
|
||||
warning: Color(0xFFF59E0B),
|
||||
error: Color(0xFFEF4444),
|
||||
info: Color(0xFF297FFF),
|
||||
);
|
||||
}
|
||||
|
||||
/// Thème Bleu Roi & Pétrole
|
||||
factory DashboardThemeData.royalTeal() {
|
||||
return const DashboardThemeData(
|
||||
name: 'Bleu Roi & Pétrole',
|
||||
@@ -123,7 +149,7 @@ class DashboardThemeData {
|
||||
cardColor: Color(0xFFFFFFFF),
|
||||
textPrimary: Color(0xFF111827),
|
||||
textSecondary: Color(0xFF6B7280),
|
||||
success: Color(0xFF10B981),
|
||||
success: ColorTokens.successLight,
|
||||
warning: Color(0xFFF59E0B),
|
||||
error: Color(0xFFEF4444),
|
||||
info: Color(0xFF3B82F6),
|
||||
@@ -158,7 +184,7 @@ class DashboardThemeData {
|
||||
name: 'Vert Forêt',
|
||||
primaryColor: Color(0xFF059669),
|
||||
secondaryColor: Color(0xFF047857),
|
||||
primaryLight: Color(0xFF10B981),
|
||||
primaryLight: ColorTokens.successLight,
|
||||
primaryDark: Color(0xFF065F46),
|
||||
secondaryLight: Color(0xFF059669),
|
||||
secondaryDark: Color(0xFF064E3B),
|
||||
@@ -167,7 +193,7 @@ class DashboardThemeData {
|
||||
cardColor: Color(0xFFFFFFFF),
|
||||
textPrimary: Color(0xFF064E3B),
|
||||
textSecondary: Color(0xFF6B7280),
|
||||
success: Color(0xFF10B981),
|
||||
success: ColorTokens.successLight,
|
||||
warning: Color(0xFFF59E0B),
|
||||
error: Color(0xFFEF4444),
|
||||
info: Color(0xFF3B82F6),
|
||||
@@ -227,7 +253,7 @@ class DashboardThemeData {
|
||||
primaryLight: Color(0xFF93C5FD),
|
||||
primaryDark: Color(0xFF3B82F6),
|
||||
secondaryLight: Color(0xFF6EE7B7),
|
||||
secondaryDark: Color(0xFF10B981),
|
||||
secondaryDark: ColorTokens.successLight,
|
||||
backgroundColor: Color(0xFF111827),
|
||||
surfaceColor: Color(0xFF1F2937),
|
||||
cardColor: Color(0xFF374151),
|
||||
|
||||
Reference in New Issue
Block a user