darkThemeData static method
ThemeData
darkThemeData(
{ - dynamic data,
- required bool isTablet,
})
Implementation
static ThemeData darkThemeData({dynamic data, required bool isTablet}) {
double buttonSize = selectSize(isTablet, buttonLargeSize, buttonMediumSize);
double checkboxSize =
selectSize(isTablet, checkboxLargeSize, checkboxMediumSize);
double radioSize = selectSize(isTablet, radioLargeSize, radioMediumSize);
return ThemeData(
appBarTheme: AppBarTheme(
elevation: 0,
backgroundColor: Colors.black,
iconTheme: const IconThemeData(color: Colors.orangeAccent),
titleTextStyle: _appBarTextStyle(Colors.orangeAccent),
),
textTheme: _textTheme(isDark: true, isTablet: isTablet),
iconTheme: const IconThemeData(color: Colors.orangeAccent),
buttonTheme: const ButtonThemeData(
buttonColor: Colors.orangeAccent,
textTheme: ButtonTextTheme.primary,
minWidth: buttonMediumSize,
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return Colors.orangeAccent;
}
return Colors.grey;
}),
checkColor: MaterialStateProperty.all(Colors.black),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(checkboxMediumSize / 2),
),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return Colors.orangeAccent;
}
return Colors.grey;
}),
),
colorScheme: _colorScheme(data, Brightness.dark),
bottomNavigationBarTheme: const BottomNavigationBarThemeData(
backgroundColor: Colors.black,
selectedItemColor: Colors.orangeAccent,
unselectedItemColor: Colors.grey,
),
drawerTheme: const DrawerThemeData(
backgroundColor: Colors.black,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: _elevatedButtonStyle(buttonSize, data, Brightness.dark)),
).copyWith(
elevatedButtonTheme: ElevatedButtonThemeData(style: _elevatedButtonStyle(buttonSize, data, Brightness.light)),
checkboxTheme: _checkboxTheme(checkboxSize,data),
radioTheme: _radioTheme(radioSize,data),
);
}