darkTheme property
Creates the dark theme for the application.
Implementation
static ThemeData get darkTheme {
return ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: primaryColor,
brightness: Brightness.dark,
),
// Set primary text color for input fields.
primaryColor: primaryColor,
primaryColorDark: Colors.white,
primaryColorLight: Colors.white,
scaffoldBackgroundColor: Colors.black,
appBarTheme: const AppBarTheme(
backgroundColor: Colors.black,
elevation: 0,
iconTheme: IconThemeData(color: Colors.white),
titleTextStyle: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
backgroundColor: Colors.black,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.grey,
elevation: 0,
),
textTheme: const TextTheme(
displayLarge: TextStyle(
color: Colors.white,
fontSize: 32,
fontWeight: FontWeight.bold,
),
displayMedium: TextStyle(
color: Colors.white,
fontSize: 28,
fontWeight: FontWeight.bold,
),
displaySmall: TextStyle(
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
),
headlineMedium: TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
bodyLarge: TextStyle(color: Colors.white, fontSize: 16),
bodyMedium: TextStyle(color: Colors.grey, fontSize: 14),
labelLarge: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
cardTheme: CardThemeData(
color: Colors.grey[900],
elevation: 4,
shadowColor: Colors.black54,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(defaultBorderRadius),
),
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: Colors.grey[900],
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(defaultBorderRadius),
borderSide: BorderSide.none,
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(defaultBorderRadius),
borderSide: BorderSide(color: Colors.grey[700]!),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(defaultBorderRadius),
borderSide: BorderSide(color: primaryColor, width: 2),
),
hintStyle: const TextStyle(color: Colors.grey),
// Ensure proper text color for dark background.
labelStyle: const TextStyle(color: Colors.white),
helperStyle: const TextStyle(color: Colors.white),
counterStyle: const TextStyle(color: Colors.white),
errorStyle: const TextStyle(color: Colors.red),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: primaryColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
horizontal: defaultPadding,
vertical: defaultPadding / 2,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(defaultBorderRadius),
),
),
),
);
}