lightThemeData static method
ThemeData
lightThemeData(
{ - dynamic data,
- required bool isTablet,
})
Implementation
static ThemeData lightThemeData({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.white,
iconTheme: IconThemeData(color: getPrimaryColor(data)),
titleTextStyle: _appBarTextStyle(Colors.orangeAccent),
),
textTheme: _textTheme(isDark: false, isTablet: isTablet),
iconTheme: IconThemeData(color: getPrimaryColor(data)),
buttonTheme: ButtonThemeData(
buttonColor: getPrimaryColor(data),
textTheme: ButtonTextTheme.primary,
minWidth: buttonSize,
),
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return getPrimaryColor(data);
}
return Colors.grey;
}),
checkColor: MaterialStateProperty.all(Colors.white),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(checkboxSize / 2),
),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith((states) {
if (states.contains(MaterialState.selected)) {
return Colors.orangeAccent;
}
return Colors.grey;
}),
),
colorScheme: _colorScheme(data, Brightness.light),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: Colors.white,
selectedItemColor: getPrimaryColor(data),
unselectedItemColor: Colors.grey,
),
drawerTheme: const DrawerThemeData(
backgroundColor: Colors.white,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: _elevatedButtonStyle(buttonSize, data, Brightness.light)),
).copyWith(
elevatedButtonTheme: ElevatedButtonThemeData(style: _elevatedButtonStyle(buttonSize, data, Brightness.light)),
checkboxTheme: _checkboxTheme(checkboxSize,data),
radioTheme: _radioTheme(radioSize,data),
);
}