@@ -327,7 +327,6 @@ class ThemeData with Diagnosticable {
327327 BottomAppBarTheme ? bottomAppBarTheme,
328328 BottomNavigationBarThemeData ? bottomNavigationBarTheme,
329329 BottomSheetThemeData ? bottomSheetTheme,
330- ButtonBarThemeData ? buttonBarTheme,
331330 ButtonThemeData ? buttonTheme,
332331 CardTheme ? cardTheme,
333332 CheckboxThemeData ? checkboxTheme,
@@ -366,6 +365,11 @@ class ThemeData with Diagnosticable {
366365 TimePickerThemeData ? timePickerTheme,
367366 ToggleButtonsThemeData ? toggleButtonsTheme,
368367 TooltipThemeData ? tooltipTheme,
368+ @Deprecated (
369+ 'Use OverflowBar instead. '
370+ 'This feature was deprecated after v3.21.0-10.0.pre.' ,
371+ )
372+ ButtonBarThemeData ? buttonBarTheme,
369373 }) {
370374 // GENERAL CONFIGURATION
371375 cupertinoOverrideTheme = cupertinoOverrideTheme? .noDefault ();
@@ -500,7 +504,6 @@ class ThemeData with Diagnosticable {
500504 bottomAppBarTheme ?? = const BottomAppBarTheme ();
501505 bottomNavigationBarTheme ?? = const BottomNavigationBarThemeData ();
502506 bottomSheetTheme ?? = const BottomSheetThemeData ();
503- buttonBarTheme ?? = const ButtonBarThemeData ();
504507 cardTheme ?? = const CardTheme ();
505508 checkboxTheme ?? = const CheckboxThemeData ();
506509 chipTheme ?? = const ChipThemeData ();
@@ -538,6 +541,8 @@ class ThemeData with Diagnosticable {
538541 timePickerTheme ?? = const TimePickerThemeData ();
539542 toggleButtonsTheme ?? = const ToggleButtonsThemeData ();
540543 tooltipTheme ?? = const TooltipThemeData ();
544+ // DEPRECATED (newest deprecations at the bottom)
545+ buttonBarTheme ?? = const ButtonBarThemeData ();
541546 return ThemeData .raw (
542547 // For the sanity of the reader, make sure these properties are in the same
543548 // order in every place that they are separated by section comments (e.g.
@@ -591,7 +596,6 @@ class ThemeData with Diagnosticable {
591596 bottomAppBarTheme: bottomAppBarTheme,
592597 bottomNavigationBarTheme: bottomNavigationBarTheme,
593598 bottomSheetTheme: bottomSheetTheme,
594- buttonBarTheme: buttonBarTheme,
595599 buttonTheme: buttonTheme,
596600 cardTheme: cardTheme,
597601 checkboxTheme: checkboxTheme,
@@ -630,6 +634,8 @@ class ThemeData with Diagnosticable {
630634 timePickerTheme: timePickerTheme,
631635 toggleButtonsTheme: toggleButtonsTheme,
632636 tooltipTheme: tooltipTheme,
637+ // DEPRECATED (newest deprecations at the bottom)
638+ buttonBarTheme: buttonBarTheme,
633639 );
634640 }
635641
@@ -696,7 +702,6 @@ class ThemeData with Diagnosticable {
696702 required this .bottomAppBarTheme,
697703 required this .bottomNavigationBarTheme,
698704 required this .bottomSheetTheme,
699- required this .buttonBarTheme,
700705 required this .buttonTheme,
701706 required this .cardTheme,
702707 required this .checkboxTheme,
@@ -735,7 +740,17 @@ class ThemeData with Diagnosticable {
735740 required this .timePickerTheme,
736741 required this .toggleButtonsTheme,
737742 required this .tooltipTheme,
738- });
743+ // DEPRECATED (newest deprecations at the bottom)
744+ @Deprecated (
745+ 'Use OverflowBar instead. '
746+ 'This feature was deprecated after v3.21.0-10.0.pre.' ,
747+ )
748+ ButtonBarThemeData ? buttonBarTheme,
749+ }) : // DEPRECATED (newest deprecations at the bottom)
750+ // should not be `required`, use getter pattern to avoid breakages.
751+ _buttonBarTheme = buttonBarTheme,
752+ // DEPRECATED (newest deprecations at the bottom)
753+ assert (buttonBarTheme != null );
739754
740755 /// Create a [ThemeData] based on the colors in the given [colorScheme] and
741756 /// text styles of the optional [textTheme] .
@@ -1248,9 +1263,6 @@ class ThemeData with Diagnosticable {
12481263 /// A theme for customizing the color, elevation, and shape of a bottom sheet.
12491264 final BottomSheetThemeData bottomSheetTheme;
12501265
1251- /// A theme for customizing the appearance and layout of [ButtonBar] widgets.
1252- final ButtonBarThemeData buttonBarTheme;
1253-
12541266 /// Defines the default configuration of button widgets, like [DropdownButton]
12551267 /// and [ButtonBar] .
12561268 final ButtonThemeData buttonTheme;
@@ -1390,6 +1402,14 @@ class ThemeData with Diagnosticable {
13901402 /// This is the value returned from [TooltipTheme.of] .
13911403 final TooltipThemeData tooltipTheme;
13921404
1405+ /// A theme for customizing the appearance and layout of [ButtonBar] widgets.
1406+ @Deprecated (
1407+ 'Use OverflowBar instead. '
1408+ 'This feature was deprecated after v3.21.0-10.0.pre.' ,
1409+ )
1410+ ButtonBarThemeData get buttonBarTheme => _buttonBarTheme! ;
1411+ final ButtonBarThemeData ? _buttonBarTheme;
1412+
13931413 /// Creates a copy of this theme but with the given fields replaced with the new values.
13941414 ///
13951415 /// The [brightness] value is applied to the [colorScheme] .
@@ -1449,7 +1469,6 @@ class ThemeData with Diagnosticable {
14491469 BottomAppBarTheme ? bottomAppBarTheme,
14501470 BottomNavigationBarThemeData ? bottomNavigationBarTheme,
14511471 BottomSheetThemeData ? bottomSheetTheme,
1452- ButtonBarThemeData ? buttonBarTheme,
14531472 ButtonThemeData ? buttonTheme,
14541473 CardTheme ? cardTheme,
14551474 CheckboxThemeData ? checkboxTheme,
@@ -1497,6 +1516,11 @@ class ThemeData with Diagnosticable {
14971516 'This feature was deprecated after v3.13.0-0.2.pre.' ,
14981517 )
14991518 bool ? useMaterial3,
1519+ @Deprecated (
1520+ 'Use OverflowBar instead. '
1521+ 'This feature was deprecated after v3.21.0-10.0.pre.' ,
1522+ )
1523+ ButtonBarThemeData ? buttonBarTheme,
15001524 }) {
15011525 cupertinoOverrideTheme = cupertinoOverrideTheme? .noDefault ();
15021526 return ThemeData .raw (
@@ -1554,7 +1578,6 @@ class ThemeData with Diagnosticable {
15541578 bottomAppBarTheme: bottomAppBarTheme ?? this .bottomAppBarTheme,
15551579 bottomNavigationBarTheme: bottomNavigationBarTheme ?? this .bottomNavigationBarTheme,
15561580 bottomSheetTheme: bottomSheetTheme ?? this .bottomSheetTheme,
1557- buttonBarTheme: buttonBarTheme ?? this .buttonBarTheme,
15581581 buttonTheme: buttonTheme ?? this .buttonTheme,
15591582 cardTheme: cardTheme ?? this .cardTheme,
15601583 checkboxTheme: checkboxTheme ?? this .checkboxTheme,
@@ -1593,6 +1616,7 @@ class ThemeData with Diagnosticable {
15931616 timePickerTheme: timePickerTheme ?? this .timePickerTheme,
15941617 toggleButtonsTheme: toggleButtonsTheme ?? this .toggleButtonsTheme,
15951618 tooltipTheme: tooltipTheme ?? this .tooltipTheme,
1619+ buttonBarTheme: buttonBarTheme ?? _buttonBarTheme,
15961620 );
15971621 }
15981622
@@ -1747,7 +1771,6 @@ class ThemeData with Diagnosticable {
17471771 bottomAppBarTheme: BottomAppBarTheme .lerp (a.bottomAppBarTheme, b.bottomAppBarTheme, t),
17481772 bottomNavigationBarTheme: BottomNavigationBarThemeData .lerp (a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t),
17491773 bottomSheetTheme: BottomSheetThemeData .lerp (a.bottomSheetTheme, b.bottomSheetTheme, t)! ,
1750- buttonBarTheme: ButtonBarThemeData .lerp (a.buttonBarTheme, b.buttonBarTheme, t)! ,
17511774 buttonTheme: t < 0.5 ? a.buttonTheme : b.buttonTheme,
17521775 cardTheme: CardTheme .lerp (a.cardTheme, b.cardTheme, t),
17531776 checkboxTheme: CheckboxThemeData .lerp (a.checkboxTheme, b.checkboxTheme, t),
@@ -1786,6 +1809,7 @@ class ThemeData with Diagnosticable {
17861809 timePickerTheme: TimePickerThemeData .lerp (a.timePickerTheme, b.timePickerTheme, t),
17871810 toggleButtonsTheme: ToggleButtonsThemeData .lerp (a.toggleButtonsTheme, b.toggleButtonsTheme, t)! ,
17881811 tooltipTheme: TooltipThemeData .lerp (a.tooltipTheme, b.tooltipTheme, t)! ,
1812+ buttonBarTheme: ButtonBarThemeData .lerp (a.buttonBarTheme, b.buttonBarTheme, t),
17891813 );
17901814 }
17911815
@@ -1847,7 +1871,6 @@ class ThemeData with Diagnosticable {
18471871 other.bottomAppBarTheme == bottomAppBarTheme &&
18481872 other.bottomNavigationBarTheme == bottomNavigationBarTheme &&
18491873 other.bottomSheetTheme == bottomSheetTheme &&
1850- other.buttonBarTheme == buttonBarTheme &&
18511874 other.buttonTheme == buttonTheme &&
18521875 other.cardTheme == cardTheme &&
18531876 other.checkboxTheme == checkboxTheme &&
@@ -1885,7 +1908,8 @@ class ThemeData with Diagnosticable {
18851908 other.textSelectionTheme == textSelectionTheme &&
18861909 other.timePickerTheme == timePickerTheme &&
18871910 other.toggleButtonsTheme == toggleButtonsTheme &&
1888- other.tooltipTheme == tooltipTheme;
1911+ other.tooltipTheme == tooltipTheme &&
1912+ other.buttonBarTheme == buttonBarTheme;
18891913 }
18901914
18911915 @override
@@ -1945,7 +1969,6 @@ class ThemeData with Diagnosticable {
19451969 bottomAppBarTheme,
19461970 bottomNavigationBarTheme,
19471971 bottomSheetTheme,
1948- buttonBarTheme,
19491972 buttonTheme,
19501973 cardTheme,
19511974 checkboxTheme,
@@ -1984,6 +2007,8 @@ class ThemeData with Diagnosticable {
19842007 timePickerTheme,
19852008 toggleButtonsTheme,
19862009 tooltipTheme,
2010+ // DEPRECATED (newest deprecations at the bottom)
2011+ buttonBarTheme,
19872012 ];
19882013 return Object .hashAll (values);
19892014 }
@@ -2044,7 +2069,6 @@ class ThemeData with Diagnosticable {
20442069 properties.add (DiagnosticsProperty <BottomAppBarTheme >('bottomAppBarTheme' , bottomAppBarTheme, defaultValue: defaultData.bottomAppBarTheme, level: DiagnosticLevel .debug));
20452070 properties.add (DiagnosticsProperty <BottomNavigationBarThemeData >('bottomNavigationBarTheme' , bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel .debug));
20462071 properties.add (DiagnosticsProperty <BottomSheetThemeData >('bottomSheetTheme' , bottomSheetTheme, defaultValue: defaultData.bottomSheetTheme, level: DiagnosticLevel .debug));
2047- properties.add (DiagnosticsProperty <ButtonBarThemeData >('buttonBarTheme' , buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel .debug));
20482072 properties.add (DiagnosticsProperty <ButtonThemeData >('buttonTheme' , buttonTheme, level: DiagnosticLevel .debug));
20492073 properties.add (DiagnosticsProperty <CardTheme >('cardTheme' , cardTheme, level: DiagnosticLevel .debug));
20502074 properties.add (DiagnosticsProperty <CheckboxThemeData >('checkboxTheme' , checkboxTheme, defaultValue: defaultData.checkboxTheme, level: DiagnosticLevel .debug));
@@ -2083,6 +2107,8 @@ class ThemeData with Diagnosticable {
20832107 properties.add (DiagnosticsProperty <TimePickerThemeData >('timePickerTheme' , timePickerTheme, defaultValue: defaultData.timePickerTheme, level: DiagnosticLevel .debug));
20842108 properties.add (DiagnosticsProperty <ToggleButtonsThemeData >('toggleButtonsTheme' , toggleButtonsTheme, level: DiagnosticLevel .debug));
20852109 properties.add (DiagnosticsProperty <TooltipThemeData >('tooltipTheme' , tooltipTheme, level: DiagnosticLevel .debug));
2110+ // DEPRECATED (newest deprecations at the bottom)
2111+ properties.add (DiagnosticsProperty <ButtonBarThemeData >('buttonBarTheme' , buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel .debug));
20862112 }
20872113}
20882114
0 commit comments