122 lines
4.1 KiB
Dart
122 lines
4.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class AppTheme {
|
|
// Nouvelles couleurs du thème
|
|
static const Color primaryColor = Color(0xFF2E4057); // Bleu foncé/gris
|
|
static const Color secondaryColor = Color(0xFF048BA8); // Bleu turquoise
|
|
static const Color accentColor = Color(0xFFF18F01); // Orange
|
|
static const Color backgroundLightColor = Color(0xFFF9FAFB);
|
|
static const Color backgroundDarkColor = Color(0xFF111827);
|
|
static const Color textLightColor = Color(0xFF1F2937);
|
|
static const Color textDarkColor = Color(0xFFF9FAFB);
|
|
|
|
// Thème clair
|
|
static ThemeData get lightTheme {
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.light,
|
|
colorScheme: ColorScheme.light(
|
|
primary: primaryColor,
|
|
secondary: secondaryColor,
|
|
tertiary: accentColor,
|
|
background: backgroundLightColor,
|
|
surface: Colors.white,
|
|
onPrimary: Colors.white,
|
|
onSecondary: Colors.white,
|
|
onBackground: textLightColor,
|
|
onSurface: textLightColor,
|
|
),
|
|
textTheme: GoogleFonts.poppinsTextTheme(ThemeData.light().textTheme),
|
|
appBarTheme: const AppBarTheme(
|
|
backgroundColor: primaryColor,
|
|
foregroundColor: Colors.white,
|
|
elevation: 0,
|
|
),
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: primaryColor,
|
|
foregroundColor: Colors.white,
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
),
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: Colors.grey[100],
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: const BorderSide(color: primaryColor, width: 2),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
),
|
|
cardTheme: CardTheme(
|
|
elevation: 2,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
// Thème sombre
|
|
static ThemeData get darkTheme {
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
colorScheme: ColorScheme.dark(
|
|
primary: primaryColor,
|
|
secondary: secondaryColor,
|
|
tertiary: accentColor,
|
|
background: backgroundDarkColor,
|
|
surface: const Color(0xFF1F2937),
|
|
onPrimary: Colors.white,
|
|
onSecondary: Colors.white,
|
|
onBackground: textDarkColor,
|
|
onSurface: textDarkColor,
|
|
),
|
|
textTheme: GoogleFonts.poppinsTextTheme(ThemeData.dark().textTheme),
|
|
appBarTheme: const AppBarTheme(
|
|
backgroundColor: Color(0xFF1F2937),
|
|
foregroundColor: Colors.white,
|
|
elevation: 0,
|
|
),
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: primaryColor,
|
|
foregroundColor: Colors.white,
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
),
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: const Color(0xFF374151),
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: const BorderSide(color: primaryColor, width: 2),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
|
),
|
|
cardTheme: CardTheme(
|
|
elevation: 4,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
color: const Color(0xFF1F2937),
|
|
),
|
|
);
|
|
}
|
|
} |