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 VisualDensity visualDensity,
  11. required bool useMaterial3,
  12. required ColorScheme colorScheme,
  13. required Color primaryColor,
  14. required Color primaryColorLight,
  15. required Color primaryColorDark,
  16. required Color focusColor,
  17. required Color hoverColor,
  18. required Color shadowColor,
  19. required Color canvasColor,
  20. required Color scaffoldBackgroundColor,
  21. required Color bottomAppBarColor,
  22. required Color cardColor,
  23. required Color dividerColor,
  24. required Color highlightColor,
  25. required Color splashColor,
  26. required Color selectedRowColor,
  27. required Color unselectedWidgetColor,
  28. required Color disabledColor,
  29. required Color secondaryHeaderColor,
  30. required Color backgroundColor,
  31. required Color dialogBackgroundColor,
  32. required Color indicatorColor,
  33. required Color hintColor,
  34. required Color errorColor,
  35. required Color toggleableActiveColor,
  36. required Typography typography,
  37. required TextTheme textTheme,
  38. required TextTheme primaryTextTheme,
  39. required IconThemeData iconTheme,
  40. required IconThemeData primaryIconTheme,
  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 FloatingActionButtonThemeData floatingActionButtonTheme,
  57. required ListTileThemeData listTileTheme,
  58. required NavigationBarThemeData navigationBarTheme,
  59. required NavigationRailThemeData navigationRailTheme,
  60. required OutlinedButtonThemeData outlinedButtonTheme,
  61. required PopupMenuThemeData popupMenuTheme,
  62. required ProgressIndicatorThemeData progressIndicatorTheme,
  63. required RadioThemeData radioTheme,
  64. required SliderThemeData sliderTheme,
  65. required SnackBarThemeData snackBarTheme,
  66. required SwitchThemeData switchTheme,
  67. required TabBarTheme tabBarTheme,
  68. required TextButtonThemeData textButtonTheme,
  69. required TextSelectionThemeData textSelectionTheme,
  70. required TimePickerThemeData timePickerTheme,
  71. required ToggleButtonsThemeData toggleButtonsTheme,
  72. required TooltipThemeData tooltipTheme,
  73. required ExpansionTileThemeData expansionTileTheme,
  74. @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,
  75. @Deprecated('Use TextSelectionThemeData.selectionColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') required Color textSelectionColor,
  76. @Deprecated('Use TextSelectionThemeData.cursorColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') required Color cursorColor,
  77. @Deprecated('Use TextSelectionThemeData.selectionHandleColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.') required Color textSelectionHandleColor,
  78. @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.') required Color accentColor,
  79. @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.') required Brightness accentColorBrightness,
  80. @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.') required TextTheme accentTextTheme,
  81. @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.') required IconThemeData accentIconTheme,
  82. @Deprecated('No longer used by the framework, please remove any reference to it. ' 'This feature was deprecated after v2.3.0-0.2.pre.') required Color buttonColor,
  83. @Deprecated('This "fix" is now enabled by default. ' 'This feature was deprecated after v2.5.0-1.0.pre.') required bool fixTextFieldOutlineLabel,
  84. @Deprecated('No longer used by the framework, please remove any reference to it. ' 'This feature was deprecated after v2.6.0-11.0.pre.') required Brightness primaryColorBrightness,
  85. @Deprecated('Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. ' 'This feature was deprecated after v2.13.0-0.0.pre.') required AndroidOverscrollIndicator? androidOverscrollIndicator}
)

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.

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({
  // Warning: make sure these properties are in the exact same order as in
  // operator == and in the Object.hash method and in the order of fields
  // in this class, and in the lerp() method.
  // 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.visualDensity,
  required this.useMaterial3,
  // 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.colorScheme,
  required this.primaryColor,
  required this.primaryColorLight,
  required this.primaryColorDark,
  required this.focusColor,
  required this.hoverColor,
  required this.shadowColor,
  required this.canvasColor,
  required this.scaffoldBackgroundColor,
  required this.bottomAppBarColor,
  required this.cardColor,
  required this.dividerColor,
  required this.highlightColor,
  required this.splashColor,
  required this.selectedRowColor,
  required this.unselectedWidgetColor,
  required this.disabledColor,
  required this.secondaryHeaderColor,
  required this.backgroundColor,
  required this.dialogBackgroundColor,
  required this.indicatorColor,
  required this.hintColor,
  required this.errorColor,
  required this.toggleableActiveColor,
  // TYPOGRAPHY & ICONOGRAPHY
  required this.typography,
  required this.textTheme,
  required this.primaryTextTheme,
  required this.iconTheme,
  required this.primaryIconTheme,
  // 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.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,
  required this.expansionTileTheme,
  // DEPRECATED (newest deprecations at the bottom)
  @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 this.useTextSelectionTheme,
  @Deprecated(
    'Use TextSelectionThemeData.selectionColor instead. '
    'This feature was deprecated after v1.26.0-18.0.pre.',
  )
  required this.textSelectionColor,
  @Deprecated(
    'Use TextSelectionThemeData.cursorColor instead. '
    'This feature was deprecated after v1.26.0-18.0.pre.',
  )
  required this.cursorColor,
  @Deprecated(
    'Use TextSelectionThemeData.selectionHandleColor instead. '
    'This feature was deprecated after v1.26.0-18.0.pre.',
  )
  required this.textSelectionHandleColor,
  @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.',
  )
  required this.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.',
  )
  required this.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.',
  )
  required this.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.',
  )
  required this.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.',
  )
  required this.buttonColor,
  @Deprecated(
    'This "fix" is now enabled by default. '
    'This feature was deprecated after v2.5.0-1.0.pre.',
  )
  required this.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.',
  )
  required this.primaryColorBrightness,
  @Deprecated(
    'Use ThemeData.useMaterial3 or override ScrollBehavior.buildOverscrollIndicator. '
    'This feature was deprecated after v2.13.0-0.0.pre.'
  )
  required this.androidOverscrollIndicator,
}) : // 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(visualDensity != null),
     assert(useMaterial3 != null),
      // COLOR
     assert(colorScheme != null),
     assert(primaryColor != null),
     assert(primaryColorLight != null),
     assert(primaryColorDark != null),
     assert(focusColor != null),
     assert(hoverColor != null),
     assert(shadowColor != null),
     assert(canvasColor != null),
     assert(scaffoldBackgroundColor != null),
     assert(bottomAppBarColor != null),
     assert(cardColor != null),
     assert(dividerColor != null),
     assert(highlightColor != null),
     assert(splashColor != null),
     assert(selectedRowColor != null),
     assert(unselectedWidgetColor != null),
     assert(disabledColor != null),
     assert(secondaryHeaderColor != null),
     assert(backgroundColor != null),
     assert(dialogBackgroundColor != null),
     assert(indicatorColor != null),
     assert(hintColor != null),
     assert(errorColor != null),
     assert(toggleableActiveColor != null),
      // TYPOGRAPHY & ICONOGRAPHY
     assert(typography != null),
     assert(textTheme != null),
     assert(primaryTextTheme != null),
     assert(iconTheme != null),
     assert(primaryIconTheme != 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(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),
     assert(expansionTileTheme != null),
      // DEPRECATED (newest deprecations at the bottom)
     assert(useTextSelectionTheme != null),
     assert(textSelectionColor != null),
     assert(cursorColor != null),
     assert(textSelectionHandleColor != null),
     assert(accentColor != null),
     assert(accentColorBrightness != null),
     assert(accentTextTheme != null),
     assert(accentIconTheme != null),
     assert(buttonColor != null),
     assert(fixTextFieldOutlineLabel != null),
     assert(primaryColorBrightness != null);