@@ -381,13 +381,6 @@ class ThemeData with Diagnosticable {
381
381
ToggleButtonsThemeData ? toggleButtonsTheme,
382
382
TooltipThemeData ? tooltipTheme,
383
383
// 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,
391
384
@Deprecated (
392
385
'This "fix" is now enabled by default. '
393
386
'This feature was deprecated after v2.5.0-1.0.pre.' ,
@@ -478,7 +471,6 @@ class ThemeData with Diagnosticable {
478
471
primaryColor ?? = primarySurfaceColor;
479
472
primaryColorBrightness = ThemeData .estimateBrightnessForColor (primarySurfaceColor);
480
473
canvasColor ?? = colorScheme.background;
481
- accentColor ?? = colorScheme.secondary;
482
474
scaffoldBackgroundColor ?? = colorScheme.background;
483
475
bottomAppBarColor ?? = colorScheme.surface;
484
476
cardColor ?? = colorScheme.surface;
@@ -496,8 +488,7 @@ class ThemeData with Diagnosticable {
496
488
primaryColorLight ?? = isDark ? Colors .grey[500 ]! : primarySwatch[100 ]! ;
497
489
primaryColorDark ?? = isDark ? Colors .black : primarySwatch[700 ]! ;
498
490
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 ]! );
501
492
focusColor ?? = isDark ? Colors .white.withOpacity (0.12 ) : Colors .black.withOpacity (0.12 );
502
493
hoverColor ?? = isDark ? Colors .white.withOpacity (0.04 ) : Colors .black.withOpacity (0.04 );
503
494
shadowColor ?? = Colors .black;
@@ -510,7 +501,7 @@ class ThemeData with Diagnosticable {
510
501
colorScheme ?? = ColorScheme .fromSwatch (
511
502
primarySwatch: primarySwatch,
512
503
primaryColorDark: primaryColorDark,
513
- accentColor: accentColor ,
504
+ accentColor: isDark ? Colors .tealAccent[ 200 ] ! : primarySwatch[ 500 ] ! ,
514
505
cardColor: cardColor,
515
506
backgroundColor: isDark ? Colors .grey[700 ]! : primarySwatch[200 ]! ,
516
507
errorColor: Colors .red[700 ],
@@ -521,7 +512,7 @@ class ThemeData with Diagnosticable {
521
512
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
522
513
secondaryHeaderColor ?? = isDark ? Colors .grey[700 ]! : primarySwatch[50 ]! ;
523
514
dialogBackgroundColor ?? = isDark ? Colors .grey[800 ]! : Colors .white;
524
- indicatorColor ?? = accentColor == primaryColor ? Colors .white : accentColor ;
515
+ indicatorColor ?? = colorScheme.secondary == primaryColor ? Colors .white : colorScheme.secondary ;
525
516
hintColor ?? = isDark ? Colors .white60 : Colors .black.withOpacity (0.6 );
526
517
// The default [buttonTheme] is here because it doesn't use the defaults for
527
518
// [disabledColor], [highlightColor], and [splashColor].
@@ -702,7 +693,6 @@ class ThemeData with Diagnosticable {
702
693
toggleButtonsTheme: toggleButtonsTheme,
703
694
tooltipTheme: tooltipTheme,
704
695
// DEPRECATED (newest deprecations at the bottom)
705
- accentColor: accentColor,
706
696
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
707
697
primaryColorBrightness: primaryColorBrightness,
708
698
androidOverscrollIndicator: androidOverscrollIndicator,
@@ -813,13 +803,6 @@ class ThemeData with Diagnosticable {
813
803
required this .toggleButtonsTheme,
814
804
required this .tooltipTheme,
815
805
// 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,
823
806
@Deprecated (
824
807
'This "fix" is now enabled by default. '
825
808
'This feature was deprecated after v2.5.0-1.0.pre.' ,
@@ -865,7 +848,6 @@ class ThemeData with Diagnosticable {
865
848
866
849
}) : // DEPRECATED (newest deprecations at the bottom)
867
850
// should not be `required`, use getter pattern to avoid breakages.
868
- _accentColor = accentColor,
869
851
_fixTextFieldOutlineLabel = fixTextFieldOutlineLabel,
870
852
_primaryColorBrightness = primaryColorBrightness,
871
853
_toggleableActiveColor = toggleableActiveColor,
@@ -875,7 +857,6 @@ class ThemeData with Diagnosticable {
875
857
_bottomAppBarColor = bottomAppBarColor,
876
858
assert (toggleableActiveColor != null ),
877
859
// DEPRECATED (newest deprecations at the bottom)
878
- assert (accentColor != null ),
879
860
assert (fixTextFieldOutlineLabel != null ),
880
861
assert (primaryColorBrightness != null ),
881
862
assert (errorColor != null ),
@@ -926,7 +907,6 @@ class ThemeData with Diagnosticable {
926
907
primaryColor: primarySurfaceColor,
927
908
primaryColorBrightness: ThemeData .estimateBrightnessForColor (primarySurfaceColor),
928
909
canvasColor: colorScheme.background,
929
- accentColor: colorScheme.secondary,
930
910
scaffoldBackgroundColor: colorScheme.background,
931
911
bottomAppBarColor: colorScheme.surface,
932
912
cardColor: colorScheme.surface,
@@ -1534,25 +1514,6 @@ class ThemeData with Diagnosticable {
1534
1514
1535
1515
// DEPRECATED (newest deprecations at the bottom)
1536
1516
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
-
1556
1517
/// An obsolete flag to allow apps to opt-out of a
1557
1518
/// [small fix] (https://github.com/flutter/flutter/issues/54028) for the Y
1558
1519
/// coordinate of the floating label in a [TextField] [OutlineInputBorder] .
@@ -1737,13 +1698,6 @@ class ThemeData with Diagnosticable {
1737
1698
ToggleButtonsThemeData ? toggleButtonsTheme,
1738
1699
TooltipThemeData ? tooltipTheme,
1739
1700
// 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,
1747
1701
@Deprecated (
1748
1702
'This "fix" is now enabled by default. '
1749
1703
'This feature was deprecated after v2.5.0-1.0.pre.' ,
@@ -1877,7 +1831,6 @@ class ThemeData with Diagnosticable {
1877
1831
toggleButtonsTheme: toggleButtonsTheme ?? this .toggleButtonsTheme,
1878
1832
tooltipTheme: tooltipTheme ?? this .tooltipTheme,
1879
1833
// DEPRECATED (newest deprecations at the bottom)
1880
- accentColor: accentColor ?? _accentColor,
1881
1834
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? _fixTextFieldOutlineLabel,
1882
1835
primaryColorBrightness: primaryColorBrightness ?? _primaryColorBrightness,
1883
1836
androidOverscrollIndicator: androidOverscrollIndicator ?? this .androidOverscrollIndicator,
@@ -2071,7 +2024,6 @@ class ThemeData with Diagnosticable {
2071
2024
toggleButtonsTheme: ToggleButtonsThemeData .lerp (a.toggleButtonsTheme, b.toggleButtonsTheme, t)! ,
2072
2025
tooltipTheme: TooltipThemeData .lerp (a.tooltipTheme, b.tooltipTheme, t)! ,
2073
2026
// DEPRECATED (newest deprecations at the bottom)
2074
- accentColor: Color .lerp (a.accentColor, b.accentColor, t),
2075
2027
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
2076
2028
primaryColorBrightness: t < 0.5 ? a.primaryColorBrightness : b.primaryColorBrightness,
2077
2029
androidOverscrollIndicator: t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
@@ -2177,7 +2129,6 @@ class ThemeData with Diagnosticable {
2177
2129
other.toggleButtonsTheme == toggleButtonsTheme &&
2178
2130
other.tooltipTheme == tooltipTheme &&
2179
2131
// DEPRECATED (newest deprecations at the bottom)
2180
- other.accentColor == accentColor &&
2181
2132
other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel &&
2182
2133
other.primaryColorBrightness == primaryColorBrightness &&
2183
2134
other.androidOverscrollIndicator == androidOverscrollIndicator &&
@@ -2280,7 +2231,6 @@ class ThemeData with Diagnosticable {
2280
2231
toggleButtonsTheme,
2281
2232
tooltipTheme,
2282
2233
// DEPRECATED (newest deprecations at the bottom)
2283
- accentColor,
2284
2234
fixTextFieldOutlineLabel,
2285
2235
primaryColorBrightness,
2286
2236
androidOverscrollIndicator,
@@ -2385,7 +2335,6 @@ class ThemeData with Diagnosticable {
2385
2335
properties.add (DiagnosticsProperty <ToggleButtonsThemeData >('toggleButtonsTheme' , toggleButtonsTheme, level: DiagnosticLevel .debug));
2386
2336
properties.add (DiagnosticsProperty <TooltipThemeData >('tooltipTheme' , tooltipTheme, level: DiagnosticLevel .debug));
2387
2337
// DEPRECATED (newest deprecations at the bottom)
2388
- properties.add (ColorProperty ('accentColor' , accentColor, defaultValue: defaultData.accentColor, level: DiagnosticLevel .debug));
2389
2338
properties.add (DiagnosticsProperty <bool >('fixTextFieldOutlineLabel' , fixTextFieldOutlineLabel, level: DiagnosticLevel .debug));
2390
2339
properties.add (EnumProperty <Brightness >('primaryColorBrightness' , primaryColorBrightness, defaultValue: defaultData.primaryColorBrightness, level: DiagnosticLevel .debug));
2391
2340
properties.add (EnumProperty <AndroidOverscrollIndicator >('androidOverscrollIndicator' , androidOverscrollIndicator, defaultValue: null , level: DiagnosticLevel .debug));
0 commit comments