feat(init): mise en place initiale de P'titsPas - Documentation: CDC complet, sécifications techniques SSS-001, charte graphique, évolutions - Backend: structure NestJS avec controllers/services/routes, config Prisma - Frontend: app Flutter avec structure MVC, thème et Firebase - Changement de nom: SuperNounou devient P'titsPas
This commit is contained in:
@@ -1,49 +1,86 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class AppTheme {
|
||||
static const Color primaryColor = Color(0xFF2B6CB0);
|
||||
static const Color secondaryColor = Color(0xFFF7FAFC);
|
||||
static const Color backgroundColor = Colors.white;
|
||||
static const Color textColor = Color(0xFF2D3748);
|
||||
enum ThemeType {
|
||||
defaultTheme,
|
||||
pastelTheme,
|
||||
// Ajouter d'autres thèmes ici
|
||||
}
|
||||
|
||||
static ThemeData get lightTheme {
|
||||
class AppTheme extends ChangeNotifier {
|
||||
static final AppTheme _instance = AppTheme._internal();
|
||||
factory AppTheme() => _instance;
|
||||
AppTheme._internal();
|
||||
|
||||
// Thème par défaut (P'titsPas)
|
||||
static const Color _defaultPrimaryColor = Color(0xFF2B6CB0);
|
||||
static const Color _defaultSecondaryColor = Color(0xFFF7FAFC);
|
||||
static const Color _defaultBackgroundColor = Color(0xFFFFFFFF);
|
||||
static const Color _defaultTextColor = Color(0xFF000000);
|
||||
static const Color _defaultErrorColor = Color(0xFFF4A28C);
|
||||
static const Color _defaultWarningColor = Color(0xFFF2D269);
|
||||
static const Color _defaultSuccessColor = Color(0xFF4CAF50);
|
||||
|
||||
// Thème Pastel
|
||||
static const Color _pastelPrimaryColor = Color(0xFF8AD0C8); // Turquoise
|
||||
static const Color _pastelSecondaryColor = Color(0xFFC6A3D8); // Violet Pastel
|
||||
static const Color _pastelBackgroundColor = Color(0xFFFFFEF9); // Ivoire BG
|
||||
static const Color _pastelTextColor = Color(0xFF2F2F2F); // Encre
|
||||
static const Color _pastelErrorColor = Color(0xFFFFB4AB); // Rose Pastel
|
||||
static const Color _pastelWarningColor = Color(0xFFFFE4B5); // Jaune Pastel
|
||||
static const Color _pastelSuccessColor = Color(0xFFA5D6A7); // Vert Pastel
|
||||
|
||||
// Configuration du thème actuel
|
||||
ThemeType _currentTheme = ThemeType.defaultTheme;
|
||||
ThemeType get currentTheme => _currentTheme;
|
||||
|
||||
// Getters pour les couleurs du thème actuel
|
||||
Color get primaryColor => _currentTheme == ThemeType.defaultTheme ? _defaultPrimaryColor : _pastelPrimaryColor;
|
||||
Color get secondaryColor => _currentTheme == ThemeType.defaultTheme ? _defaultSecondaryColor : _pastelSecondaryColor;
|
||||
Color get backgroundColor => _currentTheme == ThemeType.defaultTheme ? _defaultBackgroundColor : _pastelBackgroundColor;
|
||||
Color get textColor => _currentTheme == ThemeType.defaultTheme ? _defaultTextColor : _pastelTextColor;
|
||||
Color get errorColor => _currentTheme == ThemeType.defaultTheme ? _defaultErrorColor : _pastelErrorColor;
|
||||
Color get warningColor => _currentTheme == ThemeType.defaultTheme ? _defaultWarningColor : _pastelWarningColor;
|
||||
Color get successColor => _currentTheme == ThemeType.defaultTheme ? _defaultSuccessColor : _pastelSuccessColor;
|
||||
|
||||
// Méthode pour changer de thème
|
||||
void setTheme(ThemeType theme) {
|
||||
_currentTheme = theme;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Thème Material 3
|
||||
ThemeData get lightTheme {
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.light(
|
||||
primary: primaryColor,
|
||||
secondary: secondaryColor,
|
||||
background: backgroundColor,
|
||||
error: errorColor,
|
||||
tertiary: warningColor,
|
||||
onPrimary: Colors.white,
|
||||
onSecondary: Colors.white,
|
||||
onBackground: textColor,
|
||||
onError: Colors.white,
|
||||
onTertiary: textColor,
|
||||
),
|
||||
scaffoldBackgroundColor: backgroundColor,
|
||||
textTheme: TextTheme(
|
||||
displayLarge: GoogleFonts.comfortaa(
|
||||
fontSize: 32,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: textColor,
|
||||
),
|
||||
displayMedium: GoogleFonts.comfortaa(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: textColor,
|
||||
),
|
||||
bodyLarge: GoogleFonts.roboto(
|
||||
fontSize: 16,
|
||||
color: textColor,
|
||||
),
|
||||
bodyMedium: GoogleFonts.roboto(
|
||||
fontSize: 14,
|
||||
color: textColor,
|
||||
),
|
||||
displayLarge: _getTitleStyle(32),
|
||||
displayMedium: _getTitleStyle(28),
|
||||
displaySmall: _getTitleStyle(24),
|
||||
headlineMedium: _getTitleStyle(20),
|
||||
headlineSmall: _getTitleStyle(18),
|
||||
titleLarge: _getTitleStyle(16),
|
||||
bodyLarge: _getBodyStyle(16),
|
||||
bodyMedium: _getBodyStyle(14),
|
||||
bodySmall: _getBodyStyle(12),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
titleTextStyle: GoogleFonts.comfortaa(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
titleTextStyle: _getTitleStyle(20).copyWith(color: Colors.white),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
@@ -56,19 +93,43 @@ class AppTheme {
|
||||
),
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
filled: true,
|
||||
fillColor: secondaryColor.withOpacity(0.5),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: primaryColor.withOpacity(0.5)),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: primaryColor.withOpacity(0.3)),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: primaryColor),
|
||||
borderSide: BorderSide(color: primaryColor, width: 2),
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
),
|
||||
snackBarTheme: SnackBarThemeData(
|
||||
backgroundColor: errorColor,
|
||||
contentTextStyle: _getBodyStyle(14).copyWith(color: Colors.white),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Méthodes privées pour la typographie
|
||||
TextStyle _getTitleStyle(double fontSize) {
|
||||
return GoogleFonts.merienda(
|
||||
fontSize: fontSize,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: textColor,
|
||||
);
|
||||
}
|
||||
|
||||
TextStyle _getBodyStyle(double fontSize) {
|
||||
return GoogleFonts.merriweather(
|
||||
fontSize: fontSize,
|
||||
fontWeight: FontWeight.w300,
|
||||
color: textColor,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user