ThemeData.raw constructor Null safety

const ThemeData.raw(
  1. {required bool applyElevationOverlayColor,
  2. required NoDefaultCupertinoThemeData? cupertinoOverrideTheme,
  3. required Map<Object, ThemeExtension> extensions,
  4. required InputDecorationTheme inputDecorationTheme,
  5. required MaterialTapTargetSize materialTapTargetSize,
  6. required PageTransitionsTheme pageTransitionsTheme,
  7. required TargetPlatform platform,
  8. required ScrollbarThemeData scrollbarTheme,
  9. required InteractiveInkFeatureFactory splashFactory,
  10. required bool useMaterial3,
  11. required VisualDensity visualDensity,
  12. required Color backgroundColor,
  13. required Color bottomAppBarColor,
  14. required Color canvasColor,
  15. required Color cardColor,
  16. required ColorScheme colorScheme,
  17. required Color dialogBackgroundColor,
  18. required Color disabledColor,
  19. required Color dividerColor,
  20. required Color errorColor,
  21. required Color focusColor,
  22. required Color highlightColor,
  23. required Color hintColor,
  24. required Color hoverColor,
  25. required Color indicatorColor,
  26. required Color primaryColor,
  27. required Color primaryColorDark,
  28. required Color primaryColorLight,
  29. required Color scaffoldBackgroundColor,
  30. required Color secondaryHeaderColor,
  31. required Color selectedRowColor,
  32. required Color shadowColor,
  33. required Color splashColor,
  34. required Color toggleableActiveColor,
  35. required Color unselectedWidgetColor,
  36. required IconThemeData iconTheme,
  37. required IconThemeData primaryIconTheme,
  38. required TextTheme primaryTextTheme,
  39. required TextTheme textTheme,
  40. required Typography typography,
  41. required AppBarTheme appBarTheme,
  42. required MaterialBannerThemeData bannerTheme,
  43. required BottomAppBarTheme bottomAppBarTheme,
  44. required BottomNavigationBarThemeData bottomNavigationBarTheme,
  45. required BottomSheetThemeData bottomSheetTheme,
  46. required ButtonBarThemeData buttonBarTheme,
  47. required ButtonThemeData buttonTheme,
  48. required CardTheme cardTheme,
  49. required CheckboxThemeData checkboxTheme,
  50. required ChipThemeData chipTheme,
  51. required DataTableThemeData dataTableTheme,
  52. required DialogTheme dialogTheme,
  53. required DividerThemeData dividerTheme,
  54. required DrawerThemeData drawerTheme,
  55. required ElevatedButtonThemeData elevatedButtonTheme,
  56. required ExpansionTileThemeData expansionTileTheme,
  57. required FloatingActionButtonThemeData floatingActionButtonTheme,
  58. required ListTileThemeData listTileTheme,
  59. required NavigationBarThemeData navigationBarTheme,
  60. required NavigationRailThemeData navigationRailTheme,
  61. required OutlinedButtonThemeData outlinedButtonTheme,
  62. required PopupMenuThemeData popupMenuTheme,
  63. required ProgressIndicatorThemeData progressIndicatorTheme,
  64. required RadioThemeData radioTheme,
  65. required SliderThemeData sliderTheme,
  66. required SnackBarThemeData snackBarTheme,
  67. required SwitchThemeData switchTheme,
  68. required TabBarTheme tabBarTheme,
  69. required TextButtonThemeData textButtonTheme,
  70. required TextSelectionThemeData textSelectionTheme,
  71. required TimePickerThemeData timePickerTheme,
  72. required ToggleButtonsThemeData toggleButtonsTheme,
  73. required TooltipThemeData tooltipTheme,
  74. @Deprecated('Use colorScheme.secondary instead. ' 'For more information, consult the migration guide at ' 'https://flutter.cn/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') Color? accentColor,
  75. @Deprecated('No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' 'https://flutter.cn/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') Brightness? accentColorBrightness,
  76. @Deprecated('No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' 'https://flutter.cn/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') TextTheme? accentTextTheme,
  77. @Deprecated('No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' 'https://flutter.cn/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. ' 'This feature was deprecated after v2.3.0-0.1.pre.') IconThemeData? accentIconTheme,
  78. @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,
  79. @Deprecated('This "fix" is now enabled by default. ' 'This feature was deprecated after v2.5.0-1.0.pre.') bool? fixTextFieldOutlineLabel,
  80. @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,
  81. @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.cn/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.cn/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.cn/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.cn/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);