diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 06ea9adcb5..b4b5b5d8a7 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -220,94 +220,49 @@ class ThemeData with Diagnosticable { /// * [ThemeData.light], which creates a light blue theme. /// * [ThemeData.dark], which creates dark theme with a teal secondary [ColorScheme] color. factory ThemeData({ - // GENERAL CONFIGURATION - AndroidOverscrollIndicator? androidOverscrollIndicator, - bool? applyElevationOverlayColor, - NoDefaultCupertinoThemeData? cupertinoOverrideTheme, - InputDecorationTheme? inputDecorationTheme, - MaterialTapTargetSize? materialTapTargetSize, - PageTransitionsTheme? pageTransitionsTheme, - TargetPlatform? platform, - ScrollbarThemeData? scrollbarTheme, - InteractiveInkFeatureFactory? splashFactory, - VisualDensity? visualDensity, - // COLOR - // [colorScheme] is the preferred way to configure colors. The other color - // properties (as well as brightness, primaryColorBrightness, and primarySwatch) - // will gradually be phased out, see https://github.com/flutter/flutter/issues/91772. - ColorScheme? colorScheme, Brightness? brightness, + VisualDensity? visualDensity, MaterialColor? primarySwatch, Color? primaryColor, Brightness? primaryColorBrightness, Color? primaryColorLight, Color? primaryColorDark, - Color? focusColor, - Color? hoverColor, - Color? shadowColor, + @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, 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? secondaryHeaderColor, - Color? backgroundColor, - Color? dialogBackgroundColor, - Color? indicatorColor, - Color? hintColor, - Color? errorColor, - Color? toggleableActiveColor, - // TYPOGRAPHY & ICONOGRAPHY - String? fontFamily, - Typography? typography, - TextTheme? textTheme, - TextTheme? primaryTextTheme, - IconThemeData? iconTheme, - IconThemeData? primaryIconTheme, - // COMPONENT THEMES - AppBarTheme? appBarTheme, - MaterialBannerThemeData? bannerTheme, - BottomAppBarTheme? bottomAppBarTheme, - BottomNavigationBarThemeData? bottomNavigationBarTheme, - BottomSheetThemeData? bottomSheetTheme, - ButtonBarThemeData? buttonBarTheme, - ButtonThemeData? buttonTheme, - CardTheme? cardTheme, - CheckboxThemeData? checkboxTheme, - ChipThemeData? chipTheme, - DataTableThemeData? dataTableTheme, - DialogTheme? dialogTheme, - DividerThemeData? dividerTheme, - DrawerThemeData? drawerTheme, - ElevatedButtonThemeData? elevatedButtonTheme, - FloatingActionButtonThemeData? floatingActionButtonTheme, - ListTileThemeData? listTileTheme, - NavigationBarThemeData? navigationBarTheme, - NavigationRailThemeData? navigationRailTheme, - OutlinedButtonThemeData? outlinedButtonTheme, - PopupMenuThemeData? popupMenuTheme, - ProgressIndicatorThemeData? progressIndicatorTheme, - RadioThemeData? radioTheme, - SliderThemeData? sliderTheme, - SnackBarThemeData? snackBarTheme, - SwitchThemeData? switchTheme, - TabBarTheme? tabBarTheme, - TextButtonThemeData? textButtonTheme, - TextSelectionThemeData? textSelectionTheme, - TimePickerThemeData? timePickerTheme, - ToggleButtonsThemeData? toggleButtonsTheme, - TooltipThemeData? tooltipTheme, - // 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.', + 'This feature was deprecated after v2.3.0-0.2.pre.', ) - bool? useTextSelectionTheme, + Color? buttonColor, + ButtonThemeData? buttonTheme, + ToggleButtonsThemeData? toggleButtonsTheme, + Color? secondaryHeaderColor, @Deprecated( 'Use TextSelectionThemeData.selectionColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.', @@ -323,20 +278,15 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v1.26.0-18.0.pre.', ) Color? 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.', - ) - 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, + Color? backgroundColor, + Color? dialogBackgroundColor, + Color? indicatorColor, + Color? hintColor, + Color? errorColor, + Color? toggleableActiveColor, + String? fontFamily, + TextTheme? textTheme, + TextTheme? primaryTextTheme, @Deprecated( 'No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' @@ -344,6 +294,9 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v2.3.0-0.1.pre.', ) TextTheme? accentTextTheme, + InputDecorationTheme? inputDecorationTheme, + IconThemeData? iconTheme, + IconThemeData? primaryIconTheme, @Deprecated( 'No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' @@ -351,64 +304,76 @@ class ThemeData with Diagnosticable { '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, + 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, + NavigationBarThemeData? navigationBarTheme, + 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, + ProgressIndicatorThemeData? progressIndicatorTheme, + DrawerThemeData? drawerTheme, + ListTileThemeData? listTileTheme, @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 v1.23.0-4.0.pre.', + ) + bool? useTextSelectionTheme, + AndroidOverscrollIndicator? androidOverscrollIndicator, }) { assert(colorScheme?.brightness == null || brightness == null || colorScheme!.brightness == brightness); - // GENERAL CONFIGURATION - applyElevationOverlayColor ??= false; - cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); - inputDecorationTheme ??= const InputDecorationTheme(); - platform ??= defaultTargetPlatform; - switch (platform) { - case TargetPlatform.android: - case TargetPlatform.fuchsia: - case TargetPlatform.iOS: - materialTapTargetSize ??= MaterialTapTargetSize.padded; - break; - case TargetPlatform.linux: - case TargetPlatform.macOS: - case TargetPlatform.windows: - materialTapTargetSize ??= MaterialTapTargetSize.shrinkWrap; - break; - } - pageTransitionsTheme ??= const PageTransitionsTheme(); - scrollbarTheme ??= const ScrollbarThemeData(); - splashFactory ??= InkSplash.splashFactory; - visualDensity ??= VisualDensity.adaptivePlatformDensity; - // COLOR final Brightness _brightness = brightness ?? colorScheme?.brightness ?? Brightness.light; final bool isDark = _brightness == Brightness.dark; + visualDensity ??= VisualDensity.adaptivePlatformDensity; primarySwatch ??= Colors.blue; primaryColor ??= isDark ? Colors.grey[900]! : primarySwatch; primaryColorBrightness ??= estimateBrightnessForColor(primaryColor); primaryColorLight ??= isDark ? Colors.grey[500]! : primarySwatch[100]!; primaryColorDark ??= isDark ? Colors.black : primarySwatch[700]!; final bool primaryIsDark = primaryColorBrightness == Brightness.dark; - // TODO(guidezpl): Place in right order once accentColor is removed toggleableActiveColor ??= isDark ? Colors.tealAccent[200]! : (accentColor ?? primarySwatch[600]!); accentColor ??= isDark ? Colors.tealAccent[200]! : primarySwatch[500]!; accentColorBrightness ??= estimateBrightnessForColor(accentColor); final bool accentIsDark = accentColorBrightness == Brightness.dark; - focusColor ??= isDark - ? Colors.white.withOpacity(0.12) - : Colors.black.withOpacity(0.12); - hoverColor ??= isDark - ? Colors.white.withOpacity(0.04) - : Colors.black.withOpacity(0.04); - shadowColor ??= Colors.black; canvasColor ??= isDark ? Colors.grey[850]! : Colors.grey[50]!; + shadowColor ??= Colors.black; scaffoldBackgroundColor ??= canvasColor; bottomAppBarColor ??= isDark ? Colors.grey[800]! : Colors.white; cardColor ??= isDark ? Colors.grey[800]! : Colors.white; + dividerColor ??= isDark ? const Color(0x1FFFFFFF) : const Color(0x1F000000); // Create a ColorScheme that is backwards compatible as possible // with the existing default ThemeData color values. @@ -422,20 +387,25 @@ class ThemeData with Diagnosticable { brightness: _brightness, ); - dividerColor ??= isDark ? const Color(0x1FFFFFFF) : const Color(0x1F000000); - highlightColor ??= isDark ? _kDarkThemeHighlightColor : _kLightThemeHighlightColor; - splashColor ??= isDark ? _kDarkThemeSplashColor : _kLightThemeSplashColor; + splashFactory ??= InkSplash.splashFactory; selectedRowColor ??= Colors.grey[100]!; unselectedWidgetColor ??= isDark ? Colors.white70 : Colors.black54; - disabledColor ??= isDark ? Colors.white38 : Colors.black38; // Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess. secondaryHeaderColor ??= isDark ? Colors.grey[700]! : primarySwatch[50]!; + textSelectionColor ??= isDark ? accentColor : primarySwatch[200]!; + cursorColor = cursorColor ?? const Color.fromRGBO(66, 133, 244, 1.0); + textSelectionHandleColor ??= isDark ? Colors.tealAccent[400]! : primarySwatch[300]!; backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!; dialogBackgroundColor ??= isDark ? Colors.grey[800]! : Colors.white; indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor; hintColor ??= isDark ? Colors.white60 : Colors.black.withOpacity(0.6); errorColor ??= Colors.red[700]!; - // TYPOGRAPHY & ICONOGRAPHY + inputDecorationTheme ??= const InputDecorationTheme(); + pageTransitionsTheme ??= const PageTransitionsTheme(); + primaryIconTheme ??= primaryIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); + accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); + iconTheme ??= isDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black87); + platform ??= defaultTargetPlatform; typography ??= Typography.material2014(platform: platform); TextTheme defaultTextTheme = isDark ? typography.white : typography.black; TextTheme defaultPrimaryTextTheme = primaryIsDark ? typography.white : typography.black; @@ -447,158 +417,164 @@ class ThemeData with Diagnosticable { } textTheme = defaultTextTheme.merge(textTheme); primaryTextTheme = defaultPrimaryTextTheme.merge(primaryTextTheme); - iconTheme ??= isDark - ? const IconThemeData(color: Colors.white) - : const IconThemeData(color: Colors.black87); - primaryIconTheme ??= primaryIsDark - ? const IconThemeData(color: Colors.white) - : const IconThemeData(color: Colors.black); - // COMPONENT THEMES - appBarTheme ??= const AppBarTheme(); - bannerTheme ??= const MaterialBannerThemeData(); - bottomAppBarTheme ??= const BottomAppBarTheme(); - bottomNavigationBarTheme ??= const BottomNavigationBarThemeData(); - bottomSheetTheme ??= const BottomSheetThemeData(); - buttonBarTheme ??= const ButtonBarThemeData(); + accentTextTheme = defaultAccentTextTheme.merge(accentTextTheme); + switch (platform) { + case TargetPlatform.android: + case TargetPlatform.fuchsia: + case TargetPlatform.iOS: + materialTapTargetSize ??= MaterialTapTargetSize.padded; + break; + case TargetPlatform.linux: + case TargetPlatform.macOS: + case TargetPlatform.windows: + materialTapTargetSize ??= MaterialTapTargetSize.shrinkWrap; + break; + } + applyElevationOverlayColor ??= false; + + // Used as the default color (fill color) for RaisedButtons. Computing the + // default for ButtonThemeData for the sake of backwards compatibility. + buttonColor ??= isDark ? primarySwatch[600]! : Colors.grey[300]!; + focusColor ??= isDark ? Colors.white.withOpacity(0.12) : Colors.black.withOpacity(0.12); + hoverColor ??= isDark ? Colors.white.withOpacity(0.04) : Colors.black.withOpacity(0.04); buttonTheme ??= ButtonThemeData( colorScheme: colorScheme, - buttonColor: isDark ? primarySwatch[600]! : Colors.grey[300]!, + buttonColor: buttonColor, disabledColor: disabledColor, focusColor: focusColor, hoverColor: hoverColor, + highlightColor: highlightColor, + splashColor: splashColor, materialTapTargetSize: materialTapTargetSize, ); + toggleButtonsTheme ??= const ToggleButtonsThemeData(); + disabledColor ??= isDark ? Colors.white38 : Colors.black38; + highlightColor ??= isDark ? _kDarkThemeHighlightColor : _kLightThemeHighlightColor; + splashColor ??= isDark ? _kDarkThemeSplashColor : _kLightThemeSplashColor; + + sliderTheme ??= const SliderThemeData(); + tabBarTheme ??= const TabBarTheme(); + tooltipTheme ??= const TooltipThemeData(); + appBarTheme ??= const AppBarTheme(); + scrollbarTheme ??= const ScrollbarThemeData(); + bottomAppBarTheme ??= const BottomAppBarTheme(); cardTheme ??= const CardTheme(); - checkboxTheme ??= const CheckboxThemeData(); chipTheme ??= ChipThemeData.fromDefaults( secondaryColor: isDark ? Colors.tealAccent[200]! : primaryColor, brightness: colorScheme.brightness, labelStyle: textTheme.bodyText1!, ); - dataTableTheme ??= const DataTableThemeData(); dialogTheme ??= const DialogTheme(); - dividerTheme ??= const DividerThemeData(); - drawerTheme ??= const DrawerThemeData(); - elevatedButtonTheme ??= const ElevatedButtonThemeData(); floatingActionButtonTheme ??= const FloatingActionButtonThemeData(); - listTileTheme ??= const ListTileThemeData(); navigationBarTheme ??= const NavigationBarThemeData(); navigationRailTheme ??= const NavigationRailThemeData(); - outlinedButtonTheme ??= const OutlinedButtonThemeData(); - popupMenuTheme ??= const PopupMenuThemeData(); - progressIndicatorTheme ??= const ProgressIndicatorThemeData(); - radioTheme ??= const RadioThemeData(); - sliderTheme ??= const SliderThemeData(); + cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); snackBarTheme ??= const SnackBarThemeData(); - switchTheme ??= const SwitchThemeData(); - tabBarTheme ??= const TabBarTheme(); - textButtonTheme ??= const TextButtonThemeData(); - textSelectionTheme ??= const TextSelectionThemeData(); + bottomSheetTheme ??= const BottomSheetThemeData(); + popupMenuTheme ??= const PopupMenuThemeData(); + bannerTheme ??= const MaterialBannerThemeData(); + dividerTheme ??= const DividerThemeData(); + buttonBarTheme ??= const ButtonBarThemeData(); + bottomNavigationBarTheme ??= const BottomNavigationBarThemeData(); timePickerTheme ??= const TimePickerThemeData(); - toggleButtonsTheme ??= const ToggleButtonsThemeData(); - tooltipTheme ??= const TooltipThemeData(); - // DEPRECATED (newest deprecations at the bottom) - useTextSelectionTheme ??= true; - textSelectionColor ??= isDark ? accentColor : primarySwatch[200]!; - cursorColor = cursorColor ?? const Color.fromRGBO(66, 133, 244, 1.0); - textSelectionHandleColor ??= isDark ? Colors.tealAccent[400]! : primarySwatch[300]!; - accentTextTheme = defaultAccentTextTheme.merge(accentTextTheme); - accentIconTheme ??= accentIsDark - ? const IconThemeData(color: Colors.white) - : const IconThemeData(color: Colors.black); - // Used as the default color (fill color) for RaisedButtons. Computing the - // default for ButtonThemeData for the sake of backwards compatibility. - buttonColor ??= isDark ? primarySwatch[600]! : Colors.grey[300]!; + textButtonTheme ??= const TextButtonThemeData(); + elevatedButtonTheme ??= const ElevatedButtonThemeData(); + outlinedButtonTheme ??= const OutlinedButtonThemeData(); + textSelectionTheme ??= const TextSelectionThemeData(); + dataTableTheme ??= const DataTableThemeData(); + checkboxTheme ??= const CheckboxThemeData(); + radioTheme ??= const RadioThemeData(); + switchTheme ??= const SwitchThemeData(); + progressIndicatorTheme ??= const ProgressIndicatorThemeData(); + drawerTheme ??= const DrawerThemeData(); + listTileTheme ??= const ListTileThemeData(); + fixTextFieldOutlineLabel ??= true; + useTextSelectionTheme ??= true; return ThemeData.raw( - // GENERAL CONFIGURATION - androidOverscrollIndicator: androidOverscrollIndicator, - applyElevationOverlayColor: applyElevationOverlayColor, - cupertinoOverrideTheme: cupertinoOverrideTheme, - inputDecorationTheme: inputDecorationTheme, - materialTapTargetSize: materialTapTargetSize, - pageTransitionsTheme: pageTransitionsTheme, - platform: platform, - scrollbarTheme: scrollbarTheme, - splashFactory: splashFactory, visualDensity: visualDensity, - // COLOR - colorScheme: colorScheme, primaryColor: primaryColor, primaryColorBrightness: primaryColorBrightness, primaryColorLight: primaryColorLight, primaryColorDark: primaryColorDark, - focusColor: focusColor, - hoverColor: hoverColor, - shadowColor: shadowColor, + accentColor: accentColor, + accentColorBrightness: accentColorBrightness, canvasColor: canvasColor, + shadowColor: shadowColor, scaffoldBackgroundColor: scaffoldBackgroundColor, bottomAppBarColor: bottomAppBarColor, cardColor: cardColor, dividerColor: dividerColor, + focusColor: focusColor, + hoverColor: hoverColor, highlightColor: highlightColor, splashColor: splashColor, + splashFactory: splashFactory, selectedRowColor: selectedRowColor, unselectedWidgetColor: unselectedWidgetColor, disabledColor: disabledColor, + buttonTheme: buttonTheme, + buttonColor: buttonColor, + toggleButtonsTheme: toggleButtonsTheme, + toggleableActiveColor: toggleableActiveColor, secondaryHeaderColor: secondaryHeaderColor, + textSelectionColor: textSelectionColor, + cursorColor: cursorColor, + textSelectionHandleColor: textSelectionHandleColor, backgroundColor: backgroundColor, dialogBackgroundColor: dialogBackgroundColor, indicatorColor: indicatorColor, hintColor: hintColor, errorColor: errorColor, - toggleableActiveColor: toggleableActiveColor, - // TYPOGRAPHY & ICONOGRAPHY - typography: typography, textTheme: textTheme, primaryTextTheme: primaryTextTheme, + accentTextTheme: accentTextTheme, + inputDecorationTheme: inputDecorationTheme, iconTheme: iconTheme, primaryIconTheme: primaryIconTheme, - // COMPONENT THEMES - appBarTheme: appBarTheme, - bannerTheme: bannerTheme, - bottomAppBarTheme: bottomAppBarTheme, - bottomNavigationBarTheme: bottomNavigationBarTheme, - bottomSheetTheme: bottomSheetTheme, - buttonBarTheme: buttonBarTheme, - buttonTheme: buttonTheme, + accentIconTheme: accentIconTheme, + sliderTheme: sliderTheme, + tabBarTheme: tabBarTheme, + tooltipTheme: tooltipTheme, cardTheme: cardTheme, - checkboxTheme: checkboxTheme, chipTheme: chipTheme, - dataTableTheme: dataTableTheme, + platform: platform, + materialTapTargetSize: materialTapTargetSize, + applyElevationOverlayColor: applyElevationOverlayColor, + pageTransitionsTheme: pageTransitionsTheme, + appBarTheme: appBarTheme, + scrollbarTheme: scrollbarTheme, + bottomAppBarTheme: bottomAppBarTheme, + colorScheme: colorScheme, dialogTheme: dialogTheme, - dividerTheme: dividerTheme, - drawerTheme: drawerTheme, - elevatedButtonTheme: elevatedButtonTheme, floatingActionButtonTheme: floatingActionButtonTheme, - listTileTheme: listTileTheme, navigationBarTheme: navigationBarTheme, navigationRailTheme: navigationRailTheme, - outlinedButtonTheme: outlinedButtonTheme, - popupMenuTheme: popupMenuTheme, - progressIndicatorTheme: progressIndicatorTheme, - radioTheme: radioTheme, - sliderTheme: sliderTheme, + typography: typography, + cupertinoOverrideTheme: cupertinoOverrideTheme, snackBarTheme: snackBarTheme, - switchTheme: switchTheme, - tabBarTheme: tabBarTheme, - textButtonTheme: textButtonTheme, - textSelectionTheme: textSelectionTheme, + bottomSheetTheme: bottomSheetTheme, + popupMenuTheme: popupMenuTheme, + bannerTheme: bannerTheme, + dividerTheme: dividerTheme, + buttonBarTheme: buttonBarTheme, + bottomNavigationBarTheme: bottomNavigationBarTheme, timePickerTheme: timePickerTheme, - toggleButtonsTheme: toggleButtonsTheme, - tooltipTheme: tooltipTheme, - // DEPRECATED (newest deprecations at the bottom) - useTextSelectionTheme: useTextSelectionTheme, - textSelectionColor: textSelectionColor, - cursorColor: cursorColor, - textSelectionHandleColor: textSelectionHandleColor, - accentColor: accentColor, - accentColorBrightness: accentColorBrightness, - accentTextTheme: accentTextTheme, - accentIconTheme: accentIconTheme, - buttonColor: buttonColor, + textButtonTheme: textButtonTheme, + elevatedButtonTheme: elevatedButtonTheme, + outlinedButtonTheme: outlinedButtonTheme, + textSelectionTheme: textSelectionTheme, + dataTableTheme: dataTableTheme, + checkboxTheme: checkboxTheme, + radioTheme: radioTheme, + switchTheme: switchTheme, + progressIndicatorTheme: progressIndicatorTheme, + drawerTheme: drawerTheme, + listTileTheme: listTileTheme, fixTextFieldOutlineLabel: fixTextFieldOutlineLabel, + useTextSelectionTheme: useTextSelectionTheme, + androidOverscrollIndicator: androidOverscrollIndicator, ); } @@ -613,91 +589,47 @@ class ThemeData with Diagnosticable { // Warning: make sure these properties are in the exact same order as in // operator == and in the hashValues method and in the order of fields // in this class, and in the lerp() method. - // GENERAL CONFIGURATION - required this.androidOverscrollIndicator, - required this.applyElevationOverlayColor, - required this.cupertinoOverrideTheme, - required this.inputDecorationTheme, - required this.materialTapTargetSize, - required this.pageTransitionsTheme, - required this.platform, - required this.scrollbarTheme, - required this.splashFactory, 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.colorScheme, required this.primaryColor, required this.primaryColorBrightness, required this.primaryColorLight, required this.primaryColorDark, - required this.focusColor, - required this.hoverColor, - required this.shadowColor, required this.canvasColor, + required this.shadowColor, + @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, required this.scaffoldBackgroundColor, required this.bottomAppBarColor, required this.cardColor, required this.dividerColor, + required this.focusColor, + required this.hoverColor, required this.highlightColor, required this.splashColor, + required this.splashFactory, 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, - // 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.', + 'This feature was deprecated after v2.3.0-0.2.pre.', ) - required this.useTextSelectionTheme, + required this.buttonColor, + required this.toggleButtonsTheme, + required this.secondaryHeaderColor, @Deprecated( 'Use TextSelectionThemeData.selectionColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.', @@ -713,20 +645,14 @@ class ThemeData with Diagnosticable { '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, + required this.backgroundColor, + required this.dialogBackgroundColor, + required this.indicatorColor, + required this.hintColor, + required this.errorColor, + required this.toggleableActiveColor, + required this.textTheme, + required this.primaryTextTheme, @Deprecated( 'No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' @@ -734,6 +660,9 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v2.3.0-0.1.pre.', ) required this.accentTextTheme, + required this.inputDecorationTheme, + required this.iconTheme, + required this.primaryIconTheme, @Deprecated( 'No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' @@ -741,101 +670,133 @@ class ThemeData with Diagnosticable { '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, + required this.sliderTheme, + required this.tabBarTheme, + required this.tooltipTheme, + required this.cardTheme, + required this.chipTheme, + required this.platform, + required this.materialTapTargetSize, + required this.applyElevationOverlayColor, + required this.pageTransitionsTheme, + required this.appBarTheme, + required this.scrollbarTheme, + required this.bottomAppBarTheme, + required this.colorScheme, + required this.dialogTheme, + required this.floatingActionButtonTheme, + required this.navigationBarTheme, + required this.navigationRailTheme, + required this.typography, + required this.cupertinoOverrideTheme, + required this.snackBarTheme, + required this.bottomSheetTheme, + required this.popupMenuTheme, + required this.bannerTheme, + required this.dividerTheme, + required this.buttonBarTheme, + required this.bottomNavigationBarTheme, + required this.timePickerTheme, + required this.textButtonTheme, + required this.elevatedButtonTheme, + required this.outlinedButtonTheme, + required this.textSelectionTheme, + required this.dataTableTheme, + required this.checkboxTheme, + required this.radioTheme, + required this.switchTheme, + required this.progressIndicatorTheme, + required this.drawerTheme, + required this.listTileTheme, @Deprecated( 'This "fix" is now enabled by default. ' 'This feature was deprecated after v2.5.0-1.0.pre.', ) required this.fixTextFieldOutlineLabel, - }) : // GENERAL CONFIGURATION - assert(applyElevationOverlayColor != null), - assert(inputDecorationTheme != null), - assert(materialTapTargetSize != null), - assert(pageTransitionsTheme != null), - assert(platform != null), - assert(scrollbarTheme != null), - assert(splashFactory != null), - assert(visualDensity != null), - // COLOR - assert(colorScheme != null), + @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, + required this.androidOverscrollIndicator, + }) : assert(visualDensity != null), assert(primaryColor != null), assert(primaryColorBrightness != null), assert(primaryColorLight != null), assert(primaryColorDark != null), - assert(focusColor != null), - assert(hoverColor != null), - assert(shadowColor != null), + assert(accentColor != null), + assert(accentColorBrightness != null), assert(canvasColor != null), + assert(shadowColor != null), assert(scaffoldBackgroundColor != null), assert(bottomAppBarColor != null), assert(cardColor != null), assert(dividerColor != null), + assert(focusColor != null), + assert(hoverColor != null), assert(highlightColor != null), assert(splashColor != null), + assert(splashFactory != null), assert(selectedRowColor != null), assert(unselectedWidgetColor != null), assert(disabledColor != null), + assert(toggleableActiveColor != null), + assert(buttonTheme != null), + assert(toggleButtonsTheme != null), assert(secondaryHeaderColor != null), + assert(textSelectionColor != null), + assert(cursorColor != null), + assert(textSelectionHandleColor != 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(accentTextTheme != null), + assert(inputDecorationTheme != 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(accentIconTheme != null), + assert(sliderTheme != null), + assert(tabBarTheme != null), + assert(tooltipTheme != null), assert(cardTheme != null), - assert(checkboxTheme != null), assert(chipTheme != null), - assert(dataTableTheme != null), + assert(platform != null), + assert(materialTapTargetSize != null), + assert(pageTransitionsTheme != null), + assert(appBarTheme != null), + assert(scrollbarTheme != null), + assert(bottomAppBarTheme != null), + assert(colorScheme != 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(typography != null), assert(snackBarTheme != null), - assert(switchTheme != null), - assert(tabBarTheme != null), - assert(textButtonTheme != null), - assert(textSelectionTheme != null), + assert(bottomSheetTheme != null), + assert(popupMenuTheme != null), + assert(bannerTheme != null), + assert(dividerTheme != null), + assert(buttonBarTheme != null), + assert(bottomNavigationBarTheme != null), assert(timePickerTheme != null), - assert(toggleButtonsTheme != null), - assert(tooltipTheme != 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(textButtonTheme != null), + assert(elevatedButtonTheme != null), + assert(outlinedButtonTheme != null), + assert(textSelectionTheme != null), + assert(dataTableTheme != null), + assert(checkboxTheme != null), + assert(radioTheme != null), + assert(switchTheme != null), + assert(progressIndicatorTheme != null), + assert(drawerTheme != null), + assert(listTileTheme != null), + assert(fixTextFieldOutlineLabel != null), + assert(useTextSelectionTheme != null); /// Create a [ThemeData] based on the colors in the given [colorScheme] and /// text styles of the optional [textTheme]. @@ -869,6 +830,8 @@ class ThemeData with Diagnosticable { required ColorScheme colorScheme, TextTheme? textTheme, }) { + assert(colorScheme != null); + final bool isDark = colorScheme.brightness == Brightness.dark; // For surfaces that use primary color in light themes and surface color in dark @@ -876,7 +839,6 @@ class ThemeData with Diagnosticable { final Color onPrimarySurfaceColor = isDark ? colorScheme.onSurface : colorScheme.onPrimary; return ThemeData( - colorScheme: colorScheme, brightness: colorScheme.brightness, primaryColor: primarySurfaceColor, primaryColorBrightness: ThemeData.estimateBrightnessForColor(primarySurfaceColor), @@ -889,10 +851,11 @@ class ThemeData with Diagnosticable { dividerColor: colorScheme.onSurface.withOpacity(0.12), backgroundColor: colorScheme.background, dialogBackgroundColor: colorScheme.background, - indicatorColor: onPrimarySurfaceColor, errorColor: colorScheme.error, textTheme: textTheme, + indicatorColor: onPrimarySurfaceColor, applyElevationOverlayColor: isDark, + colorScheme: colorScheme, ); } @@ -919,6 +882,10 @@ class ThemeData with Diagnosticable { /// text geometry. factory ThemeData.fallback() => ThemeData.light(); + // Warning: make sure these properties are in the exact same order as in + // hashValues() and in the raw constructor and in the order of fields in + // the class and in the lerp() method. + /// The overall theme brightness. /// /// The default [TextStyle] color for the [textTheme] is black if the @@ -926,130 +893,6 @@ class ThemeData with Diagnosticable { /// theme is constructed with [Brightness.dark]. Brightness get brightness => colorScheme.brightness; - // Warning: make sure these properties are in the exact same order as in - // hashValues() and in the raw constructor and in the order of fields in - // the class and in the lerp() method. - - // GENERAL CONFIGURATION - - /// Specifies which overscroll indicator to use on [TargetPlatform.android]. - /// - /// When null, the default value of - /// [MaterialScrollBehavior.androidOverscrollIndicator] is - /// [AndroidOverscrollIndicator.glow]. - /// - /// See also: - /// - /// * [StretchingOverscrollIndicator], a material design edge effect - /// that transforms the contents of a scrollable when overscrolled. - /// * [GlowingOverscrollIndicator], an edge effect that paints a glow - /// over the contents of a scrollable when overscrolled. - final AndroidOverscrollIndicator? androidOverscrollIndicator; - - /// Apply a semi-transparent overlay color on Material surfaces to indicate - /// elevation for dark themes. - /// - /// Material drop shadows can be difficult to see in a dark theme, so the - /// elevation of a surface should be portrayed with an "overlay" in addition - /// to the shadow. As the elevation of the component increases, the - /// overlay increases in opacity. [applyElevationOverlayColor] turns the - /// application of this overlay on or off for dark themes. - /// - /// If true and [brightness] is [Brightness.dark], a - /// semi-transparent version of [ColorScheme.onSurface] will be - /// applied on top of [Material] widgets that have a [ColorScheme.surface] - /// color. The level of transparency is based on [Material.elevation] as - /// per the Material Dark theme specification. - /// - /// If false the surface color will be used unmodified. - /// - /// Defaults to false in order to maintain backwards compatibility with - /// apps that were built before the Material Dark theme specification - /// was published. New apps should set this to true for any themes - /// where [brightness] is [Brightness.dark]. - /// - /// See also: - /// - /// * [Material.elevation], which effects the level of transparency of the - /// overlay color. - /// * [ElevationOverlay.applyOverlay], which is used by [Material] to apply - /// the overlay color to its surface color. - /// * , which specifies how - /// the overlay should be applied. - final bool applyElevationOverlayColor; - - /// Components of the [CupertinoThemeData] to override from the Material - /// [ThemeData] adaptation. - /// - /// By default, [cupertinoOverrideTheme] is null and Cupertino widgets - /// descendant to the Material [Theme] will adhere to a [CupertinoTheme] - /// derived from the Material [ThemeData]. e.g. [ThemeData]'s [ColorScheme] - /// will also inform the [CupertinoThemeData]'s `primaryColor` etc. - /// - /// This cascading effect for individual attributes of the [CupertinoThemeData] - /// can be overridden using attributes of this [cupertinoOverrideTheme]. - final NoDefaultCupertinoThemeData? cupertinoOverrideTheme; - - /// The default [InputDecoration] values for [InputDecorator], [TextField], - /// and [TextFormField] are based on this theme. - /// - /// See [InputDecoration.applyDefaults]. - final InputDecorationTheme inputDecorationTheme; - - /// Configures the hit test size of certain Material widgets. - /// - /// Defaults to a [platform]-appropriate size: [MaterialTapTargetSize.padded] - /// on mobile platforms, [MaterialTapTargetSize.shrinkWrap] on desktop - /// platforms. - final MaterialTapTargetSize materialTapTargetSize; - - /// Default [MaterialPageRoute] transitions per [TargetPlatform]. - /// - /// [MaterialPageRoute.buildTransitions] delegates to a [platform] specific - /// [PageTransitionsBuilder]. If a matching builder is not found, a builder - /// whose platform is null is used. - final PageTransitionsTheme pageTransitionsTheme; - - /// The platform the material widgets should adapt to target. - /// - /// Defaults to the current platform, as exposed by [defaultTargetPlatform]. - /// This should be used in order to style UI elements according to platform - /// conventions. - /// - /// Widgets from the material library should use this getter (via [Theme.of]) - /// to determine the current platform for the purpose of emulating the - /// platform behavior (e.g. scrolling or haptic effects). Widgets and render - /// objects at lower layers that try to emulate the underlying platform - /// platform can depend on [defaultTargetPlatform] directly, or may require - /// that the target platform be provided as an argument. The - /// [dart:io.Platform] object should only be used directly when it's critical - /// to actually know the current platform, without any overrides possible (for - /// example, when a system API is about to be called). - /// - /// In a test environment, the platform returned is [TargetPlatform.android] - /// regardless of the host platform. (Android was chosen because the tests - /// were originally written assuming Android-like behavior, and we added - /// platform adaptations for other platforms later). Tests can check behavior - /// for other platforms by setting the [platform] of the [Theme] explicitly to - /// another [TargetPlatform] value, or by setting - /// [debugDefaultTargetPlatformOverride]. - /// - /// Determines the defaults for [typography] and [materialTapTargetSize]. - final TargetPlatform platform; - - /// A theme for customizing the colors, thickness, and shape of [Scrollbar]s. - final ScrollbarThemeData scrollbarTheme; - - /// Defines the appearance of ink splashes produces by [InkWell] - /// and [InkResponse]. - /// - /// See also: - /// - /// * [InkSplash.splashFactory], which defines the default splash. - /// * [InkRipple.splashFactory], which defines a splash that spreads out - /// more aggressively than the default. - final InteractiveInkFeatureFactory splashFactory; - /// The density value for specifying the compactness of various UI components. /// /// {@template flutter.material.themedata.visualDensity} @@ -1079,18 +922,6 @@ class ThemeData with Diagnosticable { /// {@endtemplate} final VisualDensity visualDensity; - // COLOR - - /// A set of twelve colors that can be used to configure the - /// color properties of most components. - /// - /// This property was added much later than the theme's set of highly - /// specific colors, like [cardColor], [buttonColor], [canvasColor] etc. - /// New components can be defined exclusively in terms of [colorScheme]. - /// Existing components will gradually migrate to it, to the extent - /// that is possible without significant backwards compatibility breaks. - final ColorScheme colorScheme; - /// The background color for major parts of the app (toolbars, tab bars, etc) /// /// The theme's [colorScheme] property contains [ColorScheme.primary], as @@ -1109,12 +940,8 @@ class ThemeData with Diagnosticable { /// A darker version of the [primaryColor]. final Color primaryColorDark; - /// The focus color used indicate that a component has the input focus. - final Color focusColor; - - /// The hover color used to indicate when a pointer is hovering over a - /// component. - final Color hoverColor; + /// The default color of [MaterialType.canvas] [Material]. + final Color canvasColor; /// The color that the [Material] widget uses to draw elevation shadows. /// @@ -1127,247 +954,6 @@ class ThemeData with Diagnosticable { /// overlay on or off for dark themes. final Color shadowColor; - /// The default color of [MaterialType.canvas] [Material]. - final Color canvasColor; - - /// The default color of the [Material] that underlies the [Scaffold]. The - /// background color for a typical material app or a page within the app. - final Color scaffoldBackgroundColor; - - /// The default color of the [BottomAppBar]. - /// - /// This can be overridden by specifying [BottomAppBar.color]. - final Color bottomAppBarColor; - - /// The color of [Material] when it is used as a [Card]. - final Color cardColor; - - /// The color of [Divider]s and [PopupMenuDivider]s, also used - /// between [ListTile]s, between rows in [DataTable]s, and so forth. - /// - /// To create an appropriate [BorderSide] that uses this color, consider - /// [Divider.createBorderSide]. - final Color dividerColor; - - /// The highlight color used during ink splash animations or to - /// indicate an item in a menu is selected. - final Color highlightColor; - - /// The color of ink splashes. - /// - /// See also: - /// * [splashFactory], which defines the appearance of the splash. - final Color splashColor; - - /// The color used to highlight selected rows. - final Color selectedRowColor; - - /// The color used for widgets in their inactive (but enabled) - /// state. For example, an unchecked checkbox. See also [disabledColor]. - final Color unselectedWidgetColor; - - /// The color used for widgets that are inoperative, regardless of - /// their state. For example, a disabled checkbox (which may be - /// checked or unchecked). - final Color disabledColor; - - /// The color of the header of a [PaginatedDataTable] when there are selected rows. - // According to the spec for data tables: - // https://material.io/archive/guidelines/components/data-tables.html#data-tables-tables-within-cards - // ...this should be the "50-value of secondary app color". - final Color secondaryHeaderColor; - - /// A color that contrasts with the [primaryColor], e.g. used as the - /// remaining part of a progress bar. - final Color backgroundColor; - - /// The background color of [Dialog] elements. - final Color dialogBackgroundColor; - - /// The color of the selected tab indicator in a tab bar. - final Color indicatorColor; - - /// The color to use for hint text or placeholder text, e.g. in - /// [TextField] fields. - final Color hintColor; - - /// The color to use for input validation errors, e.g. in [TextField] fields. - final Color errorColor; - - /// The color used to highlight the active states of toggleable widgets like - /// [Switch], [Radio], and [Checkbox]. - final Color toggleableActiveColor; - - // TYPOGRAPHY & ICONOGRAPHY - - /// The color and geometry [TextTheme] values used to configure [textTheme]. - /// - /// Defaults to a [platform]-appropriate typography. - final Typography typography; - - /// Text with a color that contrasts with the card and canvas colors. - final TextTheme textTheme; - - /// A text theme that contrasts with the primary color. - final TextTheme primaryTextTheme; - - /// An icon theme that contrasts with the card and canvas colors. - final IconThemeData iconTheme; - - /// An icon theme that contrasts with the primary color. - final IconThemeData primaryIconTheme; - - // COMPONENT THEMES - - /// A theme for customizing the color, elevation, brightness, iconTheme and - /// textTheme of [AppBar]s. - final AppBarTheme appBarTheme; - - /// A theme for customizing the color and text style of a [MaterialBanner]. - final MaterialBannerThemeData bannerTheme; - - /// A theme for customizing the shape, elevation, and color of a [BottomAppBar]. - final BottomAppBarTheme bottomAppBarTheme; - - /// A theme for customizing the appearance and layout of [BottomNavigationBar] - /// widgets. - final BottomNavigationBarThemeData bottomNavigationBarTheme; - - /// A theme for customizing the color, elevation, and shape of a bottom sheet. - final BottomSheetThemeData bottomSheetTheme; - - /// A theme for customizing the appearance and layout of [ButtonBar] widgets. - final ButtonBarThemeData buttonBarTheme; - - /// Defines the default configuration of button widgets, like [RaisedButton] - /// and [FlatButton]. - final ButtonThemeData buttonTheme; - - /// The colors and styles used to render [Card]. - /// - /// This is the value returned from [CardTheme.of]. - final CardTheme cardTheme; - - /// A theme for customizing the appearance and layout of [Checkbox] widgets. - final CheckboxThemeData checkboxTheme; - - /// The colors and styles used to render [Chip]s. - /// - /// This is the value returned from [ChipTheme.of]. - final ChipThemeData chipTheme; - - /// A theme for customizing the appearance and layout of [DataTable] - /// widgets. - final DataTableThemeData dataTableTheme; - - /// A theme for customizing the shape of a dialog. - final DialogTheme dialogTheme; - - /// A theme for customizing the color, thickness, and indents of [Divider]s, - /// [VerticalDivider]s, etc. - final DividerThemeData dividerTheme; - - /// A theme for customizing the appearance and layout of [Drawer] widgets. - final DrawerThemeData drawerTheme; - - /// A theme for customizing the appearance and internal layout of - /// [ElevatedButton]s. - final ElevatedButtonThemeData elevatedButtonTheme; - - /// A theme for customizing the shape, elevation, and color of a - /// [FloatingActionButton]. - final FloatingActionButtonThemeData floatingActionButtonTheme; - - /// A theme for customizing the appearance of [ListTile] widgets. - final ListTileThemeData listTileTheme; - - /// A theme for customizing the background color, text style, and icon themes - /// of a [NavigationBar]. - final NavigationBarThemeData navigationBarTheme; - - /// A theme for customizing the background color, elevation, text style, and - /// icon themes of a [NavigationRail]. - final NavigationRailThemeData navigationRailTheme; - - /// A theme for customizing the appearance and internal layout of - /// [OutlinedButton]s. - final OutlinedButtonThemeData outlinedButtonTheme; - - /// A theme for customizing the color, shape, elevation, and text style of - /// popup menus. - final PopupMenuThemeData popupMenuTheme; - - /// A theme for customizing the appearance and layout of [ProgressIndicator] widgets. - final ProgressIndicatorThemeData progressIndicatorTheme; - - /// A theme for customizing the appearance and layout of [Radio] widgets. - final RadioThemeData radioTheme; - - /// The colors and shapes used to render [Slider]. - /// - /// This is the value returned from [SliderTheme.of]. - final SliderThemeData sliderTheme; - - /// A theme for customizing colors, shape, elevation, and behavior of a [SnackBar]. - final SnackBarThemeData snackBarTheme; - - /// A theme for customizing the appearance and layout of [Switch] widgets. - final SwitchThemeData switchTheme; - - /// A theme for customizing the size, shape, and color of the tab bar indicator. - final TabBarTheme tabBarTheme; - - /// A theme for customizing the appearance and internal layout of - /// [TextButton]s. - final TextButtonThemeData textButtonTheme; - - /// A theme for customizing the appearance and layout of [TextField] widgets. - final TextSelectionThemeData textSelectionTheme; - - /// A theme for customizing the appearance and layout of time picker widgets. - final TimePickerThemeData timePickerTheme; - - /// Defines the default configuration of [ToggleButtons] widgets. - final ToggleButtonsThemeData toggleButtonsTheme; - - /// A theme for customizing the visual properties of [Tooltip]s. - /// - /// This is the value returned from [TooltipTheme.of]. - final TooltipThemeData tooltipTheme; - - // DEPRECATED (newest deprecations at the bottom) - - /// A temporary flag that was used to opt-in to the new [TextSelectionTheme] - /// during the migration to this new theme. That migration is now complete - /// and this flag is not longer used by the framework. Please remove any - /// reference to this property, as it will be removed in future releases. - @Deprecated( - 'No longer used by the framework, please remove any reference to it. ' - 'This feature was deprecated after v1.23.0-4.0.pre.', - ) - final bool useTextSelectionTheme; - - /// The color of text selections in text fields, such as [TextField]. - @Deprecated( - 'Use TextSelectionThemeData.selectionColor instead. ' - 'This feature was deprecated after v1.26.0-18.0.pre.', - ) - final Color textSelectionColor; - - /// The color of cursors in Material-style text fields, such as [TextField]. - @Deprecated( - 'Use TextSelectionThemeData.cursorColor instead. ' - 'This feature was deprecated after v1.26.0-18.0.pre.', - ) - final Color cursorColor; - - /// The color of the handles used to adjust what part of the text is currently selected. - @Deprecated( - 'Use TextSelectionThemeData.selectionHandleColor instead. ' - 'This feature was deprecated after v1.26.0-18.0.pre.', - ) - final Color textSelectionHandleColor; - /// Obsolete property that was originally used as the foreground /// color for widgets (knobs, text, overscroll edge effect, etc). /// @@ -1403,6 +989,129 @@ class ThemeData with Diagnosticable { ) final Brightness accentColorBrightness; + /// The default color of the [Material] that underlies the [Scaffold]. The + /// background color for a typical material app or a page within the app. + final Color scaffoldBackgroundColor; + + /// The default color of the [BottomAppBar]. + /// + /// This can be overridden by specifying [BottomAppBar.color]. + final Color bottomAppBarColor; + + /// The color of [Material] when it is used as a [Card]. + final Color cardColor; + + /// The color of [Divider]s and [PopupMenuDivider]s, also used + /// between [ListTile]s, between rows in [DataTable]s, and so forth. + /// + /// To create an appropriate [BorderSide] that uses this color, consider + /// [Divider.createBorderSide]. + final Color dividerColor; + + /// The focus color used indicate that a component has the input focus. + final Color focusColor; + + /// The hover color used to indicate when a pointer is hovering over a + /// component. + final Color hoverColor; + + /// The highlight color used during ink splash animations or to + /// indicate an item in a menu is selected. + final Color highlightColor; + + /// The color of ink splashes. See [InkWell]. + final Color splashColor; + + /// Defines the appearance of ink splashes produces by [InkWell] + /// and [InkResponse]. + /// + /// See also: + /// + /// * [InkSplash.splashFactory], which defines the default splash. + /// * [InkRipple.splashFactory], which defines a splash that spreads out + /// more aggressively than the default. + final InteractiveInkFeatureFactory splashFactory; + + /// The color used to highlight selected rows. + final Color selectedRowColor; + + /// The color used for widgets in their inactive (but enabled) + /// state. For example, an unchecked checkbox. See also [disabledColor]. + final Color unselectedWidgetColor; + + /// The color used for widgets that are inoperative, regardless of + /// their state. For example, a disabled checkbox (which may be + /// checked or unchecked). + final Color disabledColor; + + /// Defines the default configuration of button widgets, like [RaisedButton] + /// and [FlatButton]. + final ButtonThemeData buttonTheme; + + /// Defines the default configuration of [ToggleButtons] widgets. + final ToggleButtonsThemeData toggleButtonsTheme; + + /// The default fill color of the [Material] used in [RaisedButton]s. + @Deprecated( + 'No longer used by the framework, please remove any reference to it. ' + 'This feature was deprecated after v2.3.0-0.2.pre.', + ) + final Color buttonColor; + + /// The color of the header of a [PaginatedDataTable] when there are selected rows. + // According to the spec for data tables: + // https://material.io/archive/guidelines/components/data-tables.html#data-tables-tables-within-cards + // ...this should be the "50-value of secondary app color". + final Color secondaryHeaderColor; + + /// The color of text selections in text fields, such as [TextField]. + @Deprecated( + 'Use TextSelectionThemeData.selectionColor instead. ' + 'This feature was deprecated after v1.26.0-18.0.pre.', + ) + final Color textSelectionColor; + + /// The color of cursors in Material-style text fields, such as [TextField]. + @Deprecated( + 'Use TextSelectionThemeData.cursorColor instead. ' + 'This feature was deprecated after v1.26.0-18.0.pre.', + ) + final Color cursorColor; + + /// The color of the handles used to adjust what part of the text is currently selected. + @Deprecated( + 'Use TextSelectionThemeData.selectionHandleColor instead. ' + 'This feature was deprecated after v1.26.0-18.0.pre.', + ) + final Color textSelectionHandleColor; + + /// A color that contrasts with the [primaryColor], e.g. used as the + /// remaining part of a progress bar. + final Color backgroundColor; + + /// The background color of [Dialog] elements. + final Color dialogBackgroundColor; + + /// The color of the selected tab indicator in a tab bar. + final Color indicatorColor; + + /// The color to use for hint text or placeholder text, e.g. in + /// [TextField] fields. + final Color hintColor; + + /// The color to use for input validation errors, e.g. in [TextField] fields. + final Color errorColor; + + /// The color used to highlight the active states of toggleable widgets like + /// [Switch], [Radio], and [Checkbox]. + final Color toggleableActiveColor; + + /// Text with a color that contrasts with the card and canvas colors. + final TextTheme textTheme; + + /// A text theme that contrasts with the primary color. + final TextTheme primaryTextTheme; + /// Obsolete property that was originally used when a [TextTheme] /// that contrasted well with the [accentColor] was needed. /// @@ -1426,6 +1135,18 @@ class ThemeData with Diagnosticable { ) final TextTheme accentTextTheme; + /// The default [InputDecoration] values for [InputDecorator], [TextField], + /// and [TextFormField] are based on this theme. + /// + /// See [InputDecoration.applyDefaults]. + final InputDecorationTheme inputDecorationTheme; + + /// An icon theme that contrasts with the card and canvas colors. + final IconThemeData iconTheme; + + /// An icon theme that contrasts with the primary color. + final IconThemeData primaryIconTheme; + /// Obsolete property that was originally used when an [IconTheme] /// that contrasted well with the [accentColor] was needed. /// @@ -1440,12 +1161,209 @@ class ThemeData with Diagnosticable { ) final IconThemeData accentIconTheme; - /// The default fill color of the [Material] used in [RaisedButton]s. - @Deprecated( - 'No longer used by the framework, please remove any reference to it. ' - 'This feature was deprecated after v2.3.0-0.2.pre.', - ) - final Color buttonColor; + /// The colors and shapes used to render [Slider]. + /// + /// This is the value returned from [SliderTheme.of]. + final SliderThemeData sliderTheme; + + /// A theme for customizing the size, shape, and color of the tab bar indicator. + final TabBarTheme tabBarTheme; + + /// A theme for customizing the visual properties of [Tooltip]s. + /// + /// This is the value returned from [TooltipTheme.of]. + final TooltipThemeData tooltipTheme; + + /// The colors and styles used to render [Card]. + /// + /// This is the value returned from [CardTheme.of]. + final CardTheme cardTheme; + + /// The colors and styles used to render [Chip]s. + /// + /// This is the value returned from [ChipTheme.of]. + final ChipThemeData chipTheme; + + /// The platform the material widgets should adapt to target. + /// + /// Defaults to the current platform, as exposed by [defaultTargetPlatform]. + /// This should be used in order to style UI elements according to platform + /// conventions. + /// + /// Widgets from the material library should use this getter (via [Theme.of]) + /// to determine the current platform for the purpose of emulating the + /// platform behavior (e.g. scrolling or haptic effects). Widgets and render + /// objects at lower layers that try to emulate the underlying platform + /// platform can depend on [defaultTargetPlatform] directly, or may require + /// that the target platform be provided as an argument. The + /// [dart:io.Platform] object should only be used directly when it's critical + /// to actually know the current platform, without any overrides possible (for + /// example, when a system API is about to be called). + /// + /// In a test environment, the platform returned is [TargetPlatform.android] + /// regardless of the host platform. (Android was chosen because the tests + /// were originally written assuming Android-like behavior, and we added + /// platform adaptations for other platforms later). Tests can check behavior + /// for other platforms by setting the [platform] of the [Theme] explicitly to + /// another [TargetPlatform] value, or by setting + /// [debugDefaultTargetPlatformOverride]. + final TargetPlatform platform; + + /// Configures the hit test size of certain Material widgets. + final MaterialTapTargetSize materialTapTargetSize; + + /// Apply a semi-transparent overlay color on Material surfaces to indicate + /// elevation for dark themes. + /// + /// Material drop shadows can be difficult to see in a dark theme, so the + /// elevation of a surface should be portrayed with an "overlay" in addition + /// to the shadow. As the elevation of the component increases, the + /// overlay increases in opacity. [applyElevationOverlayColor] turns the + /// application of this overlay on or off for dark themes. + /// + /// If true and [brightness] is [Brightness.dark], a + /// semi-transparent version of [ColorScheme.onSurface] will be + /// applied on top of [Material] widgets that have a [ColorScheme.surface] + /// color. The level of transparency is based on [Material.elevation] as + /// per the Material Dark theme specification. + /// + /// If false the surface color will be used unmodified. + /// + /// Defaults to false in order to maintain backwards compatibility with + /// apps that were built before the Material Dark theme specification + /// was published. New apps should set this to true for any themes + /// where [brightness] is [Brightness.dark]. + /// + /// See also: + /// + /// * [Material.elevation], which effects the level of transparency of the + /// overlay color. + /// * [ElevationOverlay.applyOverlay], which is used by [Material] to apply + /// the overlay color to its surface color. + /// * , which specifies how + /// the overlay should be applied. + final bool applyElevationOverlayColor; + + /// Default [MaterialPageRoute] transitions per [TargetPlatform]. + /// + /// [MaterialPageRoute.buildTransitions] delegates to a [platform] specific + /// [PageTransitionsBuilder]. If a matching builder is not found, a builder + /// whose platform is null is used. + final PageTransitionsTheme pageTransitionsTheme; + + /// A theme for customizing the color, elevation, brightness, iconTheme and + /// textTheme of [AppBar]s. + final AppBarTheme appBarTheme; + + /// A theme for customizing the colors, thickness, and shape of [Scrollbar]s. + final ScrollbarThemeData scrollbarTheme; + + /// A theme for customizing the shape, elevation, and color of a [BottomAppBar]. + final BottomAppBarTheme bottomAppBarTheme; + + /// A set of thirteen colors that can be used to configure the + /// color properties of most components. + /// + /// This property was added much later than the theme's set of highly + /// specific colors, like [cardColor], [buttonColor], [canvasColor] etc. + /// New components can be defined exclusively in terms of [colorScheme]. + /// Existing components will gradually migrate to it, to the extent + /// that is possible without significant backwards compatibility breaks. + final ColorScheme colorScheme; + + /// A theme for customizing colors, shape, elevation, and behavior of a [SnackBar]. + final SnackBarThemeData snackBarTheme; + + /// A theme for customizing the shape of a dialog. + final DialogTheme dialogTheme; + + /// A theme for customizing the shape, elevation, and color of a + /// [FloatingActionButton]. + final FloatingActionButtonThemeData floatingActionButtonTheme; + + /// A theme for customizing the background color, text style, and icon themes + /// of a [NavigationBar]. + final NavigationBarThemeData navigationBarTheme; + + /// A theme for customizing the background color, elevation, text style, and + /// icon themes of a [NavigationRail]. + final NavigationRailThemeData navigationRailTheme; + + /// The color and geometry [TextTheme] values used to configure [textTheme]. + final Typography typography; + + /// Components of the [CupertinoThemeData] to override from the Material + /// [ThemeData] adaptation. + /// + /// By default, [cupertinoOverrideTheme] is null and Cupertino widgets + /// descendant to the Material [Theme] will adhere to a [CupertinoTheme] + /// derived from the Material [ThemeData]. e.g. [ThemeData]'s [ColorScheme] + /// will also inform the [CupertinoThemeData]'s `primaryColor` etc. + /// + /// This cascading effect for individual attributes of the [CupertinoThemeData] + /// can be overridden using attributes of this [cupertinoOverrideTheme]. + final NoDefaultCupertinoThemeData? cupertinoOverrideTheme; + + /// A theme for customizing the color, elevation, and shape of a bottom sheet. + final BottomSheetThemeData bottomSheetTheme; + + /// A theme for customizing the color, shape, elevation, and text style of + /// popup menus. + final PopupMenuThemeData popupMenuTheme; + + /// A theme for customizing the color and text style of a [MaterialBanner]. + final MaterialBannerThemeData bannerTheme; + + /// A theme for customizing the color, thickness, and indents of [Divider]s, + /// [VerticalDivider]s, etc. + final DividerThemeData dividerTheme; + + /// A theme for customizing the appearance and layout of [ButtonBar] widgets. + final ButtonBarThemeData buttonBarTheme; + + /// A theme for customizing the appearance and layout of [BottomNavigationBar] + /// widgets. + final BottomNavigationBarThemeData bottomNavigationBarTheme; + + /// A theme for customizing the appearance and layout of time picker widgets. + final TimePickerThemeData timePickerTheme; + + /// A theme for customizing the appearance and internal layout of + /// [TextButton]s. + final TextButtonThemeData textButtonTheme; + + /// A theme for customizing the appearance and internal layout of + /// [ElevatedButton]s. + final ElevatedButtonThemeData elevatedButtonTheme; + + /// A theme for customizing the appearance and internal layout of + /// [OutlinedButton]s. + final OutlinedButtonThemeData outlinedButtonTheme; + + /// A theme for customizing the appearance and layout of [TextField] widgets. + final TextSelectionThemeData textSelectionTheme; + + /// A theme for customizing the appearance and layout of [DataTable] + /// widgets. + final DataTableThemeData dataTableTheme; + + /// A theme for customizing the appearance and layout of [Checkbox] widgets. + final CheckboxThemeData checkboxTheme; + + /// A theme for customizing the appearance and layout of [Radio] widgets. + final RadioThemeData radioTheme; + + /// A theme for customizing the appearance and layout of [Switch] widgets. + final SwitchThemeData switchTheme; + + /// A theme for customizing the appearance and layout of [ProgressIndicator] widgets. + final ProgressIndicatorThemeData progressIndicatorTheme; + + /// A theme for customizing the appearance and layout of [Drawer] widgets. + final DrawerThemeData drawerTheme; + + /// A theme for customizing the appearance of [ListTile] widgets. + final ListTileThemeData listTileTheme; /// An obsolete flag to allow apps to opt-out of a /// [small fix](https://github.com/flutter/flutter/issues/54028) for the Y @@ -1461,96 +1379,76 @@ class ThemeData with Diagnosticable { ) final bool fixTextFieldOutlineLabel; + /// A temporary flag that was used to opt-in to the new [TextSelectionTheme] + /// during the migration to this new theme. That migration is now complete + /// and this flag is not longer used by the framework. Please remove any + /// reference to this property, as it will be removed in future releases. + @Deprecated( + 'No longer used by the framework, please remove any reference to it. ' + 'This feature was deprecated after v1.23.0-4.0.pre.', + ) + final bool useTextSelectionTheme; + + /// Specifies which overscroll indicator to use on [TargetPlatform.android]. + /// + /// When null, the default value of + /// [MaterialScrollBehavior.androidOverscrollIndicator] is + /// [AndroidOverscrollIndicator.glow]. + /// + /// See also: + /// + /// * [StretchingOverscrollIndicator], a material design edge effect + /// that transforms the contents of a scrollable when overscrolled. + /// * [GlowingOverscrollIndicator], an edge effect that paints a glow + /// over the contents of a scrollable when overscrolled. + final AndroidOverscrollIndicator? androidOverscrollIndicator; + /// Creates a copy of this theme but with the given fields replaced with the new values. /// /// The [brightness] value is applied to the [colorScheme]. ThemeData copyWith({ - // GENERAL CONFIGURATION - AndroidOverscrollIndicator? androidOverscrollIndicator, - bool? applyElevationOverlayColor, - NoDefaultCupertinoThemeData? cupertinoOverrideTheme, - InputDecorationTheme? inputDecorationTheme, - MaterialTapTargetSize? materialTapTargetSize, - PageTransitionsTheme? pageTransitionsTheme, - TargetPlatform? platform, - ScrollbarThemeData? scrollbarTheme, - InteractiveInkFeatureFactory? splashFactory, - VisualDensity? 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. - ColorScheme? colorScheme, Brightness? brightness, + VisualDensity? visualDensity, Color? primaryColor, Brightness? primaryColorBrightness, Color? primaryColorLight, Color? primaryColorDark, - Color? focusColor, - Color? hoverColor, - Color? shadowColor, + @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.', + ) + 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, 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? secondaryHeaderColor, - Color? backgroundColor, - Color? dialogBackgroundColor, - Color? indicatorColor, - Color? hintColor, - Color? errorColor, - Color? toggleableActiveColor, - // TYPOGRAPHY & ICONOGRAPHY - Typography? typography, - TextTheme? textTheme, - TextTheme? primaryTextTheme, - IconThemeData? iconTheme, - IconThemeData? primaryIconTheme, - // COMPONENT THEMES - AppBarTheme? appBarTheme, - MaterialBannerThemeData? bannerTheme, - BottomAppBarTheme? bottomAppBarTheme, - BottomNavigationBarThemeData? bottomNavigationBarTheme, - BottomSheetThemeData? bottomSheetTheme, - ButtonBarThemeData? buttonBarTheme, ButtonThemeData? buttonTheme, - CardTheme? cardTheme, - CheckboxThemeData? checkboxTheme, - ChipThemeData? chipTheme, - DataTableThemeData? dataTableTheme, - DialogTheme? dialogTheme, - DividerThemeData? dividerTheme, - DrawerThemeData? drawerTheme, - ElevatedButtonThemeData? elevatedButtonTheme, - FloatingActionButtonThemeData? floatingActionButtonTheme, - ListTileThemeData? listTileTheme, - NavigationBarThemeData? navigationBarTheme, - NavigationRailThemeData? navigationRailTheme, - OutlinedButtonThemeData? outlinedButtonTheme, - PopupMenuThemeData? popupMenuTheme, - ProgressIndicatorThemeData? progressIndicatorTheme, - RadioThemeData? radioTheme, - SliderThemeData? sliderTheme, - SnackBarThemeData? snackBarTheme, - SwitchThemeData? switchTheme, - TabBarTheme? tabBarTheme, - TextButtonThemeData? textButtonTheme, - TextSelectionThemeData? textSelectionTheme, - TimePickerThemeData? timePickerTheme, ToggleButtonsThemeData? toggleButtonsTheme, - TooltipThemeData? tooltipTheme, - // 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.', + 'This feature was deprecated after v2.3.0-0.2.pre.', ) - bool? useTextSelectionTheme, + Color? buttonColor, + Color? secondaryHeaderColor, @Deprecated( 'Use TextSelectionThemeData.selectionColor instead. ' 'This feature was deprecated after v1.26.0-18.0.pre.', @@ -1566,20 +1464,14 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v1.26.0-18.0.pre.', ) Color? textSelectionHandleColor, - @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.', - ) - 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, + Color? backgroundColor, + Color? dialogBackgroundColor, + Color? indicatorColor, + Color? hintColor, + Color? errorColor, + Color? toggleableActiveColor, + TextTheme? textTheme, + TextTheme? primaryTextTheme, @Deprecated( 'No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' @@ -1587,6 +1479,9 @@ class ThemeData with Diagnosticable { 'This feature was deprecated after v2.3.0-0.1.pre.', ) TextTheme? accentTextTheme, + InputDecorationTheme? inputDecorationTheme, + IconThemeData? iconTheme, + IconThemeData? primaryIconTheme, @Deprecated( 'No longer used by the framework, please remove any reference to it. ' 'For more information, consult the migration guide at ' @@ -1594,106 +1489,140 @@ class ThemeData with Diagnosticable { '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, + 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, + NavigationBarThemeData? navigationBarTheme, + 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, + ProgressIndicatorThemeData? progressIndicatorTheme, + DrawerThemeData? drawerTheme, + ListTileThemeData? listTileTheme, @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 v1.23.0-4.0.pre.', + ) + bool? useTextSelectionTheme, + AndroidOverscrollIndicator? androidOverscrollIndicator, }) { cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); return ThemeData.raw( - // GENERAL CONFIGURATION - androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator, - applyElevationOverlayColor: applyElevationOverlayColor ?? this.applyElevationOverlayColor, - cupertinoOverrideTheme: cupertinoOverrideTheme ?? this.cupertinoOverrideTheme, - inputDecorationTheme: inputDecorationTheme ?? this.inputDecorationTheme, - materialTapTargetSize: materialTapTargetSize ?? this.materialTapTargetSize, - pageTransitionsTheme: pageTransitionsTheme ?? this.pageTransitionsTheme, - platform: platform ?? this.platform, - scrollbarTheme: scrollbarTheme ?? this.scrollbarTheme, - splashFactory: splashFactory ?? this.splashFactory, visualDensity: visualDensity ?? this.visualDensity, - // COLOR - colorScheme: (colorScheme ?? this.colorScheme).copyWith(brightness: brightness), primaryColor: primaryColor ?? this.primaryColor, primaryColorBrightness: primaryColorBrightness ?? this.primaryColorBrightness, primaryColorLight: primaryColorLight ?? this.primaryColorLight, primaryColorDark: primaryColorDark ?? this.primaryColorDark, - focusColor: focusColor ?? this.focusColor, - hoverColor: hoverColor ?? this.hoverColor, - shadowColor: shadowColor ?? this.shadowColor, + accentColor: accentColor ?? this.accentColor, + accentColorBrightness: accentColorBrightness ?? this.accentColorBrightness, canvasColor: canvasColor ?? this.canvasColor, + shadowColor: shadowColor ?? this.shadowColor, scaffoldBackgroundColor: scaffoldBackgroundColor ?? this.scaffoldBackgroundColor, bottomAppBarColor: bottomAppBarColor ?? this.bottomAppBarColor, cardColor: cardColor ?? this.cardColor, dividerColor: dividerColor ?? this.dividerColor, + focusColor: focusColor ?? this.focusColor, + hoverColor: hoverColor ?? this.hoverColor, highlightColor: highlightColor ?? this.highlightColor, splashColor: splashColor ?? this.splashColor, + splashFactory: splashFactory ?? this.splashFactory, selectedRowColor: selectedRowColor ?? this.selectedRowColor, unselectedWidgetColor: unselectedWidgetColor ?? this.unselectedWidgetColor, disabledColor: disabledColor ?? this.disabledColor, + buttonColor: buttonColor ?? this.buttonColor, + buttonTheme: buttonTheme ?? this.buttonTheme, + toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme, secondaryHeaderColor: secondaryHeaderColor ?? this.secondaryHeaderColor, + textSelectionColor: textSelectionColor ?? this.textSelectionColor, + cursorColor: cursorColor ?? this.cursorColor, + textSelectionHandleColor: textSelectionHandleColor ?? this.textSelectionHandleColor, backgroundColor: backgroundColor ?? this.backgroundColor, dialogBackgroundColor: dialogBackgroundColor ?? this.dialogBackgroundColor, indicatorColor: indicatorColor ?? this.indicatorColor, hintColor: hintColor ?? this.hintColor, errorColor: errorColor ?? this.errorColor, toggleableActiveColor: toggleableActiveColor ?? this.toggleableActiveColor, - // TYPOGRAPHY & ICONOGRAPHY - typography: typography ?? this.typography, textTheme: textTheme ?? this.textTheme, primaryTextTheme: primaryTextTheme ?? this.primaryTextTheme, + accentTextTheme: accentTextTheme ?? this.accentTextTheme, + inputDecorationTheme: inputDecorationTheme ?? this.inputDecorationTheme, iconTheme: iconTheme ?? this.iconTheme, primaryIconTheme: primaryIconTheme ?? this.primaryIconTheme, - // COMPONENT THEMES - appBarTheme: appBarTheme ?? this.appBarTheme, - bannerTheme: bannerTheme ?? this.bannerTheme, - bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme, - bottomNavigationBarTheme: bottomNavigationBarTheme ?? this.bottomNavigationBarTheme, - bottomSheetTheme: bottomSheetTheme ?? this.bottomSheetTheme, - buttonBarTheme: buttonBarTheme ?? this.buttonBarTheme, - buttonTheme: buttonTheme ?? this.buttonTheme, + accentIconTheme: accentIconTheme ?? this.accentIconTheme, + sliderTheme: sliderTheme ?? this.sliderTheme, + tabBarTheme: tabBarTheme ?? this.tabBarTheme, + tooltipTheme: tooltipTheme ?? this.tooltipTheme, cardTheme: cardTheme ?? this.cardTheme, - checkboxTheme: checkboxTheme ?? this.checkboxTheme, chipTheme: chipTheme ?? this.chipTheme, - dataTableTheme: dataTableTheme ?? this.dataTableTheme, + platform: platform ?? this.platform, + materialTapTargetSize: materialTapTargetSize ?? this.materialTapTargetSize, + applyElevationOverlayColor: applyElevationOverlayColor ?? this.applyElevationOverlayColor, + pageTransitionsTheme: pageTransitionsTheme ?? this.pageTransitionsTheme, + appBarTheme: appBarTheme ?? this.appBarTheme, + scrollbarTheme: scrollbarTheme ?? this.scrollbarTheme, + bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme, + colorScheme: (colorScheme ?? this.colorScheme).copyWith(brightness: brightness), dialogTheme: dialogTheme ?? this.dialogTheme, - dividerTheme: dividerTheme ?? this.dividerTheme, - drawerTheme: drawerTheme ?? this.drawerTheme, - elevatedButtonTheme: elevatedButtonTheme ?? this.elevatedButtonTheme, floatingActionButtonTheme: floatingActionButtonTheme ?? this.floatingActionButtonTheme, - listTileTheme: listTileTheme ?? this.listTileTheme, navigationBarTheme: navigationBarTheme ?? this.navigationBarTheme, navigationRailTheme: navigationRailTheme ?? this.navigationRailTheme, - outlinedButtonTheme: outlinedButtonTheme ?? this.outlinedButtonTheme, - popupMenuTheme: popupMenuTheme ?? this.popupMenuTheme, - progressIndicatorTheme: progressIndicatorTheme ?? this.progressIndicatorTheme, - radioTheme: radioTheme ?? this.radioTheme, - sliderTheme: sliderTheme ?? this.sliderTheme, + typography: typography ?? this.typography, + cupertinoOverrideTheme: cupertinoOverrideTheme ?? this.cupertinoOverrideTheme, snackBarTheme: snackBarTheme ?? this.snackBarTheme, - switchTheme: switchTheme ?? this.switchTheme, - tabBarTheme: tabBarTheme ?? this.tabBarTheme, - textButtonTheme: textButtonTheme ?? this.textButtonTheme, - textSelectionTheme: textSelectionTheme ?? this.textSelectionTheme, + bottomSheetTheme: bottomSheetTheme ?? this.bottomSheetTheme, + popupMenuTheme: popupMenuTheme ?? this.popupMenuTheme, + bannerTheme: bannerTheme ?? this.bannerTheme, + dividerTheme: dividerTheme ?? this.dividerTheme, + buttonBarTheme: buttonBarTheme ?? this.buttonBarTheme, + bottomNavigationBarTheme: bottomNavigationBarTheme ?? this.bottomNavigationBarTheme, timePickerTheme: timePickerTheme ?? this.timePickerTheme, - toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme, - tooltipTheme: tooltipTheme ?? this.tooltipTheme, - // DEPRECATED (newest deprecations at the bottom) - useTextSelectionTheme: useTextSelectionTheme ?? this.useTextSelectionTheme, - textSelectionColor: textSelectionColor ?? this.textSelectionColor, - cursorColor: cursorColor ?? this.cursorColor, - textSelectionHandleColor: textSelectionHandleColor ?? this.textSelectionHandleColor, - accentColor: accentColor ?? this.accentColor, - accentColorBrightness: accentColorBrightness ?? this.accentColorBrightness, - accentTextTheme: accentTextTheme ?? this.accentTextTheme, - accentIconTheme: accentIconTheme ?? this.accentIconTheme, - buttonColor: buttonColor ?? this.buttonColor, + textButtonTheme: textButtonTheme ?? this.textButtonTheme, + elevatedButtonTheme: elevatedButtonTheme ?? this.elevatedButtonTheme, + outlinedButtonTheme: outlinedButtonTheme ?? this.outlinedButtonTheme, + textSelectionTheme: textSelectionTheme ?? this.textSelectionTheme, + dataTableTheme: dataTableTheme ?? this.dataTableTheme, + checkboxTheme: checkboxTheme ?? this.checkboxTheme, + radioTheme: radioTheme ?? this.radioTheme, + switchTheme: switchTheme ?? this.switchTheme, + progressIndicatorTheme: progressIndicatorTheme ?? this.progressIndicatorTheme, + drawerTheme: drawerTheme ?? this.drawerTheme, + listTileTheme: listTileTheme ?? this.listTileTheme, fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? this.fixTextFieldOutlineLabel, + useTextSelectionTheme: useTextSelectionTheme ?? this.useTextSelectionTheme, + androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator, ); } @@ -1775,93 +1704,88 @@ class ThemeData with Diagnosticable { // hashValues() and in the raw constructor and in the order of fields in // the class and in the lerp() method. return ThemeData.raw( - // GENERAL CONFIGURATION - androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator, - applyElevationOverlayColor:t < 0.5 ? a.applyElevationOverlayColor : b.applyElevationOverlayColor, - cupertinoOverrideTheme:t < 0.5 ? a.cupertinoOverrideTheme : b.cupertinoOverrideTheme, - inputDecorationTheme:t < 0.5 ? a.inputDecorationTheme : b.inputDecorationTheme, - materialTapTargetSize:t < 0.5 ? a.materialTapTargetSize : b.materialTapTargetSize, - pageTransitionsTheme:t < 0.5 ? a.pageTransitionsTheme : b.pageTransitionsTheme, - platform: t < 0.5 ? a.platform : b.platform, - scrollbarTheme: ScrollbarThemeData.lerp(a.scrollbarTheme, b.scrollbarTheme, t), - splashFactory: t < 0.5 ? a.splashFactory : b.splashFactory, visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t), - // COLOR - colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t), primaryColor: Color.lerp(a.primaryColor, b.primaryColor, t)!, primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness, primaryColorLight: Color.lerp(a.primaryColorLight, b.primaryColorLight, t)!, primaryColorDark: Color.lerp(a.primaryColorDark, b.primaryColorDark, t)!, - focusColor: Color.lerp(a.focusColor, b.focusColor, t)!, - hoverColor: Color.lerp(a.hoverColor, b.hoverColor, t)!, - shadowColor: Color.lerp(a.shadowColor, b.shadowColor, t)!, canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!, + shadowColor: Color.lerp(a.shadowColor, b.shadowColor, t)!, + accentColor: Color.lerp(a.accentColor, b.accentColor, t)!, + accentColorBrightness: t < 0.5 ? a.accentColorBrightness : b.accentColorBrightness, scaffoldBackgroundColor: Color.lerp(a.scaffoldBackgroundColor, b.scaffoldBackgroundColor, t)!, bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t)!, cardColor: Color.lerp(a.cardColor, b.cardColor, t)!, dividerColor: Color.lerp(a.dividerColor, b.dividerColor, t)!, + focusColor: Color.lerp(a.focusColor, b.focusColor, t)!, + hoverColor: Color.lerp(a.hoverColor, b.hoverColor, t)!, highlightColor: Color.lerp(a.highlightColor, b.highlightColor, t)!, splashColor: Color.lerp(a.splashColor, b.splashColor, t)!, + splashFactory: t < 0.5 ? a.splashFactory : b.splashFactory, selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, t)!, unselectedWidgetColor: Color.lerp(a.unselectedWidgetColor, b.unselectedWidgetColor, t)!, disabledColor: Color.lerp(a.disabledColor, b.disabledColor, t)!, + buttonTheme: t < 0.5 ? a.buttonTheme : b.buttonTheme, + buttonColor: Color.lerp(a.buttonColor, b.buttonColor, t)!, + toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!, secondaryHeaderColor: Color.lerp(a.secondaryHeaderColor, b.secondaryHeaderColor, t)!, + textSelectionColor: Color.lerp(a.textSelectionColor, b.textSelectionColor, t)!, + cursorColor: Color.lerp(a.cursorColor, b.cursorColor, t)!, + textSelectionHandleColor: Color.lerp(a.textSelectionHandleColor, b.textSelectionHandleColor, t)!, backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t)!, dialogBackgroundColor: Color.lerp(a.dialogBackgroundColor, b.dialogBackgroundColor, t)!, indicatorColor: Color.lerp(a.indicatorColor, b.indicatorColor, t)!, hintColor: Color.lerp(a.hintColor, b.hintColor, t)!, errorColor: Color.lerp(a.errorColor, b.errorColor, t)!, toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t)!, - // TYPOGRAPHY & ICONOGRAPHY - typography: Typography.lerp(a.typography, b.typography, t), textTheme: TextTheme.lerp(a.textTheme, b.textTheme, t), primaryTextTheme: TextTheme.lerp(a.primaryTextTheme, b.primaryTextTheme, t), + accentTextTheme: TextTheme.lerp(a.accentTextTheme, b.accentTextTheme, t), + inputDecorationTheme: t < 0.5 ? a.inputDecorationTheme : b.inputDecorationTheme, iconTheme: IconThemeData.lerp(a.iconTheme, b.iconTheme, t), primaryIconTheme: IconThemeData.lerp(a.primaryIconTheme, b.primaryIconTheme, t), - // COMPONENT THEMES - appBarTheme: AppBarTheme.lerp(a.appBarTheme, b.appBarTheme, t), - bannerTheme: MaterialBannerThemeData.lerp(a.bannerTheme, b.bannerTheme, t), - bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t), - bottomNavigationBarTheme: BottomNavigationBarThemeData.lerp(a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t), - bottomSheetTheme: BottomSheetThemeData.lerp(a.bottomSheetTheme, b.bottomSheetTheme, t)!, - buttonBarTheme: ButtonBarThemeData.lerp(a.buttonBarTheme, b.buttonBarTheme, t)!, - buttonTheme: t < 0.5 ? a.buttonTheme : b.buttonTheme, + accentIconTheme: IconThemeData.lerp(a.accentIconTheme, b.accentIconTheme, t), + sliderTheme: SliderThemeData.lerp(a.sliderTheme, b.sliderTheme, t), + tabBarTheme: TabBarTheme.lerp(a.tabBarTheme, b.tabBarTheme, t), + tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!, cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t), - checkboxTheme: CheckboxThemeData.lerp(a.checkboxTheme, b.checkboxTheme, t), chipTheme: ChipThemeData.lerp(a.chipTheme, b.chipTheme, t)!, - dataTableTheme: DataTableThemeData.lerp(a.dataTableTheme, b.dataTableTheme, t), + platform: t < 0.5 ? a.platform : b.platform, + materialTapTargetSize: t < 0.5 ? a.materialTapTargetSize : b.materialTapTargetSize, + applyElevationOverlayColor: t < 0.5 ? a.applyElevationOverlayColor : b.applyElevationOverlayColor, + pageTransitionsTheme: t < 0.5 ? a.pageTransitionsTheme : b.pageTransitionsTheme, + appBarTheme: AppBarTheme.lerp(a.appBarTheme, b.appBarTheme, t), + scrollbarTheme: ScrollbarThemeData.lerp(a.scrollbarTheme, b.scrollbarTheme, t), + bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t), + colorScheme: ColorScheme.lerp(a.colorScheme, b.colorScheme, t), dialogTheme: DialogTheme.lerp(a.dialogTheme, b.dialogTheme, t), - dividerTheme: DividerThemeData.lerp(a.dividerTheme, b.dividerTheme, t), - drawerTheme: DrawerThemeData.lerp(a.drawerTheme, b.drawerTheme, t)!, - elevatedButtonTheme: ElevatedButtonThemeData.lerp(a.elevatedButtonTheme, b.elevatedButtonTheme, t)!, floatingActionButtonTheme: FloatingActionButtonThemeData.lerp(a.floatingActionButtonTheme, b.floatingActionButtonTheme, t)!, - listTileTheme: ListTileThemeData.lerp(a.listTileTheme, b.listTileTheme, t)!, navigationBarTheme: NavigationBarThemeData.lerp(a.navigationBarTheme, b.navigationBarTheme, t)!, navigationRailTheme: NavigationRailThemeData.lerp(a.navigationRailTheme, b.navigationRailTheme, t)!, - outlinedButtonTheme: OutlinedButtonThemeData.lerp(a.outlinedButtonTheme, b.outlinedButtonTheme, t)!, - popupMenuTheme: PopupMenuThemeData.lerp(a.popupMenuTheme, b.popupMenuTheme, t)!, - progressIndicatorTheme: ProgressIndicatorThemeData.lerp(a.progressIndicatorTheme, b.progressIndicatorTheme, t)!, - radioTheme: RadioThemeData.lerp(a.radioTheme, b.radioTheme, t), - sliderTheme: SliderThemeData.lerp(a.sliderTheme, b.sliderTheme, t), + typography: Typography.lerp(a.typography, b.typography, t), + cupertinoOverrideTheme: t < 0.5 ? a.cupertinoOverrideTheme : b.cupertinoOverrideTheme, snackBarTheme: SnackBarThemeData.lerp(a.snackBarTheme, b.snackBarTheme, t), - switchTheme: SwitchThemeData.lerp(a.switchTheme, b.switchTheme, t), - tabBarTheme: TabBarTheme.lerp(a.tabBarTheme, b.tabBarTheme, t), - textButtonTheme: TextButtonThemeData.lerp(a.textButtonTheme, b.textButtonTheme, t)!, - textSelectionTheme: TextSelectionThemeData.lerp(a.textSelectionTheme, b.textSelectionTheme, t)!, + bottomSheetTheme: BottomSheetThemeData.lerp(a.bottomSheetTheme, b.bottomSheetTheme, t)!, + popupMenuTheme: PopupMenuThemeData.lerp(a.popupMenuTheme, b.popupMenuTheme, t)!, + bannerTheme: MaterialBannerThemeData.lerp(a.bannerTheme, b.bannerTheme, t), + dividerTheme: DividerThemeData.lerp(a.dividerTheme, b.dividerTheme, t), + buttonBarTheme: ButtonBarThemeData.lerp(a.buttonBarTheme, b.buttonBarTheme, t)!, + bottomNavigationBarTheme: BottomNavigationBarThemeData.lerp(a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t), timePickerTheme: TimePickerThemeData.lerp(a.timePickerTheme, b.timePickerTheme, t), - toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!, - tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!, - // DEPRECATED (newest deprecations at the bottom) - useTextSelectionTheme: t < 0.5 ? a.useTextSelectionTheme : b.useTextSelectionTheme, - textSelectionColor: Color.lerp(a.textSelectionColor, b.textSelectionColor, t)!, - cursorColor: Color.lerp(a.cursorColor, b.cursorColor, t)!, - textSelectionHandleColor: Color.lerp(a.textSelectionHandleColor, b.textSelectionHandleColor, t)!, - accentColor: Color.lerp(a.accentColor, b.accentColor, t)!, - accentColorBrightness: t < 0.5 ? a.accentColorBrightness : b.accentColorBrightness, - accentTextTheme: TextTheme.lerp(a.accentTextTheme, b.accentTextTheme, t), - accentIconTheme: IconThemeData.lerp(a.accentIconTheme, b.accentIconTheme, t), - buttonColor: Color.lerp(a.buttonColor, b.buttonColor, t)!, + textButtonTheme: TextButtonThemeData.lerp(a.textButtonTheme, b.textButtonTheme, t)!, + elevatedButtonTheme: ElevatedButtonThemeData.lerp(a.elevatedButtonTheme, b.elevatedButtonTheme, t)!, + outlinedButtonTheme: OutlinedButtonThemeData.lerp(a.outlinedButtonTheme, b.outlinedButtonTheme, t)!, + textSelectionTheme: TextSelectionThemeData.lerp(a.textSelectionTheme, b.textSelectionTheme, t)!, + dataTableTheme: DataTableThemeData.lerp(a.dataTableTheme, b.dataTableTheme, t), + checkboxTheme: CheckboxThemeData.lerp(a.checkboxTheme, b.checkboxTheme, t), + radioTheme: RadioThemeData.lerp(a.radioTheme, b.radioTheme, t), + switchTheme: SwitchThemeData.lerp(a.switchTheme, b.switchTheme, t), + progressIndicatorTheme: ProgressIndicatorThemeData.lerp(a.progressIndicatorTheme, b.progressIndicatorTheme, t)!, + drawerTheme: DrawerThemeData.lerp(a.drawerTheme, b.drawerTheme, t)!, + listTileTheme: ListTileThemeData.lerp(a.listTileTheme, b.listTileTheme, t)!, fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel, + useTextSelectionTheme: t < 0.5 ? a.useTextSelectionTheme : b.useTextSelectionTheme, + androidOverscrollIndicator: t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator, ); } @@ -1872,94 +1796,89 @@ class ThemeData with Diagnosticable { // Warning: make sure these properties are in the exact same order as in // hashValues() and in the raw constructor and in the order of fields in // the class and in the lerp() method. - return other is ThemeData && - // GENERAL CONFIGURATION - other.androidOverscrollIndicator == androidOverscrollIndicator && - other.applyElevationOverlayColor == applyElevationOverlayColor && - other.cupertinoOverrideTheme == cupertinoOverrideTheme && - other.inputDecorationTheme == inputDecorationTheme && - other.materialTapTargetSize == materialTapTargetSize && - other.pageTransitionsTheme == pageTransitionsTheme && - other.platform == platform && - other.scrollbarTheme == scrollbarTheme && - other.splashFactory == splashFactory && - other.visualDensity == visualDensity && - // COLOR - other.colorScheme == colorScheme && - other.primaryColor == primaryColor && - other.primaryColorBrightness == primaryColorBrightness && - other.primaryColorLight == primaryColorLight && - other.primaryColorDark == primaryColorDark && - other.focusColor == focusColor && - other.hoverColor == hoverColor && - other.shadowColor == shadowColor && - other.canvasColor == canvasColor && - other.scaffoldBackgroundColor == scaffoldBackgroundColor && - other.bottomAppBarColor == bottomAppBarColor && - other.cardColor == cardColor && - other.dividerColor == dividerColor && - other.highlightColor == highlightColor && - other.splashColor == splashColor && - other.selectedRowColor == selectedRowColor && - other.unselectedWidgetColor == unselectedWidgetColor && - other.disabledColor == disabledColor && - other.secondaryHeaderColor == secondaryHeaderColor && - other.backgroundColor == backgroundColor && - other.dialogBackgroundColor == dialogBackgroundColor && - other.indicatorColor == indicatorColor && - other.hintColor == hintColor && - other.errorColor == errorColor && - other.toggleableActiveColor == toggleableActiveColor && - // TYPOGRAPHY & ICONOGRAPHY - other.typography == typography && - other.textTheme == textTheme && - other.primaryTextTheme == primaryTextTheme && - other.iconTheme == iconTheme && - other.primaryIconTheme == primaryIconTheme && - // COMPONENT THEMES - other.appBarTheme == appBarTheme && - other.bannerTheme == bannerTheme && - other.bottomAppBarTheme == bottomAppBarTheme && - other.bottomNavigationBarTheme == bottomNavigationBarTheme && - other.bottomSheetTheme == bottomSheetTheme && - other.buttonBarTheme == buttonBarTheme && - other.buttonTheme == buttonTheme && - other.cardTheme == cardTheme && - other.checkboxTheme == checkboxTheme && - other.chipTheme == chipTheme && - other.dataTableTheme == dataTableTheme && - other.dialogTheme == dialogTheme && - other.dividerTheme == dividerTheme && - other.drawerTheme == drawerTheme && - other.elevatedButtonTheme == elevatedButtonTheme && - other.floatingActionButtonTheme == floatingActionButtonTheme && - other.listTileTheme == listTileTheme && - other.navigationBarTheme == navigationBarTheme && - other.navigationRailTheme == navigationRailTheme && - other.outlinedButtonTheme == outlinedButtonTheme && - other.popupMenuTheme == popupMenuTheme && - other.progressIndicatorTheme == progressIndicatorTheme && - other.radioTheme == radioTheme && - other.sliderTheme == sliderTheme && - other.snackBarTheme == snackBarTheme && - other.switchTheme == switchTheme && - other.tabBarTheme == tabBarTheme && - other.textButtonTheme == textButtonTheme && - other.textSelectionTheme == textSelectionTheme && - other.timePickerTheme == timePickerTheme && - other.toggleButtonsTheme == toggleButtonsTheme && - other.tooltipTheme == tooltipTheme && - // DEPRECATED (newest deprecations at the bottom) - other.useTextSelectionTheme == useTextSelectionTheme && - other.textSelectionColor == textSelectionColor && - other.cursorColor == cursorColor && - other.textSelectionHandleColor == textSelectionHandleColor && - other.accentColor == accentColor && - other.accentColorBrightness == accentColorBrightness && - other.accentTextTheme == accentTextTheme && - other.accentIconTheme == accentIconTheme && - other.buttonColor == buttonColor && - other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel; + return other is ThemeData + && other.visualDensity == visualDensity + && other.primaryColor == primaryColor + && other.primaryColorBrightness == primaryColorBrightness + && other.primaryColorLight == primaryColorLight + && other.primaryColorDark == primaryColorDark + && other.canvasColor == canvasColor + && other.shadowColor == shadowColor + && other.accentColor == accentColor + && other.accentColorBrightness == accentColorBrightness + && other.scaffoldBackgroundColor == scaffoldBackgroundColor + && other.bottomAppBarColor == bottomAppBarColor + && other.cardColor == cardColor + && other.dividerColor == dividerColor + && other.focusColor == focusColor + && other.hoverColor == hoverColor + && other.highlightColor == highlightColor + && other.splashColor == splashColor + && other.splashFactory == splashFactory + && other.selectedRowColor == selectedRowColor + && other.unselectedWidgetColor == unselectedWidgetColor + && other.disabledColor == disabledColor + && other.buttonTheme == buttonTheme + && other.buttonColor == buttonColor + && other.toggleButtonsTheme == toggleButtonsTheme + && other.secondaryHeaderColor == secondaryHeaderColor + && other.textSelectionColor == textSelectionColor + && other.cursorColor == cursorColor + && other.textSelectionHandleColor == textSelectionHandleColor + && other.backgroundColor == backgroundColor + && other.dialogBackgroundColor == dialogBackgroundColor + && other.indicatorColor == indicatorColor + && other.hintColor == hintColor + && other.errorColor == errorColor + && other.toggleableActiveColor == toggleableActiveColor + && other.textTheme == textTheme + && other.primaryTextTheme == primaryTextTheme + && other.accentTextTheme == accentTextTheme + && other.inputDecorationTheme == inputDecorationTheme + && other.iconTheme == iconTheme + && other.primaryIconTheme == primaryIconTheme + && other.accentIconTheme == accentIconTheme + && other.sliderTheme == sliderTheme + && other.tabBarTheme == tabBarTheme + && other.tooltipTheme == tooltipTheme + && other.cardTheme == cardTheme + && other.chipTheme == chipTheme + && other.platform == platform + && other.materialTapTargetSize == materialTapTargetSize + && other.applyElevationOverlayColor == applyElevationOverlayColor + && other.pageTransitionsTheme == pageTransitionsTheme + && other.appBarTheme == appBarTheme + && other.scrollbarTheme == scrollbarTheme + && other.bottomAppBarTheme == bottomAppBarTheme + && other.colorScheme == colorScheme + && other.dialogTheme == dialogTheme + && other.floatingActionButtonTheme == floatingActionButtonTheme + && other.navigationBarTheme == navigationBarTheme + && other.navigationRailTheme == navigationRailTheme + && other.typography == typography + && other.cupertinoOverrideTheme == cupertinoOverrideTheme + && other.snackBarTheme == snackBarTheme + && other.bottomSheetTheme == bottomSheetTheme + && other.popupMenuTheme == popupMenuTheme + && other.bannerTheme == bannerTheme + && other.dividerTheme == dividerTheme + && other.buttonBarTheme == buttonBarTheme + && other.bottomNavigationBarTheme == bottomNavigationBarTheme + && other.timePickerTheme == timePickerTheme + && other.textButtonTheme == textButtonTheme + && other.elevatedButtonTheme == elevatedButtonTheme + && other.outlinedButtonTheme == outlinedButtonTheme + && other.textSelectionTheme == textSelectionTheme + && other.dataTableTheme == dataTableTheme + && other.checkboxTheme == checkboxTheme + && other.radioTheme == radioTheme + && other.switchTheme == switchTheme + && other.progressIndicatorTheme == progressIndicatorTheme + && other.drawerTheme == drawerTheme + && other.listTileTheme == listTileTheme + && other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel + && other.useTextSelectionTheme == useTextSelectionTheme + && other.androidOverscrollIndicator == androidOverscrollIndicator; } @override @@ -1968,93 +1887,88 @@ class ThemeData with Diagnosticable { // are in the exact same order as in operator == and in the raw constructor // and in the order of fields in the class and in the lerp() method. final List values = [ - // GENERAL CONFIGURATION - androidOverscrollIndicator, - applyElevationOverlayColor, - cupertinoOverrideTheme, - inputDecorationTheme, - materialTapTargetSize, - pageTransitionsTheme, - platform, - scrollbarTheme, - splashFactory, visualDensity, - // COLOR - colorScheme, primaryColor, primaryColorBrightness, primaryColorLight, primaryColorDark, - focusColor, - hoverColor, - shadowColor, canvasColor, + shadowColor, + accentColor, + accentColorBrightness, scaffoldBackgroundColor, bottomAppBarColor, cardColor, dividerColor, + focusColor, + hoverColor, highlightColor, splashColor, + splashFactory, selectedRowColor, unselectedWidgetColor, disabledColor, + buttonTheme, + buttonColor, + toggleButtonsTheme, secondaryHeaderColor, + textSelectionColor, + cursorColor, + textSelectionHandleColor, backgroundColor, dialogBackgroundColor, indicatorColor, hintColor, errorColor, toggleableActiveColor, - // TYPOGRAPHY & ICONOGRAPHY - typography, textTheme, primaryTextTheme, + accentTextTheme, + inputDecorationTheme, iconTheme, primaryIconTheme, - // COMPONENT THEMES - appBarTheme, - bannerTheme, - bottomAppBarTheme, - bottomNavigationBarTheme, - bottomSheetTheme, - buttonBarTheme, - buttonTheme, + accentIconTheme, + sliderTheme, + tabBarTheme, + tooltipTheme, cardTheme, - checkboxTheme, chipTheme, - dataTableTheme, + platform, + materialTapTargetSize, + applyElevationOverlayColor, + pageTransitionsTheme, + appBarTheme, + scrollbarTheme, + bottomAppBarTheme, + colorScheme, dialogTheme, - dividerTheme, - drawerTheme, - elevatedButtonTheme, floatingActionButtonTheme, - listTileTheme, navigationBarTheme, navigationRailTheme, - outlinedButtonTheme, - popupMenuTheme, - progressIndicatorTheme, - radioTheme, - sliderTheme, + typography, + cupertinoOverrideTheme, snackBarTheme, - switchTheme, - tabBarTheme, - textButtonTheme, - textSelectionTheme, + bottomSheetTheme, + popupMenuTheme, + bannerTheme, + dividerTheme, + buttonBarTheme, + bottomNavigationBarTheme, timePickerTheme, - toggleButtonsTheme, - tooltipTheme, - // DEPRECATED (newest deprecations at the bottom) - useTextSelectionTheme, - textSelectionColor, - cursorColor, - textSelectionHandleColor, - accentColor, - accentColorBrightness, - accentTextTheme, - accentIconTheme, - buttonColor, + textButtonTheme, + elevatedButtonTheme, + outlinedButtonTheme, + textSelectionTheme, + dataTableTheme, + checkboxTheme, + radioTheme, + switchTheme, + progressIndicatorTheme, + drawerTheme, + listTileTheme, fixTextFieldOutlineLabel, + useTextSelectionTheme, + androidOverscrollIndicator, ]; return hashList(values); } @@ -2063,93 +1977,88 @@ class ThemeData with Diagnosticable { void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); final ThemeData defaultData = ThemeData.fallback(); - // GENERAL CONFIGURATION - properties.add(EnumProperty('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('applyElevationOverlayColor', applyElevationOverlayColor, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('cupertinoOverrideTheme', cupertinoOverrideTheme, defaultValue: defaultData.cupertinoOverrideTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('inputDecorationTheme', inputDecorationTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('materialTapTargetSize', materialTapTargetSize, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('pageTransitionsTheme', pageTransitionsTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('visualDensity', visualDensity, level: DiagnosticLevel.debug)); properties.add(EnumProperty('platform', platform, defaultValue: defaultTargetPlatform, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('scrollbarTheme', scrollbarTheme, defaultValue: defaultData.scrollbarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('splashFactory', splashFactory, defaultValue: defaultData.splashFactory, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('visualDensity', visualDensity, defaultValue: defaultData.visualDensity, level: DiagnosticLevel.debug)); - // COLORS - properties.add(DiagnosticsProperty('colorScheme', colorScheme, defaultValue: defaultData.colorScheme, level: DiagnosticLevel.debug)); properties.add(ColorProperty('primaryColor', primaryColor, defaultValue: defaultData.primaryColor, level: DiagnosticLevel.debug)); properties.add(EnumProperty('primaryColorBrightness', primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel.debug)); properties.add(ColorProperty('primaryColorLight', primaryColorLight, defaultValue: defaultData.primaryColorLight, level: DiagnosticLevel.debug)); properties.add(ColorProperty('primaryColorDark', primaryColorDark, defaultValue: defaultData.primaryColorDark, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('focusColor', focusColor, defaultValue: defaultData.focusColor, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('hoverColor', hoverColor, defaultValue: defaultData.hoverColor, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('shadowColor', shadowColor, defaultValue: defaultData.shadowColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('accentColor', accentColor, defaultValue: defaultData.accentColor, level: DiagnosticLevel.debug)); + properties.add(EnumProperty('accentColorBrightness', accentColorBrightness, defaultValue: defaultData.accentColorBrightness, level: DiagnosticLevel.debug)); properties.add(ColorProperty('canvasColor', canvasColor, defaultValue: defaultData.canvasColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('shadowColor', shadowColor, defaultValue: defaultData.shadowColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('scaffoldBackgroundColor', scaffoldBackgroundColor, defaultValue: defaultData.scaffoldBackgroundColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('bottomAppBarColor', bottomAppBarColor, defaultValue: defaultData.bottomAppBarColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('cardColor', cardColor, defaultValue: defaultData.cardColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('dividerColor', dividerColor, defaultValue: defaultData.dividerColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('focusColor', focusColor, defaultValue: defaultData.focusColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('hoverColor', hoverColor, defaultValue: defaultData.hoverColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('highlightColor', highlightColor, defaultValue: defaultData.highlightColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('splashColor', splashColor, defaultValue: defaultData.splashColor, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('splashFactory', splashFactory, defaultValue: defaultData.splashFactory, level: DiagnosticLevel.debug)); properties.add(ColorProperty('selectedRowColor', selectedRowColor, defaultValue: defaultData.selectedRowColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('unselectedWidgetColor', unselectedWidgetColor, defaultValue: defaultData.unselectedWidgetColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('disabledColor', disabledColor, defaultValue: defaultData.disabledColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('buttonColor', buttonColor, defaultValue: defaultData.buttonColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('secondaryHeaderColor', secondaryHeaderColor, defaultValue: defaultData.secondaryHeaderColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('textSelectionColor', textSelectionColor, defaultValue: defaultData.textSelectionColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('cursorColor', cursorColor, defaultValue: defaultData.cursorColor, level: DiagnosticLevel.debug)); + properties.add(ColorProperty('textSelectionHandleColor', textSelectionHandleColor, defaultValue: defaultData.textSelectionHandleColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('dialogBackgroundColor', dialogBackgroundColor, defaultValue: defaultData.dialogBackgroundColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('indicatorColor', indicatorColor, defaultValue: defaultData.indicatorColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('hintColor', hintColor, defaultValue: defaultData.hintColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('errorColor', errorColor, defaultValue: defaultData.errorColor, level: DiagnosticLevel.debug)); properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, level: DiagnosticLevel.debug)); - // TYPOGRAPHY & ICONOGRAPHY - properties.add(DiagnosticsProperty('typography', typography, defaultValue: defaultData.typography, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('buttonTheme', buttonTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('textTheme', textTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('primaryTextTheme', primaryTextTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('accentTextTheme', accentTextTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('inputDecorationTheme', inputDecorationTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('iconTheme', iconTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('primaryIconTheme', primaryIconTheme, level: DiagnosticLevel.debug)); - // COMPONENT THEMES - properties.add(DiagnosticsProperty('appBarTheme', appBarTheme, defaultValue: defaultData.appBarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('bannerTheme', bannerTheme, defaultValue: defaultData.bannerTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('bottomAppBarTheme', bottomAppBarTheme, defaultValue: defaultData.bottomAppBarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('bottomNavigationBarTheme', bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('bottomSheetTheme', bottomSheetTheme, defaultValue: defaultData.bottomSheetTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('buttonBarTheme', buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('buttonTheme', buttonTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('accentIconTheme', accentIconTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('sliderTheme', sliderTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('tabBarTheme', tabBarTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('cardTheme', cardTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('checkboxTheme', checkboxTheme, defaultValue: defaultData.checkboxTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('chipTheme', chipTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('dataTableTheme', dataTableTheme, defaultValue: defaultData.dataTableTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('materialTapTargetSize', materialTapTargetSize, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('applyElevationOverlayColor', applyElevationOverlayColor, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('pageTransitionsTheme', pageTransitionsTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('appBarTheme', appBarTheme, defaultValue: defaultData.appBarTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('scrollbarTheme', scrollbarTheme, defaultValue: defaultData.scrollbarTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('bottomAppBarTheme', bottomAppBarTheme, defaultValue: defaultData.bottomAppBarTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('colorScheme', colorScheme, defaultValue: defaultData.colorScheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('dialogTheme', dialogTheme, defaultValue: defaultData.dialogTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('dividerTheme', dividerTheme, defaultValue: defaultData.dividerTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('drawerTheme', drawerTheme, defaultValue: defaultData.drawerTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('elevatedButtonTheme', elevatedButtonTheme, defaultValue: defaultData.elevatedButtonTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('floatingActionButtonTheme', floatingActionButtonTheme, defaultValue: defaultData.floatingActionButtonTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('listTileTheme', listTileTheme, defaultValue: defaultData.listTileTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('navigationBarTheme', navigationBarTheme, defaultValue: defaultData.navigationBarTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('navigationRailTheme', navigationRailTheme, defaultValue: defaultData.navigationRailTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('outlinedButtonTheme', outlinedButtonTheme, defaultValue: defaultData.outlinedButtonTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('popupMenuTheme', popupMenuTheme, defaultValue: defaultData.popupMenuTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('progressIndicatorTheme', progressIndicatorTheme, defaultValue: defaultData.progressIndicatorTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('radioTheme', radioTheme, defaultValue: defaultData.radioTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('sliderTheme', sliderTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('typography', typography, defaultValue: defaultData.typography, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('cupertinoOverrideTheme', cupertinoOverrideTheme, defaultValue: defaultData.cupertinoOverrideTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('snackBarTheme', snackBarTheme, defaultValue: defaultData.snackBarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('switchTheme', switchTheme, defaultValue: defaultData.switchTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('tabBarTheme', tabBarTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('textButtonTheme', textButtonTheme, defaultValue: defaultData.textButtonTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('textSelectionTheme', textSelectionTheme, defaultValue: defaultData.textSelectionTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('bottomSheetTheme', bottomSheetTheme, defaultValue: defaultData.bottomSheetTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('popupMenuTheme', popupMenuTheme, defaultValue: defaultData.popupMenuTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('bannerTheme', bannerTheme, defaultValue: defaultData.bannerTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('dividerTheme', dividerTheme, defaultValue: defaultData.dividerTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('buttonBarTheme', buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel.debug)); properties.add(DiagnosticsProperty('timePickerTheme', timePickerTheme, defaultValue: defaultData.timePickerTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug)); - // DEPRECATED (newest deprecations at the bottom) - properties.add(DiagnosticsProperty('useTextSelectionTheme', useTextSelectionTheme, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('textSelectionColor', textSelectionColor, defaultValue: defaultData.textSelectionColor, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('cursorColor', cursorColor, defaultValue: defaultData.cursorColor, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('textSelectionHandleColor', textSelectionHandleColor, defaultValue: defaultData.textSelectionHandleColor, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('accentColor', accentColor, defaultValue: defaultData.accentColor, level: DiagnosticLevel.debug)); - properties.add(EnumProperty('accentColorBrightness', accentColorBrightness, defaultValue: defaultData.accentColorBrightness, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('accentTextTheme', accentTextTheme, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('accentIconTheme', accentIconTheme, level: DiagnosticLevel.debug)); - properties.add(ColorProperty('buttonColor', buttonColor, defaultValue: defaultData.buttonColor, level: DiagnosticLevel.debug)); - properties.add(DiagnosticsProperty('fixTextFieldOutlineLabel', fixTextFieldOutlineLabel, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('textSelectionTheme', textSelectionTheme, defaultValue: defaultData.textSelectionTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('bottomNavigationBarTheme', bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('textButtonTheme', textButtonTheme, defaultValue: defaultData.textButtonTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('elevatedButtonTheme', elevatedButtonTheme, defaultValue: defaultData.elevatedButtonTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('outlinedButtonTheme', outlinedButtonTheme, defaultValue: defaultData.outlinedButtonTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('dataTableTheme', dataTableTheme, defaultValue: defaultData.dataTableTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('checkboxTheme', checkboxTheme, defaultValue: defaultData.checkboxTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('radioTheme', radioTheme, defaultValue: defaultData.radioTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('switchTheme', switchTheme, defaultValue: defaultData.switchTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('progressIndicatorTheme', progressIndicatorTheme, defaultValue: defaultData.progressIndicatorTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('drawerTheme', drawerTheme, defaultValue: defaultData.drawerTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('listTileTheme', listTileTheme, defaultValue: defaultData.listTileTheme, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('fixTextFieldOutlineLabel', fixTextFieldOutlineLabel, defaultValue: true, level: DiagnosticLevel.debug)); + properties.add(DiagnosticsProperty('useTextSelectionTheme', useTextSelectionTheme, defaultValue: true, level: DiagnosticLevel.debug)); + properties.add(EnumProperty('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug)); } } @@ -2377,7 +2286,6 @@ class VisualDensity with Diagnosticable { }) : assert(horizontal != null), assert(vertical != null), assert(vertical <= maximumDensity), - assert(vertical <= maximumDensity), assert(vertical >= minimumDensity), assert(horizontal <= maximumDensity), assert(horizontal >= minimumDensity); diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index e310f2e08a..758b7d35d6 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -666,93 +666,88 @@ void main() { test('ThemeData diagnostics include all properties', () { // List of properties must match the properties in ThemeData.hashCode() final Set expectedPropertyNames = { - // GENERAL CONFIGURATION - 'androidOverscrollIndicator', - 'applyElevationOverlayColor', - 'cupertinoOverrideTheme', - 'inputDecorationTheme', - 'materialTapTargetSize', - 'pageTransitionsTheme', - 'platform', - 'scrollbarTheme', - 'splashFactory', 'visualDensity', - // COLOR - 'colorScheme', 'primaryColor', 'primaryColorBrightness', 'primaryColorLight', 'primaryColorDark', - 'focusColor', - 'hoverColor', - 'shadowColor', 'canvasColor', + 'shadowColor', + 'accentColor', + 'accentColorBrightness', 'scaffoldBackgroundColor', 'bottomAppBarColor', 'cardColor', 'dividerColor', + 'focusColor', + 'hoverColor', 'highlightColor', 'splashColor', + 'splashFactory', 'selectedRowColor', 'unselectedWidgetColor', 'disabledColor', + 'buttonTheme', + 'buttonColor', + 'toggleButtonsTheme', 'secondaryHeaderColor', + 'textSelectionColor', + 'cursorColor', + 'textSelectionHandleColor', 'backgroundColor', 'dialogBackgroundColor', 'indicatorColor', 'hintColor', 'errorColor', 'toggleableActiveColor', - // TYPOGRAPHY & ICONOGRAPHY - 'typography', 'textTheme', 'primaryTextTheme', + 'accentTextTheme', + 'inputDecorationTheme', 'iconTheme', 'primaryIconTheme', - // COMPONENT THEMES - 'appBarTheme', - 'bannerTheme', - 'bottomAppBarTheme', - 'bottomNavigationBarTheme', - 'bottomSheetTheme', - 'buttonBarTheme', - 'buttonTheme', + 'accentIconTheme', + 'sliderTheme', + 'tabBarTheme', + 'tooltipTheme', 'cardTheme', - 'checkboxTheme', 'chipTheme', - 'dataTableTheme', + 'platform', + 'materialTapTargetSize', + 'applyElevationOverlayColor', + 'pageTransitionsTheme', + 'appBarTheme', + 'scrollbarTheme', + 'bottomAppBarTheme', + 'colorScheme', 'dialogTheme', - 'dividerTheme', - 'drawerTheme', - 'elevatedButtonTheme', 'floatingActionButtonTheme', - 'listTileTheme', 'navigationBarTheme', 'navigationRailTheme', - 'outlinedButtonTheme', - 'popupMenuTheme', - 'progressIndicatorTheme', - 'radioTheme', - 'sliderTheme', + 'typography', + 'cupertinoOverrideTheme', 'snackBarTheme', - 'switchTheme', - 'tabBarTheme', - 'textButtonTheme', - 'textSelectionTheme', + 'bottomSheetTheme', + 'popupMenuTheme', + 'bannerTheme', + 'dividerTheme', + 'buttonBarTheme', + 'bottomNavigationBarTheme', 'timePickerTheme', - 'toggleButtonsTheme', - 'tooltipTheme', - // DEPRECATED (newest deprecations at the bottom) - 'useTextSelectionTheme', - 'textSelectionColor', - 'cursorColor', - 'textSelectionHandleColor', - 'accentColor', - 'accentColorBrightness', - 'accentTextTheme', - 'accentIconTheme', - 'buttonColor', + 'textButtonTheme', + 'elevatedButtonTheme', + 'outlinedButtonTheme', + 'textSelectionTheme', + 'dataTableTheme', + 'checkboxTheme', + 'radioTheme', + 'switchTheme', + 'progressIndicatorTheme', + 'drawerTheme', + 'listTileTheme', 'fixTextFieldOutlineLabel', + 'useTextSelectionTheme', + 'androidOverscrollIndicator', }; final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();