themeData property

ThemeData get themeData

Complete theme for MaterialApp

Implementation

static ThemeData get themeData => ThemeData(
  useMaterial3: true,
  brightness: isDarkMode ? Brightness.dark : Brightness.light,
  colorScheme: ColorScheme.fromSeed(
    seedColor: primary,
    brightness: isDarkMode ? Brightness.dark : Brightness.light,
  ),
  scaffoldBackgroundColor: background,
  appBarTheme: AppBarTheme(
    backgroundColor: surface,
    foregroundColor: textPrimary,
    elevation: 1,
  ),
  cardTheme: CardThemeData(
    color: surface,
    elevation: 2,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(borderRadiusMedium),
    ),
  ),
  inputDecorationTheme: InputDecorationTheme(
    filled: true,
    fillColor: surface,
    border: OutlineInputBorder(
      borderRadius: BorderRadius.circular(borderRadiusSmall),
      borderSide: BorderSide(color: panelBorder),
    ),
    enabledBorder: OutlineInputBorder(
      borderRadius: BorderRadius.circular(borderRadiusSmall),
      borderSide: BorderSide(color: panelBorder),
    ),
    focusedBorder: OutlineInputBorder(
      borderRadius: BorderRadius.circular(borderRadiusSmall),
      borderSide: BorderSide(color: primary, width: 2),
    ),
    contentPadding: const EdgeInsets.symmetric(
      horizontal: paddingMedium,
      vertical: paddingSmall,
    ),
    isDense: true,
  ),
  elevatedButtonTheme: ElevatedButtonThemeData(
    style: ElevatedButton.styleFrom(
      backgroundColor: primary,
      foregroundColor: Colors.white,
      padding: const EdgeInsets.symmetric(
        horizontal: paddingLarge,
        vertical: paddingMedium,
      ),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(borderRadiusSmall),
      ),
    ),
  ),
  textButtonTheme: TextButtonThemeData(
    style: TextButton.styleFrom(foregroundColor: primary),
  ),
  iconTheme: IconThemeData(size: iconSize, color: textSecondary),
  dividerTheme: DividerThemeData(color: panelBorder, thickness: 1, space: 1),
);