@@ -381,13 +381,6 @@ class ThemeData with Diagnosticable {
381381 ToggleButtonsThemeData ? toggleButtonsTheme,
382382 TooltipThemeData ? tooltipTheme,
383383 // DEPRECATED (newest deprecations at the bottom)
384- @Deprecated (
385- 'Use colorScheme.secondary instead. '
386- 'For more information, consult the migration guide at '
387- 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
388- 'This feature was deprecated after v2.3.0-0.1.pre.' ,
389- )
390- Color ? accentColor,
391384 @Deprecated (
392385 'This "fix" is now enabled by default. '
393386 'This feature was deprecated after v2.5.0-1.0.pre.' ,
@@ -478,7 +471,6 @@ class ThemeData with Diagnosticable {
478471 primaryColor ?? = primarySurfaceColor;
479472 primaryColorBrightness = ThemeData .estimateBrightnessForColor (primarySurfaceColor);
480473 canvasColor ?? = colorScheme.background;
481- accentColor ?? = colorScheme.secondary;
482474 scaffoldBackgroundColor ?? = colorScheme.background;
483475 bottomAppBarColor ?? = colorScheme.surface;
484476 cardColor ?? = colorScheme.surface;
@@ -496,8 +488,7 @@ class ThemeData with Diagnosticable {
496488 primaryColorLight ?? = isDark ? Colors .grey[500 ]! : primarySwatch[100 ]! ;
497489 primaryColorDark ?? = isDark ? Colors .black : primarySwatch[700 ]! ;
498490 final bool primaryIsDark = estimatedPrimaryColorBrightness == Brightness .dark;
499- toggleableActiveColor ?? = isDark ? Colors .tealAccent[200 ]! : (accentColor ?? primarySwatch[600 ]! );
500- accentColor ?? = isDark ? Colors .tealAccent[200 ]! : primarySwatch[500 ]! ;
491+ toggleableActiveColor ?? = isDark ? Colors .tealAccent[200 ]! : (colorScheme? .secondary ?? primarySwatch[600 ]! );
501492 focusColor ?? = isDark ? Colors .white.withOpacity (0.12 ) : Colors .black.withOpacity (0.12 );
502493 hoverColor ?? = isDark ? Colors .white.withOpacity (0.04 ) : Colors .black.withOpacity (0.04 );
503494 shadowColor ?? = Colors .black;
@@ -510,7 +501,7 @@ class ThemeData with Diagnosticable {
510501 colorScheme ?? = ColorScheme .fromSwatch (
511502 primarySwatch: primarySwatch,
512503 primaryColorDark: primaryColorDark,
513- accentColor: accentColor ,
504+ accentColor: isDark ? Colors .tealAccent[ 200 ] ! : primarySwatch[ 500 ] ! ,
514505 cardColor: cardColor,
515506 backgroundColor: isDark ? Colors .grey[700 ]! : primarySwatch[200 ]! ,
516507 errorColor: Colors .red[700 ],
@@ -521,7 +512,7 @@ class ThemeData with Diagnosticable {
521512 // Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
522513 secondaryHeaderColor ?? = isDark ? Colors .grey[700 ]! : primarySwatch[50 ]! ;
523514 dialogBackgroundColor ?? = isDark ? Colors .grey[800 ]! : Colors .white;
524- indicatorColor ?? = accentColor == primaryColor ? Colors .white : accentColor ;
515+ indicatorColor ?? = colorScheme.secondary == primaryColor ? Colors .white : colorScheme.secondary ;
525516 hintColor ?? = isDark ? Colors .white60 : Colors .black.withOpacity (0.6 );
526517 // The default [buttonTheme] is here because it doesn't use the defaults for
527518 // [disabledColor], [highlightColor], and [splashColor].
@@ -702,7 +693,6 @@ class ThemeData with Diagnosticable {
702693 toggleButtonsTheme: toggleButtonsTheme,
703694 tooltipTheme: tooltipTheme,
704695 // DEPRECATED (newest deprecations at the bottom)
705- accentColor: accentColor,
706696 fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
707697 primaryColorBrightness: primaryColorBrightness,
708698 androidOverscrollIndicator: androidOverscrollIndicator,
@@ -813,13 +803,6 @@ class ThemeData with Diagnosticable {
813803 required this .toggleButtonsTheme,
814804 required this .tooltipTheme,
815805 // DEPRECATED (newest deprecations at the bottom)
816- @Deprecated (
817- 'Use colorScheme.secondary instead. '
818- 'For more information, consult the migration guide at '
819- 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
820- 'This feature was deprecated after v2.3.0-0.1.pre.' ,
821- )
822- Color ? accentColor,
823806 @Deprecated (
824807 'This "fix" is now enabled by default. '
825808 'This feature was deprecated after v2.5.0-1.0.pre.' ,
@@ -865,7 +848,6 @@ class ThemeData with Diagnosticable {
865848
866849 }) : // DEPRECATED (newest deprecations at the bottom)
867850 // should not be `required`, use getter pattern to avoid breakages.
868- _accentColor = accentColor,
869851 _fixTextFieldOutlineLabel = fixTextFieldOutlineLabel,
870852 _primaryColorBrightness = primaryColorBrightness,
871853 _toggleableActiveColor = toggleableActiveColor,
@@ -875,7 +857,6 @@ class ThemeData with Diagnosticable {
875857 _bottomAppBarColor = bottomAppBarColor,
876858 assert (toggleableActiveColor != null ),
877859 // DEPRECATED (newest deprecations at the bottom)
878- assert (accentColor != null ),
879860 assert (fixTextFieldOutlineLabel != null ),
880861 assert (primaryColorBrightness != null ),
881862 assert (errorColor != null ),
@@ -926,7 +907,6 @@ class ThemeData with Diagnosticable {
926907 primaryColor: primarySurfaceColor,
927908 primaryColorBrightness: ThemeData .estimateBrightnessForColor (primarySurfaceColor),
928909 canvasColor: colorScheme.background,
929- accentColor: colorScheme.secondary,
930910 scaffoldBackgroundColor: colorScheme.background,
931911 bottomAppBarColor: colorScheme.surface,
932912 cardColor: colorScheme.surface,
@@ -1534,25 +1514,6 @@ class ThemeData with Diagnosticable {
15341514
15351515 // DEPRECATED (newest deprecations at the bottom)
15361516
1537- /// Obsolete property that was originally used as the foreground
1538- /// color for widgets (knobs, text, overscroll edge effect, etc).
1539- ///
1540- /// The material library no longer uses this property. In most cases the
1541- /// [colorScheme] 's [ColorScheme.secondary] property is now used instead.
1542- ///
1543- /// Apps should migrate uses of this property to the theme's [colorScheme]
1544- /// [ColorScheme.secondary] color. In cases where a color is needed that
1545- /// contrasts well with the secondary color [ColorScheme.onSecondary]
1546- /// can be used.
1547- @Deprecated (
1548- 'Use colorScheme.secondary instead. '
1549- 'For more information, consult the migration guide at '
1550- 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
1551- 'This feature was deprecated after v2.3.0-0.1.pre.' ,
1552- )
1553- Color get accentColor => _accentColor! ;
1554- final Color ? _accentColor;
1555-
15561517 /// An obsolete flag to allow apps to opt-out of a
15571518 /// [small fix] (https://github.com/flutter/flutter/issues/54028) for the Y
15581519 /// coordinate of the floating label in a [TextField] [OutlineInputBorder] .
@@ -1737,13 +1698,6 @@ class ThemeData with Diagnosticable {
17371698 ToggleButtonsThemeData ? toggleButtonsTheme,
17381699 TooltipThemeData ? tooltipTheme,
17391700 // DEPRECATED (newest deprecations at the bottom)
1740- @Deprecated (
1741- 'No longer used by the framework, please remove any reference to it. '
1742- 'For more information, consult the migration guide at '
1743- 'https://flutter.dev/docs/release/breaking-changes/theme-data-accent-properties#migration-guide. '
1744- 'This feature was deprecated after v2.3.0-0.1.pre.' ,
1745- )
1746- Color ? accentColor,
17471701 @Deprecated (
17481702 'This "fix" is now enabled by default. '
17491703 'This feature was deprecated after v2.5.0-1.0.pre.' ,
@@ -1877,7 +1831,6 @@ class ThemeData with Diagnosticable {
18771831 toggleButtonsTheme: toggleButtonsTheme ?? this .toggleButtonsTheme,
18781832 tooltipTheme: tooltipTheme ?? this .tooltipTheme,
18791833 // DEPRECATED (newest deprecations at the bottom)
1880- accentColor: accentColor ?? _accentColor,
18811834 fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? _fixTextFieldOutlineLabel,
18821835 primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness,
18831836 androidOverscrollIndicator: androidOverscrollIndicator ?? this .androidOverscrollIndicator,
@@ -2071,7 +2024,6 @@ class ThemeData with Diagnosticable {
20712024 toggleButtonsTheme: ToggleButtonsThemeData .lerp (a.toggleButtonsTheme, b.toggleButtonsTheme, t)! ,
20722025 tooltipTheme: TooltipThemeData .lerp (a.tooltipTheme, b.tooltipTheme, t)! ,
20732026 // DEPRECATED (newest deprecations at the bottom)
2074- accentColor: Color .lerp (a.accentColor, b.accentColor, t),
20752027 fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
20762028 primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness,
20772029 androidOverscrollIndicator: t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
@@ -2177,7 +2129,6 @@ class ThemeData with Diagnosticable {
21772129 other.toggleButtonsTheme == toggleButtonsTheme &&
21782130 other.tooltipTheme == tooltipTheme &&
21792131 // DEPRECATED (newest deprecations at the bottom)
2180- other.accentColor == accentColor &&
21812132 other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel &&
21822133 other.primaryColorBrightness == primaryColorBrightness &&
21832134 other.androidOverscrollIndicator == androidOverscrollIndicator &&
@@ -2280,7 +2231,6 @@ class ThemeData with Diagnosticable {
22802231 toggleButtonsTheme,
22812232 tooltipTheme,
22822233 // DEPRECATED (newest deprecations at the bottom)
2283- accentColor,
22842234 fixTextFieldOutlineLabel,
22852235 primaryColorBrightness,
22862236 androidOverscrollIndicator,
@@ -2385,7 +2335,6 @@ class ThemeData with Diagnosticable {
23852335 properties.add (DiagnosticsProperty <ToggleButtonsThemeData >('toggleButtonsTheme' , toggleButtonsTheme, level: DiagnosticLevel .debug));
23862336 properties.add (DiagnosticsProperty <TooltipThemeData >('tooltipTheme' , tooltipTheme, level: DiagnosticLevel .debug));
23872337 // DEPRECATED (newest deprecations at the bottom)
2388- properties.add (ColorProperty ('accentColor' , accentColor, defaultValue: defaultData.accentColor, level: DiagnosticLevel .debug));
23892338 properties.add (DiagnosticsProperty <bool >('fixTextFieldOutlineLabel' , fixTextFieldOutlineLabel, level: DiagnosticLevel .debug));
23902339 properties.add (EnumProperty <Brightness >('primaryColorBrightness' , primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel .debug));
23912340 properties.add (EnumProperty <AndroidOverscrollIndicator >('androidOverscrollIndicator' , androidOverscrollIndicator, defaultValue: null , level: DiagnosticLevel .debug));
0 commit comments