import 'package:flutter/material.dart'; /// Thème noir & blanc épuré, avec une seule couleur d'accent. /// Vert émeraude pour évoquer les points / gains (et se distinguer de l'app /// sœur « Gestion Prix » qui utilise le bleu, sur la même tablette). /// Change [accent] pour ajuster la touche de couleur de toute l'app. class AppTheme { static const Color accent = Color(0xFF12805C); // vert émeraude static const Color noir = Color(0xFF111114); static const Color grisTexte = Color(0xFF6B6B72); static ThemeData clair() { final scheme = ColorScheme.fromSeed( seedColor: accent, brightness: Brightness.light, ).copyWith( primary: noir, onPrimary: Colors.white, secondary: accent, surface: Colors.white, onSurface: noir, ); return _base(scheme, const Color(0xFFF6F6F7)); } static ThemeData sombre() { final scheme = ColorScheme.fromSeed( seedColor: accent, brightness: Brightness.dark, ).copyWith( primary: Colors.white, onPrimary: noir, secondary: accent, ); return _base(scheme, const Color(0xFF0E0E11)); } static ThemeData _base(ColorScheme scheme, Color fond) { final base = ThemeData( useMaterial3: true, colorScheme: scheme, scaffoldBackgroundColor: fond, fontFamily: 'Roboto', ); return base.copyWith( appBarTheme: AppBarTheme( backgroundColor: fond, foregroundColor: scheme.onSurface, elevation: 0, centerTitle: false, titleTextStyle: TextStyle( color: scheme.onSurface, fontSize: 24, fontWeight: FontWeight.w700, letterSpacing: -0.5, ), ), cardTheme: CardThemeData( elevation: 0, color: scheme.surface, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(16), side: BorderSide(color: scheme.outlineVariant.withValues(alpha: 0.5)), ), margin: EdgeInsets.zero, ), filledButtonTheme: FilledButtonThemeData( style: FilledButton.styleFrom( backgroundColor: scheme.primary, foregroundColor: scheme.onPrimary, minimumSize: const Size.fromHeight(52), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(14), ), textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600), ), ), inputDecorationTheme: InputDecorationTheme( filled: true, fillColor: scheme.surface, border: OutlineInputBorder( borderRadius: BorderRadius.circular(14), borderSide: BorderSide(color: scheme.outlineVariant), ), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(14), borderSide: BorderSide(color: scheme.outlineVariant), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.circular(14), borderSide: const BorderSide(color: accent, width: 2), ), ), navigationBarTheme: NavigationBarThemeData( backgroundColor: scheme.surface, indicatorColor: accent.withValues(alpha: 0.14), elevation: 0, labelTextStyle: WidgetStateProperty.resolveWith((states) { final selected = states.contains(WidgetState.selected); return TextStyle( fontSize: 12, fontWeight: selected ? FontWeight.w700 : FontWeight.w500, color: selected ? scheme.onSurface : grisTexte, ); }), iconTheme: WidgetStateProperty.resolveWith((states) { final selected = states.contains(WidgetState.selected); return IconThemeData( color: selected ? accent : grisTexte, ); }), ), ); } }