526 lines
18 KiB
Dart
526 lines
18 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'app_colors.dart';
|
|
import 'app_theme_extension.dart';
|
|
|
|
/// Application Theme Configuration
|
|
class AppTheme {
|
|
static ThemeData get lightTheme {
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.light,
|
|
colorScheme: ColorScheme.fromSeed(
|
|
seedColor: AppColors.primaryTeal,
|
|
brightness: Brightness.light,
|
|
primary: AppColors.primaryTeal,
|
|
onPrimary: Colors.white,
|
|
secondary: AppColors.primaryOrange,
|
|
onSecondary: Colors.white,
|
|
surface: LightColors.surface,
|
|
onSurface: LightColors.textPrimary,
|
|
onSurfaceVariant: LightColors.textSecondary,
|
|
surfaceContainerHighest: LightColors.surfaceVariant,
|
|
background: LightColors.background,
|
|
error: AppColors.error,
|
|
),
|
|
scaffoldBackgroundColor: LightColors.background,
|
|
extensions: [AppThemeExtras.light],
|
|
|
|
// App Bar Theme
|
|
appBarTheme: const AppBarTheme(
|
|
backgroundColor: LightColors.surface,
|
|
foregroundColor: LightColors.textPrimary,
|
|
elevation: 0,
|
|
centerTitle: true,
|
|
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
|
titleTextStyle: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
|
|
// Card Theme
|
|
cardTheme: CardThemeData(
|
|
color: LightColors.cardBackground,
|
|
elevation: 2,
|
|
shadowColor: Colors.black.withOpacity(0.08),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
),
|
|
|
|
// Elevated Button Theme
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: LightColors.buttonPrimary,
|
|
foregroundColor: Colors.white,
|
|
elevation: 2,
|
|
shadowColor: AppColors.primaryTeal.withOpacity(0.3),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
|
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
|
|
// Outlined Button Theme
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
foregroundColor: AppColors.primaryTeal,
|
|
side: BorderSide(color: AppColors.primaryTeal.withOpacity(0.3)),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
|
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
|
|
// Text Button Theme
|
|
textButtonTheme: TextButtonThemeData(
|
|
style: TextButton.styleFrom(
|
|
foregroundColor: AppColors.primaryTeal,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
textStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
|
|
// Input Field Theme
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: LightColors.surface,
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide(color: AppColors.primaryTeal.withOpacity(0.3)),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide(color: AppColors.primaryTeal.withOpacity(0.3)),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: const BorderSide(color: AppColors.primaryTeal, width: 2),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: const BorderSide(color: AppColors.error),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 12,
|
|
),
|
|
hintStyle: const TextStyle(color: LightColors.textHint, fontSize: 14),
|
|
labelStyle: const TextStyle(
|
|
color: LightColors.textSecondary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
|
|
// Text Field Theme
|
|
textSelectionTheme: TextSelectionThemeData(
|
|
cursorColor: AppColors.primaryTeal,
|
|
selectionColor: AppColors.primaryTeal.withOpacity(0.3),
|
|
selectionHandleColor: AppColors.primaryTeal,
|
|
),
|
|
|
|
// Text Theme
|
|
textTheme: const TextTheme(
|
|
displayLarge: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
displayMedium: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 28,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
displaySmall: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
headlineLarge: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
headlineMedium: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
headlineSmall: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleLarge: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleMedium: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleSmall: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
bodyLarge: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
bodyMedium: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
bodySmall: TextStyle(
|
|
color: LightColors.textSecondary,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
labelLarge: TextStyle(
|
|
color: LightColors.textPrimary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
labelMedium: TextStyle(
|
|
color: LightColors.textSecondary,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
labelSmall: TextStyle(
|
|
color: LightColors.textHint,
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
|
|
// Bottom Navigation Bar Theme
|
|
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
|
|
backgroundColor: LightColors.surface,
|
|
selectedItemColor: AppColors.primaryTeal,
|
|
unselectedItemColor: LightColors.iconInactive,
|
|
type: BottomNavigationBarType.fixed,
|
|
elevation: 8,
|
|
selectedLabelStyle: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
unselectedLabelStyle: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
),
|
|
|
|
// Floating Action Button Theme
|
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
|
backgroundColor: AppColors.primaryTeal,
|
|
foregroundColor: Colors.white,
|
|
elevation: 4,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
),
|
|
|
|
// Divider Theme
|
|
dividerTheme: const DividerThemeData(
|
|
color: LightColors.divider,
|
|
thickness: 1,
|
|
space: 1,
|
|
),
|
|
|
|
// Icon Theme
|
|
iconTheme: const IconThemeData(color: LightColors.iconActive, size: 24),
|
|
|
|
// Progress Indicator Theme
|
|
progressIndicatorTheme: const ProgressIndicatorThemeData(
|
|
color: AppColors.primaryTeal,
|
|
linearTrackColor: LightColors.buttonSecondary,
|
|
circularTrackColor: LightColors.buttonSecondary,
|
|
),
|
|
|
|
// Chip Theme
|
|
chipTheme: ChipThemeData(
|
|
backgroundColor: LightColors.buttonSecondary,
|
|
selectedColor: AppColors.primaryTeal.withOpacity(0.1),
|
|
disabledColor: LightColors.buttonSecondary.withOpacity(0.5),
|
|
labelStyle: const TextStyle(color: LightColors.textPrimary),
|
|
secondaryLabelStyle: const TextStyle(color: LightColors.textPrimary),
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
),
|
|
);
|
|
}
|
|
|
|
static ThemeData get darkTheme {
|
|
return ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
colorScheme: ColorScheme.dark(
|
|
primary: DarkBrandColors.primaryTeal,
|
|
onPrimary: Colors.white,
|
|
secondary: DarkBrandColors.primaryOrange,
|
|
onSecondary: Colors.white,
|
|
surface: DarkColors.surface,
|
|
onSurface: DarkColors.textPrimary,
|
|
onSurfaceVariant: DarkColors.textSecondary,
|
|
surfaceContainerHighest: DarkColors.surfaceVariant,
|
|
surfaceContainerLow: DarkColors.background,
|
|
background: DarkColors.background,
|
|
error: AppColors.error,
|
|
outline: DarkColors.border,
|
|
),
|
|
scaffoldBackgroundColor: DarkColors.background,
|
|
extensions: [AppThemeExtras.dark],
|
|
appBarTheme: const AppBarTheme(
|
|
backgroundColor: DarkColors.surface,
|
|
foregroundColor: DarkColors.textPrimary,
|
|
elevation: 0,
|
|
centerTitle: true,
|
|
systemOverlayStyle: SystemUiOverlayStyle.light,
|
|
titleTextStyle: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
|
|
cardTheme: CardThemeData(
|
|
color: DarkColors.cardBackground,
|
|
elevation: 2,
|
|
shadowColor: Colors.black.withOpacity(0.3),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
|
),
|
|
|
|
// Elevated Button Theme for Dark Mode
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: DarkColors.buttonPrimary,
|
|
foregroundColor: Colors.white,
|
|
elevation: 2,
|
|
shadowColor: DarkBrandColors.primaryTeal.withOpacity(0.3),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
|
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
|
|
// Outlined Button Theme for Dark Mode
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
foregroundColor: DarkBrandColors.primaryTeal,
|
|
side: BorderSide(
|
|
color: DarkBrandColors.primaryTeal.withOpacity(0.3),
|
|
),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
|
|
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
|
|
// Text Button Theme for Dark Mode
|
|
textButtonTheme: TextButtonThemeData(
|
|
style: TextButton.styleFrom(
|
|
foregroundColor: DarkBrandColors.primaryTeal,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
textStyle: const TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
|
|
// Input Field Theme for Dark Mode
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: DarkColors.surface,
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide(
|
|
color: DarkBrandColors.primaryTeal.withOpacity(0.3),
|
|
),
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: BorderSide(
|
|
color: DarkBrandColors.primaryTeal.withOpacity(0.3),
|
|
),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: const BorderSide(
|
|
color: DarkBrandColors.primaryTeal,
|
|
width: 2,
|
|
),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
borderSide: const BorderSide(color: AppColors.error),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 12,
|
|
),
|
|
hintStyle: const TextStyle(
|
|
color: DarkColors.textSecondary,
|
|
fontSize: 14,
|
|
),
|
|
labelStyle: const TextStyle(
|
|
color: DarkColors.textSecondary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
|
|
// Text Field Theme for Dark Mode
|
|
textSelectionTheme: TextSelectionThemeData(
|
|
cursorColor: DarkBrandColors.primaryTeal,
|
|
selectionColor: DarkBrandColors.primaryTeal.withOpacity(0.3),
|
|
selectionHandleColor: DarkBrandColors.primaryTeal,
|
|
),
|
|
|
|
textTheme: const TextTheme(
|
|
displayLarge: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 32,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
displayMedium: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 28,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
displaySmall: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
headlineLarge: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
headlineMedium: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
headlineSmall: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleLarge: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleMedium: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
titleSmall: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
bodyLarge: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
bodyMedium: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
bodySmall: TextStyle(
|
|
color: DarkColors.textSecondary,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
labelLarge: TextStyle(
|
|
color: DarkColors.textPrimary,
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
labelMedium: TextStyle(
|
|
color: DarkColors.textSecondary,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
labelSmall: TextStyle(
|
|
color: DarkColors.textSecondary,
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w500,
|
|
),
|
|
),
|
|
|
|
// Bottom Navigation Bar Theme for Dark Mode
|
|
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
|
|
backgroundColor: DarkColors.surface,
|
|
selectedItemColor: DarkBrandColors.primaryTeal,
|
|
unselectedItemColor: DarkColors.iconInactive,
|
|
type: BottomNavigationBarType.fixed,
|
|
elevation: 8,
|
|
selectedLabelStyle: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
unselectedLabelStyle: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
),
|
|
|
|
// Floating Action Button Theme for Dark Mode
|
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
|
backgroundColor: DarkBrandColors.primaryTeal,
|
|
foregroundColor: Colors.white,
|
|
elevation: 4,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
),
|
|
|
|
// Divider Theme for Dark Mode
|
|
dividerTheme: const DividerThemeData(
|
|
color: DarkColors.divider,
|
|
thickness: 1,
|
|
space: 1,
|
|
),
|
|
|
|
// Icon Theme for Dark Mode
|
|
iconTheme: const IconThemeData(color: DarkColors.iconActive, size: 24),
|
|
|
|
// Progress Indicator Theme for Dark Mode
|
|
progressIndicatorTheme: const ProgressIndicatorThemeData(
|
|
color: DarkBrandColors.primaryTeal,
|
|
linearTrackColor: DarkColors.buttonSecondary,
|
|
circularTrackColor: DarkColors.buttonSecondary,
|
|
),
|
|
|
|
// Chip Theme for Dark Mode
|
|
chipTheme: ChipThemeData(
|
|
backgroundColor: DarkColors.buttonSecondary,
|
|
selectedColor: DarkBrandColors.primaryTeal.withOpacity(0.1),
|
|
disabledColor: DarkColors.buttonSecondary.withOpacity(0.5),
|
|
labelStyle: const TextStyle(color: DarkColors.textPrimary),
|
|
secondaryLabelStyle: const TextStyle(color: DarkColors.textPrimary),
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
),
|
|
);
|
|
}
|
|
}
|