lightThemeData static method

ThemeData lightThemeData({
  1. dynamic data,
  2. 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(AppColors.primary),
    ),
    textTheme: _textTheme(isDark: false, isTablet: isTablet),
    iconTheme: IconThemeData(color: getPrimaryColor(data)),
    buttonTheme: ButtonThemeData(
      buttonColor: getPrimaryColor(data),
      textTheme: ButtonTextTheme.primary,
      minWidth: buttonSize,
      height: buttonSize,
    ),
    checkboxTheme: CheckboxThemeData(
      fillColor: MaterialStateProperty.resolveWith((states) {
        if (states.contains(MaterialState.selected)) {
          return getPrimaryColor(data);
        }
        return Colors.black;
      }),
      checkColor: MaterialStateProperty.all(Colors.white),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(checkboxSize / 2),
      ),
    ),
    radioTheme: RadioThemeData(
      fillColor: MaterialStateProperty.resolveWith((states) {
        if (states.contains(MaterialState.selected)) {
          return getPrimaryColor(data);
        }
        return Colors.black;
      }),
      splashRadius: radioSize / 2, // Ensure adequate splash radius for accessibility
    ),
    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),
  );
}