Flutter Material ThemeData Config
Defines the configuration of the overall visual Theme for a MaterialApp or a widget subtree within the app. The MaterialApp theme property can be used to configure the appearance of the entire app. Widget subtree’s within an app can override the app’s theme by including a Theme widget at the top of the subtree.
ThemeData Constructors
-
ThemeData({Brightness? brightness, VisualDensity? visualDensity, MaterialColor? primarySwatch, Color? primaryColor, Brightness? primaryColorBrightness, Color? primaryColorLight, Color? primaryColorDark, Color? accentColor, Brightness? accentColorBrightness, Color? canvasColor, Color? shadowColor, Color? scaffoldBackgroundColor, Color? bottomAppBarColor, Color? cardColor, Color? dividerColor, Color? focusColor, Color? hoverColor, Color? highlightColor, Color? splashColor, InteractiveInkFeatureFactory? splashFactory, Color? selectedRowColor, Color? unselectedWidgetColor, Color? disabledColor, Color? buttonColor, ButtonThemeData? buttonTheme, ToggleButtonsThemeData? toggleButtonsTheme, Color? secondaryHeaderColor, @Deprecated('Use TextSelectionThemeData.selectionColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') Color? textSelectionColor, @Deprecated('Use TextSelectionThemeData.cursorColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') Color? cursorColor, @Deprecated('Use TextSelectionThemeData.selectionHandleColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') Color? textSelectionHandleColor, Color? backgroundColor, Color? dialogBackgroundColor, Color? indicatorColor, Color? hintColor, Color? errorColor, Color? toggleableActiveColor, String? fontFamily, TextTheme? textTheme, TextTheme? primaryTextTheme, TextTheme? accentTextTheme, InputDecorationTheme? inputDecorationTheme, IconThemeData? iconTheme, IconThemeData? primaryIconTheme, IconThemeData? accentIconTheme, SliderThemeData? sliderTheme, TabBarTheme? tabBarTheme, TooltipThemeData? tooltipTheme, CardTheme? cardTheme, ChipThemeData? chipTheme, TargetPlatform? platform, MaterialTapTargetSize? materialTapTargetSize, bool? applyElevationOverlayColor, PageTransitionsTheme? pageTransitionsTheme, AppBarTheme? appBarTheme, ScrollbarThemeData? scrollbarTheme, BottomAppBarTheme? bottomAppBarTheme, ColorScheme? colorScheme, DialogTheme? dialogTheme, FloatingActionButtonThemeData? floatingActionButtonTheme, NavigationRailThemeData? navigationRailTheme, Typography? typography, NoDefaultCupertinoThemeData? cupertinoOverrideTheme, SnackBarThemeData? snackBarTheme, BottomSheetThemeData? bottomSheetTheme, PopupMenuThemeData? popupMenuTheme, MaterialBannerThemeData? bannerTheme, DividerThemeData? dividerTheme, ButtonBarThemeData? buttonBarTheme, BottomNavigationBarThemeData? bottomNavigationBarTheme, TimePickerThemeData? timePickerTheme, TextButtonThemeData? textButtonTheme, ElevatedButtonThemeData? elevatedButtonTheme, OutlinedButtonThemeData? outlinedButtonTheme, TextSelectionThemeData? textSelectionTheme, DataTableThemeData? dataTableTheme, CheckboxThemeData? checkboxTheme, RadioThemeData? radioTheme, SwitchThemeData? switchTheme, bool? fixTextFieldOutlineLabel, @Deprecated('No longer used by the framework, please remove any reference to it. ' 'This feature was deprecated after v1.23.0-4.0.pre.') bool? useTextSelectionTheme}): Create a ThemeData that’s used to configure a Theme.
-
ThemeData.dark(): A default dark theme with a teal secondary ColorScheme color.
-
ThemeData.light(): A default light blue theme.
-
ThemeData.fallback(): The default color theme. Same as ThemeData.light.
-
ThemeData.from({required ColorScheme colorScheme, TextTheme? textTheme}): Create a ThemeData based on the colors in the given colorScheme and text styles of the optional textTheme.
-
ThemeData.raw({required VisualDensity visualDensity, required Color primaryColor, required Brightness primaryColorBrightness, required Color primaryColorLight, required Color primaryColorDark, required Color canvasColor, required Color shadowColor, required Color accentColor, required Brightness accentColorBrightness, required Color scaffoldBackgroundColor, required Color bottomAppBarColor, required Color cardColor, required Color dividerColor, required Color focusColor, required Color hoverColor, required Color highlightColor, required Color splashColor, required InteractiveInkFeatureFactory splashFactory, required Color selectedRowColor, required Color unselectedWidgetColor, required Color disabledColor, required ButtonThemeData buttonTheme, required Color buttonColor, required ToggleButtonsThemeData toggleButtonsTheme, required Color secondaryHeaderColor, @Deprecated('Use TextSelectionThemeData.selectionColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') required Color textSelectionColor, @Deprecated('Use TextSelectionThemeData.cursorColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') required Color cursorColor, @Deprecated('Use TextSelectionThemeData.selectionHandleColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') required Color textSelectionHandleColor, required Color backgroundColor, required Color dialogBackgroundColor, required Color indicatorColor, required Color hintColor, required Color errorColor, required Color toggleableActiveColor, required TextTheme textTheme, required TextTheme primaryTextTheme, required TextTheme accentTextTheme, required InputDecorationTheme inputDecorationTheme, required IconThemeData iconTheme, required IconThemeData primaryIconTheme, required IconThemeData accentIconTheme, required SliderThemeData sliderTheme, required TabBarTheme tabBarTheme, required TooltipThemeData tooltipTheme, required CardTheme cardTheme, required ChipThemeData chipTheme, required TargetPlatform platform, required MaterialTapTargetSize materialTapTargetSize, required bool applyElevationOverlayColor, required PageTransitionsTheme pageTransitionsTheme, required AppBarTheme appBarTheme, required ScrollbarThemeData scrollbarTheme, required BottomAppBarTheme bottomAppBarTheme, required ColorScheme colorScheme, required DialogTheme dialogTheme, required FloatingActionButtonThemeData floatingActionButtonTheme, required NavigationRailThemeData navigationRailTheme, required Typography typography, required NoDefaultCupertinoThemeData? cupertinoOverrideTheme, required SnackBarThemeData snackBarTheme, required BottomSheetThemeData bottomSheetTheme, required PopupMenuThemeData popupMenuTheme, required MaterialBannerThemeData bannerTheme, required DividerThemeData dividerTheme, required ButtonBarThemeData buttonBarTheme, required BottomNavigationBarThemeData bottomNavigationBarTheme, required TimePickerThemeData timePickerTheme, required TextButtonThemeData textButtonTheme, required ElevatedButtonThemeData elevatedButtonTheme, required OutlinedButtonThemeData outlinedButtonTheme, required TextSelectionThemeData textSelectionTheme, required DataTableThemeData dataTableTheme, required CheckboxThemeData checkboxTheme, required RadioThemeData radioTheme, required SwitchThemeData switchTheme, required bool fixTextFieldOutlineLabel, @Deprecated('No longer used by the framework, please remove any reference to it. ' 'This feature was deprecated after v1.23.0-4.0.pre.') required bool useTextSelectionTheme}): Create a ThemeData given a set of exact values. All the values must be specified. They all must also be non-null except for cupertinoOverrideTheme.