@@ -280,7 +280,6 @@ class ThemeData with Diagnosticable {
280280 // https://github.com/flutter/flutter/issues/91772.
281281 Color ? canvasColor,
282282 Color ? cardColor,
283- Color ? dialogBackgroundColor,
284283 Color ? disabledColor,
285284 Color ? dividerColor,
286285 Color ? focusColor,
@@ -361,6 +360,11 @@ class ThemeData with Diagnosticable {
361360 'This feature was deprecated after v3.21.0-10.0.pre.' ,
362361 )
363362 ButtonBarThemeData ? buttonBarTheme,
363+ @Deprecated (
364+ 'Use DialogThemeData.backgroundColor instead. '
365+ 'This feature was deprecated after v3.27.0-0.1.pre.' ,
366+ )
367+ Color ? dialogBackgroundColor,
364368 }) {
365369 // GENERAL CONFIGURATION
366370 cupertinoOverrideTheme = cupertinoOverrideTheme? .noDefault ();
@@ -446,7 +450,6 @@ class ThemeData with Diagnosticable {
446450 unselectedWidgetColor ?? = isDark ? Colors .white70 : Colors .black54;
447451 // Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
448452 secondaryHeaderColor ?? = isDark ? Colors .grey[700 ]! : primarySwatch[50 ]! ;
449- dialogBackgroundColor ?? = isDark ? Colors .grey[800 ]! : Colors .white;
450453 indicatorColor ?? = colorScheme.secondary == primaryColor ? Colors .white : colorScheme.secondary;
451454 hintColor ?? = isDark ? Colors .white60 : Colors .black.withOpacity (0.6 );
452455 // The default [buttonTheme] is here because it doesn't use the defaults for
@@ -558,6 +561,7 @@ class ThemeData with Diagnosticable {
558561 tooltipTheme ?? = const TooltipThemeData ();
559562 // DEPRECATED (newest deprecations at the bottom)
560563 buttonBarTheme ?? = const ButtonBarThemeData ();
564+ dialogBackgroundColor ?? = isDark ? Colors .grey[800 ]! : Colors .white;
561565 return ThemeData .raw (
562566 // For the sanity of the reader, make sure these properties are in the same
563567 // order in every place that they are separated by section comments (e.g.
@@ -581,7 +585,6 @@ class ThemeData with Diagnosticable {
581585 canvasColor: canvasColor,
582586 cardColor: cardColor,
583587 colorScheme: colorScheme,
584- dialogBackgroundColor: dialogBackgroundColor,
585588 disabledColor: disabledColor,
586589 dividerColor: dividerColor,
587590 focusColor: focusColor,
@@ -651,6 +654,7 @@ class ThemeData with Diagnosticable {
651654 tooltipTheme: tooltipTheme,
652655 // DEPRECATED (newest deprecations at the bottom)
653656 buttonBarTheme: buttonBarTheme,
657+ dialogBackgroundColor: dialogBackgroundColor,
654658 );
655659 }
656660
@@ -687,7 +691,6 @@ class ThemeData with Diagnosticable {
687691 // https://github.com/flutter/flutter/issues/91772.
688692 required this .canvasColor,
689693 required this .cardColor,
690- required this .dialogBackgroundColor,
691694 required this .disabledColor,
692695 required this .dividerColor,
693696 required this .focusColor,
@@ -761,6 +764,11 @@ class ThemeData with Diagnosticable {
761764 'This feature was deprecated after v3.21.0-10.0.pre.' ,
762765 )
763766 ButtonBarThemeData ? buttonBarTheme,
767+ @Deprecated (
768+ 'Use DialogThemeData.backgroundColor instead. '
769+ 'This feature was deprecated after v3.27.0-0.1.pre.' ,
770+ )
771+ required this .dialogBackgroundColor,
764772 }) : // DEPRECATED (newest deprecations at the bottom)
765773 // should not be `required`, use getter pattern to avoid breakages.
766774 _buttonBarTheme = buttonBarTheme,
@@ -1154,9 +1162,6 @@ class ThemeData with Diagnosticable {
11541162 /// backwards compatibility breaks.
11551163 final ColorScheme colorScheme;
11561164
1157- /// The background color of [Dialog] elements.
1158- final Color dialogBackgroundColor;
1159-
11601165 /// The color used for widgets that are inoperative, regardless of
11611166 /// their state. For example, a disabled checkbox (which may be
11621167 /// checked or unchecked).
@@ -1424,6 +1429,13 @@ class ThemeData with Diagnosticable {
14241429 ButtonBarThemeData get buttonBarTheme => _buttonBarTheme! ;
14251430 final ButtonBarThemeData ? _buttonBarTheme;
14261431
1432+ /// The background color of [Dialog] elements.
1433+ @Deprecated (
1434+ 'Use DialogThemeData.backgroundColor instead. '
1435+ 'This feature was deprecated after v3.27.0-0.1.pre.' ,
1436+ )
1437+ final Color dialogBackgroundColor;
1438+
14271439 /// Creates a copy of this theme but with the given fields replaced with the new values.
14281440 ///
14291441 /// The [brightness] value is applied to the [colorScheme] .
@@ -1453,7 +1465,6 @@ class ThemeData with Diagnosticable {
14531465 // https://github.com/flutter/flutter/issues/91772.
14541466 Color ? canvasColor,
14551467 Color ? cardColor,
1456- Color ? dialogBackgroundColor,
14571468 Color ? disabledColor,
14581469 Color ? dividerColor,
14591470 Color ? focusColor,
@@ -1537,6 +1548,11 @@ class ThemeData with Diagnosticable {
15371548 'This feature was deprecated after v3.21.0-10.0.pre.' ,
15381549 )
15391550 ButtonBarThemeData ? buttonBarTheme,
1551+ @Deprecated (
1552+ 'Use DialogThemeData.backgroundColor instead. '
1553+ 'This feature was deprecated after v3.27.0-0.1.pre.' ,
1554+ )
1555+ Color ? dialogBackgroundColor,
15401556 }) {
15411557 cupertinoOverrideTheme = cupertinoOverrideTheme? .noDefault ();
15421558
@@ -1591,7 +1607,6 @@ class ThemeData with Diagnosticable {
15911607 canvasColor: canvasColor ?? this .canvasColor,
15921608 cardColor: cardColor ?? this .cardColor,
15931609 colorScheme: (colorScheme ?? this .colorScheme).copyWith (brightness: brightness),
1594- dialogBackgroundColor: dialogBackgroundColor ?? this .dialogBackgroundColor,
15951610 disabledColor: disabledColor ?? this .disabledColor,
15961611 dividerColor: dividerColor ?? this .dividerColor,
15971612 focusColor: focusColor ?? this .focusColor,
@@ -1659,7 +1674,9 @@ class ThemeData with Diagnosticable {
16591674 timePickerTheme: timePickerTheme ?? this .timePickerTheme,
16601675 toggleButtonsTheme: toggleButtonsTheme ?? this .toggleButtonsTheme,
16611676 tooltipTheme: tooltipTheme ?? this .tooltipTheme,
1677+ // DEPRECATED (newest deprecations at the bottom)
16621678 buttonBarTheme: buttonBarTheme ?? _buttonBarTheme,
1679+ dialogBackgroundColor: dialogBackgroundColor ?? this .dialogBackgroundColor,
16631680 );
16641681 }
16651682
@@ -1784,7 +1801,6 @@ class ThemeData with Diagnosticable {
17841801 canvasColor: Color .lerp (a.canvasColor, b.canvasColor, t)! ,
17851802 cardColor: Color .lerp (a.cardColor, b.cardColor, t)! ,
17861803 colorScheme: ColorScheme .lerp (a.colorScheme, b.colorScheme, t),
1787- dialogBackgroundColor: Color .lerp (a.dialogBackgroundColor, b.dialogBackgroundColor, t)! ,
17881804 disabledColor: Color .lerp (a.disabledColor, b.disabledColor, t)! ,
17891805 dividerColor: Color .lerp (a.dividerColor, b.dividerColor, t)! ,
17901806 focusColor: Color .lerp (a.focusColor, b.focusColor, t)! ,
@@ -1852,7 +1868,9 @@ class ThemeData with Diagnosticable {
18521868 timePickerTheme: TimePickerThemeData .lerp (a.timePickerTheme, b.timePickerTheme, t),
18531869 toggleButtonsTheme: ToggleButtonsThemeData .lerp (a.toggleButtonsTheme, b.toggleButtonsTheme, t)! ,
18541870 tooltipTheme: TooltipThemeData .lerp (a.tooltipTheme, b.tooltipTheme, t)! ,
1871+ // DEPRECATED (newest deprecations at the bottom)
18551872 buttonBarTheme: ButtonBarThemeData .lerp (a.buttonBarTheme, b.buttonBarTheme, t),
1873+ dialogBackgroundColor: Color .lerp (a.dialogBackgroundColor, b.dialogBackgroundColor, t)! ,
18561874 );
18571875 }
18581876
@@ -1884,7 +1902,6 @@ class ThemeData with Diagnosticable {
18841902 other.canvasColor == canvasColor &&
18851903 other.cardColor == cardColor &&
18861904 other.colorScheme == colorScheme &&
1887- other.dialogBackgroundColor == dialogBackgroundColor &&
18881905 other.disabledColor == disabledColor &&
18891906 other.dividerColor == dividerColor &&
18901907 other.focusColor == focusColor &&
@@ -1952,7 +1969,9 @@ class ThemeData with Diagnosticable {
19521969 other.timePickerTheme == timePickerTheme &&
19531970 other.toggleButtonsTheme == toggleButtonsTheme &&
19541971 other.tooltipTheme == tooltipTheme &&
1955- other.buttonBarTheme == buttonBarTheme;
1972+ // DEPRECATED (newest deprecations at the bottom)
1973+ other.buttonBarTheme == buttonBarTheme &&
1974+ other.dialogBackgroundColor == dialogBackgroundColor;
19561975 }
19571976
19581977 @override
@@ -1982,7 +2001,6 @@ class ThemeData with Diagnosticable {
19822001 canvasColor,
19832002 cardColor,
19842003 colorScheme,
1985- dialogBackgroundColor,
19862004 disabledColor,
19872005 dividerColor,
19882006 focusColor,
@@ -2052,6 +2070,7 @@ class ThemeData with Diagnosticable {
20522070 tooltipTheme,
20532071 // DEPRECATED (newest deprecations at the bottom)
20542072 buttonBarTheme,
2073+ dialogBackgroundColor,
20552074 ];
20562075 return Object .hashAll (values);
20572076 }
@@ -2082,7 +2101,6 @@ class ThemeData with Diagnosticable {
20822101 properties.add (ColorProperty ('canvasColor' , canvasColor, defaultValue: defaultData.canvasColor, level: DiagnosticLevel .debug));
20832102 properties.add (ColorProperty ('cardColor' , cardColor, defaultValue: defaultData.cardColor, level: DiagnosticLevel .debug));
20842103 properties.add (DiagnosticsProperty <ColorScheme >('colorScheme' , colorScheme, defaultValue: defaultData.colorScheme, level: DiagnosticLevel .debug));
2085- properties.add (ColorProperty ('dialogBackgroundColor' , dialogBackgroundColor, defaultValue: defaultData.dialogBackgroundColor, level: DiagnosticLevel .debug));
20862104 properties.add (ColorProperty ('disabledColor' , disabledColor, defaultValue: defaultData.disabledColor, level: DiagnosticLevel .debug));
20872105 properties.add (ColorProperty ('dividerColor' , dividerColor, defaultValue: defaultData.dividerColor, level: DiagnosticLevel .debug));
20882106 properties.add (ColorProperty ('focusColor' , focusColor, defaultValue: defaultData.focusColor, level: DiagnosticLevel .debug));
@@ -2152,6 +2170,7 @@ class ThemeData with Diagnosticable {
21522170 properties.add (DiagnosticsProperty <TooltipThemeData >('tooltipTheme' , tooltipTheme, level: DiagnosticLevel .debug));
21532171 // DEPRECATED (newest deprecations at the bottom)
21542172 properties.add (DiagnosticsProperty <ButtonBarThemeData >('buttonBarTheme' , buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel .debug));
2173+ properties.add (ColorProperty ('dialogBackgroundColor' , dialogBackgroundColor, defaultValue: defaultData.dialogBackgroundColor, level: DiagnosticLevel .debug));
21552174 }
21562175}
21572176
0 commit comments