43 lines
1.4 KiB
Dart
43 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Thèmes Material 3 (clair + sombre) avec un accent unifié.
|
|
class AppTheme {
|
|
static const _seed = Color(0xFF5E5CE6);
|
|
|
|
static ThemeData light() => _base(Brightness.light);
|
|
static ThemeData dark() => _base(Brightness.dark);
|
|
|
|
static ThemeData _base(Brightness brightness) {
|
|
final scheme = ColorScheme.fromSeed(seedColor: _seed, brightness: brightness);
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
colorScheme: scheme,
|
|
scaffoldBackgroundColor: scheme.surface,
|
|
appBarTheme: AppBarTheme(
|
|
backgroundColor: scheme.surface,
|
|
foregroundColor: scheme.onSurface,
|
|
centerTitle: false,
|
|
elevation: 0,
|
|
titleTextStyle: TextStyle(
|
|
color: scheme.onSurface,
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.w800,
|
|
letterSpacing: -0.5,
|
|
),
|
|
),
|
|
cardTheme: CardThemeData(
|
|
clipBehavior: Clip.antiAlias,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(22)),
|
|
elevation: 0,
|
|
),
|
|
filledButtonTheme: FilledButtonThemeData(
|
|
style: FilledButton.styleFrom(
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 14),
|
|
textStyle: const TextStyle(fontWeight: FontWeight.w700, fontSize: 15),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|