darkTheme static method
Implementation
static ThemeData darkTheme() {
final TextTheme textTheme = AppTextThemes.getTheme(_fontFamily).apply(
bodyColor: Colors.white,
displayColor: Colors.white,
);
return ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
primaryColor: AppColors.primary,
colorScheme: ColorScheme.dark(
primary: AppColors.primary,
secondary: AppColors.accent,
error: AppColors.error,
background: AppColors.darkBackground,
surface: AppColors.darkSurface,
),
scaffoldBackgroundColor: AppColors.darkBackground,
textTheme: textTheme,
appBarTheme: AppBarTheme(
backgroundColor: AppColors.darkSurface,
elevation: 0,
titleTextStyle: textTheme.titleLarge?.copyWith(
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primary,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: AppColors.primary,
side: BorderSide(color: AppColors.primary),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: AppColors.primary,
),
),
cardTheme: CardTheme(
color: AppColors.darkSurface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
elevation: 2,
),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: AppColors.darkBorder),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: AppColors.primary, width: 2),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: AppColors.error, width: 2),
),
filled: true,
fillColor: Colors.grey.shade900,
),
);
}