ThemeData.raw constructor Null safety
- {required bool applyElevationOverlayColor,
- required NoDefaultCupertinoThemeData? cupertinoOverrideTheme,
- required Map<
Object, ThemeExtension> extensions, - required InputDecorationTheme inputDecorationTheme,
- required MaterialTapTargetSize materialTapTargetSize,
- required PageTransitionsTheme pageTransitionsTheme,
- required TargetPlatform platform,
- required ScrollbarThemeData scrollbarTheme,
- required InteractiveInkFeatureFactory splashFactory,
- required bool useMaterial3,
- required VisualDensity visualDensity,
- required Color backgroundColor,
- required Color bottomAppBarColor,
- required Color canvasColor,
- required Color cardColor,
- required ColorScheme colorScheme,
- required Color dialogBackgroundColor,
- required Color disabledColor,
- required Color dividerColor,
- required Color errorColor,
- required Color focusColor,
- required Color highlightColor,
- required Color hintColor,
- required Color hoverColor,
- required Color indicatorColor,
- required Color primaryColor,
- required Color primaryColorDark,
- required Color primaryColorLight,
- required Color scaffoldBackgroundColor,
- required Color secondaryHeaderColor,
- required Color selectedRowColor,
- required Color shadowColor,
- required Color splashColor,
- required Color toggleableActiveColor,
- required Color unselectedWidgetColor,
- required IconThemeData iconTheme,
- required IconThemeData primaryIconTheme,
- required TextTheme primaryTextTheme,
- required TextTheme textTheme,
- required Typography typography,
- required AppBarTheme appBarTheme,
- required MaterialBannerThemeData bannerTheme,
- required BottomAppBarTheme bottomAppBarTheme,
- required BottomSheetThemeData bottomSheetTheme,
- required ButtonBarThemeData buttonBarTheme,
- required ButtonThemeData buttonTheme,
- required CardTheme cardTheme,
- required CheckboxThemeData checkboxTheme,
- required ChipThemeData chipTheme,
- required DataTableThemeData dataTableTheme,
- required DialogTheme dialogTheme,
- required DividerThemeData dividerTheme,
- required DrawerThemeData drawerTheme,
- required ElevatedButtonThemeData elevatedButtonTheme,
- required ExpansionTileThemeData expansionTileTheme,
- required FloatingActionButtonThemeData floatingActionButtonTheme,
- required ListTileThemeData listTileTheme,
- required OutlinedButtonThemeData outlinedButtonTheme,
- required PopupMenuThemeData popupMenuTheme,
- required ProgressIndicatorThemeData progressIndicatorTheme,
- required RadioThemeData radioTheme,
- required SliderThemeData sliderTheme,
- required SnackBarThemeData snackBarTheme,
- required SwitchThemeData switchTheme,
- required TabBarTheme tabBarTheme,
- required TextButtonThemeData textButtonTheme,
- required TextSelectionThemeData textSelectionTheme,
- required TimePickerThemeData timePickerTheme,
- required ToggleButtonsThemeData toggleButtonsTheme,
- required TooltipThemeData tooltipTheme,
- @Deprecated('Use colorScheme.secondary instead. ' 'For more information, consult the migration guide at ' 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') Color? accentColor,
- @Deprecated('No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') Brightness? accentColorBrightness,
- @Deprecated('No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') TextTheme? accentTextTheme,
- @Deprecated('No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') IconThemeData? accentIconTheme,
- @Deprecated('No longer used by the framework, please remove any reference to it. ' 'This feature was deprecated after v2.3.0-0.2.pre.') Color? buttonColor,
- @Deprecated('This "fix" is now enabled by default. ' 'This feature was deprecated after v2.5.0-1.0.pre.') bool? fixTextFieldOutlineLabel,
- @Deprecated('No longer used by the framework, please remove any reference to it. ' 'This feature was deprecated after v2.6.0-11.0.pre.') Brightness? primaryColorBrightness,
- @Deprecated('Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. ' 'This feature was deprecated after v2.13.0-0.0.pre.') AndroidOverscrollIndicator? androidOverscrollIndicator}
Create a ThemeData given a set of exact values. Most values must be specified. They all must also be non-null except for cupertinoOverrideTheme, and deprecated members.
This will rarely be used directly. It is used by lerp to create intermediate themes based on two themes created with the ThemeData constructor.
Implementation
const ThemeData.raw({
// For the sanity of the reader, make sure these properties are in the same
// order in every place that they are separated by section comments (e.g.
// GENERAL CONFIGURATION). Each section except for deprecations should be
// alphabetical by symbol name.
// GENERAL CONFIGURATION
required this.applyElevationOverlayColor,
required this.cupertinoOverrideTheme,
required this.extensions,
required this.inputDecorationTheme,
required this.materialTapTargetSize,
required this.pageTransitionsTheme,
required this.platform,
required this.scrollbarTheme,
required this.splashFactory,
required this.useMaterial3,
required this.visualDensity,
// COLOR
// [colorScheme] is the preferred way to configure colors. The other color
// properties will gradually be phased out, see
// https://github.com/flutter/flutter/issues/91772.
required this.backgroundColor,
required this.bottomAppBarColor,
required this.canvasColor,
required this.cardColor,
required this.colorScheme,
required this.dialogBackgroundColor,
required this.disabledColor,
required this.dividerColor,
required this.errorColor,
required this.focusColor,
required this.highlightColor,
required this.hintColor,
required this.hoverColor,
required this.indicatorColor,
required this.primaryColor,
required this.primaryColorDark,
required this.primaryColorLight,
required this.scaffoldBackgroundColor,
required this.secondaryHeaderColor,
required this.selectedRowColor,
required this.shadowColor,
required this.splashColor,
required this.toggleableActiveColor,
required this.unselectedWidgetColor,
// TYPOGRAPHY & ICONOGRAPHY
required this.iconTheme,
required this.primaryIconTheme,
required this.primaryTextTheme,
required this.textTheme,
required this.typography,
// COMPONENT THEMES
required this.appBarTheme,
required this.bannerTheme,
required this.bottomAppBarTheme,
required this.bottomNavigationBarTheme,
required this.bottomSheetTheme,
required this.buttonBarTheme,
required this.buttonTheme,
required this.cardTheme,
required this.checkboxTheme,
required this.chipTheme,
required this.dataTableTheme,
required this.dialogTheme,
required this.dividerTheme,
required this.drawerTheme,
required this.elevatedButtonTheme,
required this.expansionTileTheme,
required this.floatingActionButtonTheme,
required this.listTileTheme,
required this.navigationBarTheme,
required this.navigationRailTheme,
required this.outlinedButtonTheme,
required this.popupMenuTheme,
required this.progressIndicatorTheme,
required this.radioTheme,
required this.sliderTheme,
required this.snackBarTheme,
required this.switchTheme,
required this.tabBarTheme,
required this.textButtonTheme,
required this.textSelectionTheme,
required this.timePickerTheme,
required this.toggleButtonsTheme,
required this.tooltipTheme,
// DEPRECATED (newest deprecations at the bottom)
@Deprecated(
'Use colorScheme.secondary instead. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.',
)
Color? accentColor,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.',
)
Brightness? accentColorBrightness,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.',
)
TextTheme? accentTextTheme,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'For more information, consult the migration guide at '
'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
'This feature was deprecated after v2.3.0-0.1.pre.',
)
IconThemeData? accentIconTheme,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.3.0-0.2.pre.',
)
Color? buttonColor,
@Deprecated(
'This "fix" is now enabled by default. '
'This feature was deprecated after v2.5.0-1.0.pre.',
)
bool? fixTextFieldOutlineLabel,
@Deprecated(
'No longer used by the framework, please remove any reference to it. '
'This feature was deprecated after v2.6.0-11.0.pre.',
)
Brightness? primaryColorBrightness,
@Deprecated(
'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
'This feature was deprecated after v2.13.0-0.0.pre.'
)
this.androidOverscrollIndicator,
}) : // DEPRECATED (newest deprecations at the bottom)
// should not be `required`, use getter pattern to avoid breakages.
_accentColor = accentColor,
_accentColorBrightness = accentColorBrightness,
_accentTextTheme = accentTextTheme,
_accentIconTheme = accentIconTheme,
_buttonColor = buttonColor,
_fixTextFieldOutlineLabel = fixTextFieldOutlineLabel,
_primaryColorBrightness = primaryColorBrightness,
// GENERAL CONFIGURATION
assert(applyElevationOverlayColor != null),
assert(extensions != null),
assert(inputDecorationTheme != null),
assert(materialTapTargetSize != null),
assert(pageTransitionsTheme != null),
assert(platform != null),
assert(scrollbarTheme != null),
assert(splashFactory != null),
assert(useMaterial3 != null),
assert(visualDensity != null),
// COLOR
assert(backgroundColor != null),
assert(bottomAppBarColor != null),
assert(canvasColor != null),
assert(cardColor != null),
assert(colorScheme != null),
assert(dialogBackgroundColor != null),
assert(disabledColor != null),
assert(dividerColor != null),
assert(errorColor != null),
assert(focusColor != null),
assert(highlightColor != null),
assert(hintColor != null),
assert(hoverColor != null),
assert(indicatorColor != null),
assert(primaryColor != null),
assert(primaryColorDark != null),
assert(primaryColorLight != null),
assert(scaffoldBackgroundColor != null),
assert(secondaryHeaderColor != null),
assert(selectedRowColor != null),
assert(shadowColor != null),
assert(splashColor != null),
assert(toggleableActiveColor != null),
assert(unselectedWidgetColor != null),
// TYPOGRAPHY & ICONOGRAPHY
assert(iconTheme != null),
assert(primaryIconTheme != null),
assert(primaryTextTheme != null),
assert(textTheme != null),
assert(typography != null),
// COMPONENT THEMES
assert(appBarTheme != null),
assert(bannerTheme != null),
assert(bottomAppBarTheme != null),
assert(bottomNavigationBarTheme != null),
assert(bottomSheetTheme != null),
assert(buttonBarTheme != null),
assert(buttonTheme != null),
assert(cardTheme != null),
assert(checkboxTheme != null),
assert(chipTheme != null),
assert(dataTableTheme != null),
assert(dialogTheme != null),
assert(dividerTheme != null),
assert(drawerTheme != null),
assert(elevatedButtonTheme != null),
assert(expansionTileTheme != null),
assert(floatingActionButtonTheme != null),
assert(listTileTheme != null),
assert(navigationBarTheme != null),
assert(navigationRailTheme != null),
assert(outlinedButtonTheme != null),
assert(popupMenuTheme != null),
assert(progressIndicatorTheme != null),
assert(radioTheme != null),
assert(sliderTheme != null),
assert(snackBarTheme != null),
assert(switchTheme != null),
assert(tabBarTheme != null),
assert(textButtonTheme != null),
assert(textSelectionTheme != null),
assert(timePickerTheme != null),
assert(toggleButtonsTheme != null),
assert(tooltipTheme != null);