mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Deprecate ButtonBar
, ButtonBarThemeData
, and ThemeData.buttonBarTheme
(#145523)
fixes [Deprecate `ButtonBar`](https://github.com/flutter/flutter/issues/127955) ### Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( theme: ThemeData( buttonBarTheme: const ButtonBarThemeData( alignment: MainAxisAlignment.spaceEvenly, ), ), home: Scaffold( body: ButtonBar( alignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ TextButton( onPressed: () {}, child: const Text('Button 1'), ), TextButton( onPressed: () {}, child: const Text('Button 2'), ), TextButton( onPressed: () {}, child: const Text('Button 3'), ), ], ), ), ); } } ``` </details> ## Data driven fix ### Before executing `dart fix --apply` ```dart return MaterialApp( theme: ThemeData( buttonBarTheme: const ButtonBarThemeData( alignment: MainAxisAlignment.spaceEvenly, ), ), home: Scaffold( body: ButtonBar( alignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ TextButton( onPressed: () {}, child: const Text('Button 1'), ), TextButton( onPressed: () {}, child: const Text('Button 2'), ), TextButton( onPressed: () {}, child: const Text('Button 3'), ), ], ), ), ); ``` ### After executing `dart fix --apply` ```dart return MaterialApp( theme: ThemeData( ), home: Scaffold( body: OverflowBar( alignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ TextButton( onPressed: () {}, child: const Text('Button 1'), ), TextButton( onPressed: () {}, child: const Text('Button 2'), ), TextButton( onPressed: () {}, child: const Text('Button 3'), ), ], ), ), ); ```
This commit is contained in:
parent
40dda2b4bb
commit
e85340e1e4
@ -0,0 +1,40 @@
|
|||||||
|
# Copyright 2014 The Flutter Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
# For details regarding the *Flutter Fix* feature, see
|
||||||
|
# https://flutter.dev/docs/development/tools/flutter-fix
|
||||||
|
|
||||||
|
# Please add new fixes to the top of the file, separated by one blank line
|
||||||
|
# from other fixes. In a comment, include a link to the PR where the change
|
||||||
|
# requiring the fix was made.
|
||||||
|
|
||||||
|
# Every fix must be tested. See the flutter/packages/flutter/test_fixes/README.md
|
||||||
|
# file for instructions on testing these data driven fixes.
|
||||||
|
|
||||||
|
# For documentation about this file format, see
|
||||||
|
# https://dart.dev/go/data-driven-fixes.
|
||||||
|
|
||||||
|
# * Fixes in this file are for ButtonBar from the Material library. *
|
||||||
|
# For fixes to
|
||||||
|
# * AppBarTheme: fix_app_bar_theme.yaml
|
||||||
|
# * AppBar: fix_app_bar.yaml
|
||||||
|
# * ButtonBar: fix_button_bar.yaml
|
||||||
|
# * ColorScheme: fix_color_scheme.yaml
|
||||||
|
# * Material (general): fix_material.yaml
|
||||||
|
# * SliverAppBar: fix_sliver_app_bar.yaml
|
||||||
|
# * TextTheme: fix_text_theme.yaml
|
||||||
|
# * ThemeData: fix_theme_data.yaml
|
||||||
|
version: 1
|
||||||
|
transforms:
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/145523
|
||||||
|
- title: "Migrate to 'OverflowBar'"
|
||||||
|
date: 2024-02-28
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
class: 'ButtonBar'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'OverflowBar'
|
||||||
|
|
||||||
|
# Before adding a new fix: read instructions at the top of this file.
|
@ -1698,4 +1698,15 @@ transforms:
|
|||||||
- kind: 'removeParameter'
|
- kind: 'removeParameter'
|
||||||
name: 'useMaterial3'
|
name: 'useMaterial3'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/145523
|
||||||
|
- title: "Remove 'buttonBarTheme'"
|
||||||
|
date: 2024-04-28
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
constructor: ''
|
||||||
|
inClass: 'ThemeData'
|
||||||
|
changes:
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'buttonBarTheme'
|
||||||
|
|
||||||
# Before adding a new fix: read instructions at the top of this file.
|
# Before adding a new fix: read instructions at the top of this file.
|
||||||
|
@ -79,11 +79,19 @@ import 'dialog.dart';
|
|||||||
/// * [Card], at the bottom of which it is common to place a [ButtonBar].
|
/// * [Card], at the bottom of which it is common to place a [ButtonBar].
|
||||||
/// * [Dialog], which uses a [ButtonBar] for its actions.
|
/// * [Dialog], which uses a [ButtonBar] for its actions.
|
||||||
/// * [ButtonBarTheme], which configures the [ButtonBar].
|
/// * [ButtonBarTheme], which configures the [ButtonBar].
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
class ButtonBar extends StatelessWidget {
|
class ButtonBar extends StatelessWidget {
|
||||||
/// Creates a button bar.
|
/// Creates a button bar.
|
||||||
///
|
///
|
||||||
/// Both [buttonMinWidth] and [buttonHeight] must be non-negative if they
|
/// Both [buttonMinWidth] and [buttonHeight] must be non-negative if they
|
||||||
/// are not null.
|
/// are not null.
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
const ButtonBar({
|
const ButtonBar({
|
||||||
super.key,
|
super.key,
|
||||||
this.alignment,
|
this.alignment,
|
||||||
|
@ -27,12 +27,20 @@ import 'theme.dart';
|
|||||||
/// its subtree.
|
/// its subtree.
|
||||||
/// * [ButtonBar], which uses this to configure itself and its children
|
/// * [ButtonBar], which uses this to configure itself and its children
|
||||||
/// button widgets.
|
/// button widgets.
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
@immutable
|
@immutable
|
||||||
class ButtonBarThemeData with Diagnosticable {
|
class ButtonBarThemeData with Diagnosticable {
|
||||||
/// Constructs the set of properties used to configure [ButtonBar] widgets.
|
/// Constructs the set of properties used to configure [ButtonBar] widgets.
|
||||||
///
|
///
|
||||||
/// Both [buttonMinWidth] and [buttonHeight] must be non-negative if they
|
/// Both [buttonMinWidth] and [buttonHeight] must be non-negative if they
|
||||||
/// are not null.
|
/// are not null.
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
const ButtonBarThemeData({
|
const ButtonBarThemeData({
|
||||||
this.alignment,
|
this.alignment,
|
||||||
this.mainAxisSize,
|
this.mainAxisSize,
|
||||||
|
@ -327,7 +327,6 @@ class ThemeData with Diagnosticable {
|
|||||||
BottomAppBarTheme? bottomAppBarTheme,
|
BottomAppBarTheme? bottomAppBarTheme,
|
||||||
BottomNavigationBarThemeData? bottomNavigationBarTheme,
|
BottomNavigationBarThemeData? bottomNavigationBarTheme,
|
||||||
BottomSheetThemeData? bottomSheetTheme,
|
BottomSheetThemeData? bottomSheetTheme,
|
||||||
ButtonBarThemeData? buttonBarTheme,
|
|
||||||
ButtonThemeData? buttonTheme,
|
ButtonThemeData? buttonTheme,
|
||||||
CardTheme? cardTheme,
|
CardTheme? cardTheme,
|
||||||
CheckboxThemeData? checkboxTheme,
|
CheckboxThemeData? checkboxTheme,
|
||||||
@ -366,6 +365,11 @@ class ThemeData with Diagnosticable {
|
|||||||
TimePickerThemeData? timePickerTheme,
|
TimePickerThemeData? timePickerTheme,
|
||||||
ToggleButtonsThemeData? toggleButtonsTheme,
|
ToggleButtonsThemeData? toggleButtonsTheme,
|
||||||
TooltipThemeData? tooltipTheme,
|
TooltipThemeData? tooltipTheme,
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
|
ButtonBarThemeData? buttonBarTheme,
|
||||||
}) {
|
}) {
|
||||||
// GENERAL CONFIGURATION
|
// GENERAL CONFIGURATION
|
||||||
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
||||||
@ -500,7 +504,6 @@ class ThemeData with Diagnosticable {
|
|||||||
bottomAppBarTheme ??= const BottomAppBarTheme();
|
bottomAppBarTheme ??= const BottomAppBarTheme();
|
||||||
bottomNavigationBarTheme ??= const BottomNavigationBarThemeData();
|
bottomNavigationBarTheme ??= const BottomNavigationBarThemeData();
|
||||||
bottomSheetTheme ??= const BottomSheetThemeData();
|
bottomSheetTheme ??= const BottomSheetThemeData();
|
||||||
buttonBarTheme ??= const ButtonBarThemeData();
|
|
||||||
cardTheme ??= const CardTheme();
|
cardTheme ??= const CardTheme();
|
||||||
checkboxTheme ??= const CheckboxThemeData();
|
checkboxTheme ??= const CheckboxThemeData();
|
||||||
chipTheme ??= const ChipThemeData();
|
chipTheme ??= const ChipThemeData();
|
||||||
@ -538,6 +541,8 @@ class ThemeData with Diagnosticable {
|
|||||||
timePickerTheme ??= const TimePickerThemeData();
|
timePickerTheme ??= const TimePickerThemeData();
|
||||||
toggleButtonsTheme ??= const ToggleButtonsThemeData();
|
toggleButtonsTheme ??= const ToggleButtonsThemeData();
|
||||||
tooltipTheme ??= const TooltipThemeData();
|
tooltipTheme ??= const TooltipThemeData();
|
||||||
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
|
buttonBarTheme ??= const ButtonBarThemeData();
|
||||||
return ThemeData.raw(
|
return ThemeData.raw(
|
||||||
// For the sanity of the reader, make sure these properties are in the same
|
// For the sanity of the reader, make sure these properties are in the same
|
||||||
// order in every place that they are separated by section comments (e.g.
|
// order in every place that they are separated by section comments (e.g.
|
||||||
@ -591,7 +596,6 @@ class ThemeData with Diagnosticable {
|
|||||||
bottomAppBarTheme: bottomAppBarTheme,
|
bottomAppBarTheme: bottomAppBarTheme,
|
||||||
bottomNavigationBarTheme: bottomNavigationBarTheme,
|
bottomNavigationBarTheme: bottomNavigationBarTheme,
|
||||||
bottomSheetTheme: bottomSheetTheme,
|
bottomSheetTheme: bottomSheetTheme,
|
||||||
buttonBarTheme: buttonBarTheme,
|
|
||||||
buttonTheme: buttonTheme,
|
buttonTheme: buttonTheme,
|
||||||
cardTheme: cardTheme,
|
cardTheme: cardTheme,
|
||||||
checkboxTheme: checkboxTheme,
|
checkboxTheme: checkboxTheme,
|
||||||
@ -630,6 +634,8 @@ class ThemeData with Diagnosticable {
|
|||||||
timePickerTheme: timePickerTheme,
|
timePickerTheme: timePickerTheme,
|
||||||
toggleButtonsTheme: toggleButtonsTheme,
|
toggleButtonsTheme: toggleButtonsTheme,
|
||||||
tooltipTheme: tooltipTheme,
|
tooltipTheme: tooltipTheme,
|
||||||
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
|
buttonBarTheme: buttonBarTheme,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -696,7 +702,6 @@ class ThemeData with Diagnosticable {
|
|||||||
required this.bottomAppBarTheme,
|
required this.bottomAppBarTheme,
|
||||||
required this.bottomNavigationBarTheme,
|
required this.bottomNavigationBarTheme,
|
||||||
required this.bottomSheetTheme,
|
required this.bottomSheetTheme,
|
||||||
required this.buttonBarTheme,
|
|
||||||
required this.buttonTheme,
|
required this.buttonTheme,
|
||||||
required this.cardTheme,
|
required this.cardTheme,
|
||||||
required this.checkboxTheme,
|
required this.checkboxTheme,
|
||||||
@ -735,7 +740,17 @@ class ThemeData with Diagnosticable {
|
|||||||
required this.timePickerTheme,
|
required this.timePickerTheme,
|
||||||
required this.toggleButtonsTheme,
|
required this.toggleButtonsTheme,
|
||||||
required this.tooltipTheme,
|
required this.tooltipTheme,
|
||||||
});
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
|
ButtonBarThemeData? buttonBarTheme,
|
||||||
|
}) : // DEPRECATED (newest deprecations at the bottom)
|
||||||
|
// should not be `required`, use getter pattern to avoid breakages.
|
||||||
|
_buttonBarTheme = buttonBarTheme,
|
||||||
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
|
assert(buttonBarTheme != null);
|
||||||
|
|
||||||
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
|
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
|
||||||
/// text styles of the optional [textTheme].
|
/// text styles of the optional [textTheme].
|
||||||
@ -1248,9 +1263,6 @@ class ThemeData with Diagnosticable {
|
|||||||
/// A theme for customizing the color, elevation, and shape of a bottom sheet.
|
/// A theme for customizing the color, elevation, and shape of a bottom sheet.
|
||||||
final BottomSheetThemeData bottomSheetTheme;
|
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 [DropdownButton]
|
/// Defines the default configuration of button widgets, like [DropdownButton]
|
||||||
/// and [ButtonBar].
|
/// and [ButtonBar].
|
||||||
final ButtonThemeData buttonTheme;
|
final ButtonThemeData buttonTheme;
|
||||||
@ -1390,6 +1402,14 @@ class ThemeData with Diagnosticable {
|
|||||||
/// This is the value returned from [TooltipTheme.of].
|
/// This is the value returned from [TooltipTheme.of].
|
||||||
final TooltipThemeData tooltipTheme;
|
final TooltipThemeData tooltipTheme;
|
||||||
|
|
||||||
|
/// A theme for customizing the appearance and layout of [ButtonBar] widgets.
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
|
ButtonBarThemeData get buttonBarTheme => _buttonBarTheme!;
|
||||||
|
final ButtonBarThemeData? _buttonBarTheme;
|
||||||
|
|
||||||
/// Creates a copy of this theme but with the given fields replaced with the new values.
|
/// Creates a copy of this theme but with the given fields replaced with the new values.
|
||||||
///
|
///
|
||||||
/// The [brightness] value is applied to the [colorScheme].
|
/// The [brightness] value is applied to the [colorScheme].
|
||||||
@ -1449,7 +1469,6 @@ class ThemeData with Diagnosticable {
|
|||||||
BottomAppBarTheme? bottomAppBarTheme,
|
BottomAppBarTheme? bottomAppBarTheme,
|
||||||
BottomNavigationBarThemeData? bottomNavigationBarTheme,
|
BottomNavigationBarThemeData? bottomNavigationBarTheme,
|
||||||
BottomSheetThemeData? bottomSheetTheme,
|
BottomSheetThemeData? bottomSheetTheme,
|
||||||
ButtonBarThemeData? buttonBarTheme,
|
|
||||||
ButtonThemeData? buttonTheme,
|
ButtonThemeData? buttonTheme,
|
||||||
CardTheme? cardTheme,
|
CardTheme? cardTheme,
|
||||||
CheckboxThemeData? checkboxTheme,
|
CheckboxThemeData? checkboxTheme,
|
||||||
@ -1497,6 +1516,11 @@ class ThemeData with Diagnosticable {
|
|||||||
'This feature was deprecated after v3.13.0-0.2.pre.',
|
'This feature was deprecated after v3.13.0-0.2.pre.',
|
||||||
)
|
)
|
||||||
bool? useMaterial3,
|
bool? useMaterial3,
|
||||||
|
@Deprecated(
|
||||||
|
'Use OverflowBar instead. '
|
||||||
|
'This feature was deprecated after v3.21.0-10.0.pre.',
|
||||||
|
)
|
||||||
|
ButtonBarThemeData? buttonBarTheme,
|
||||||
}) {
|
}) {
|
||||||
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
||||||
return ThemeData.raw(
|
return ThemeData.raw(
|
||||||
@ -1554,7 +1578,6 @@ class ThemeData with Diagnosticable {
|
|||||||
bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme,
|
bottomAppBarTheme: bottomAppBarTheme ?? this.bottomAppBarTheme,
|
||||||
bottomNavigationBarTheme: bottomNavigationBarTheme ?? this.bottomNavigationBarTheme,
|
bottomNavigationBarTheme: bottomNavigationBarTheme ?? this.bottomNavigationBarTheme,
|
||||||
bottomSheetTheme: bottomSheetTheme ?? this.bottomSheetTheme,
|
bottomSheetTheme: bottomSheetTheme ?? this.bottomSheetTheme,
|
||||||
buttonBarTheme: buttonBarTheme ?? this.buttonBarTheme,
|
|
||||||
buttonTheme: buttonTheme ?? this.buttonTheme,
|
buttonTheme: buttonTheme ?? this.buttonTheme,
|
||||||
cardTheme: cardTheme ?? this.cardTheme,
|
cardTheme: cardTheme ?? this.cardTheme,
|
||||||
checkboxTheme: checkboxTheme ?? this.checkboxTheme,
|
checkboxTheme: checkboxTheme ?? this.checkboxTheme,
|
||||||
@ -1593,6 +1616,7 @@ class ThemeData with Diagnosticable {
|
|||||||
timePickerTheme: timePickerTheme ?? this.timePickerTheme,
|
timePickerTheme: timePickerTheme ?? this.timePickerTheme,
|
||||||
toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme,
|
toggleButtonsTheme: toggleButtonsTheme ?? this.toggleButtonsTheme,
|
||||||
tooltipTheme: tooltipTheme ?? this.tooltipTheme,
|
tooltipTheme: tooltipTheme ?? this.tooltipTheme,
|
||||||
|
buttonBarTheme: buttonBarTheme ?? _buttonBarTheme,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1747,7 +1771,6 @@ class ThemeData with Diagnosticable {
|
|||||||
bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t),
|
bottomAppBarTheme: BottomAppBarTheme.lerp(a.bottomAppBarTheme, b.bottomAppBarTheme, t),
|
||||||
bottomNavigationBarTheme: BottomNavigationBarThemeData.lerp(a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t),
|
bottomNavigationBarTheme: BottomNavigationBarThemeData.lerp(a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t),
|
||||||
bottomSheetTheme: BottomSheetThemeData.lerp(a.bottomSheetTheme, b.bottomSheetTheme, 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,
|
buttonTheme: t < 0.5 ? a.buttonTheme : b.buttonTheme,
|
||||||
cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t),
|
cardTheme: CardTheme.lerp(a.cardTheme, b.cardTheme, t),
|
||||||
checkboxTheme: CheckboxThemeData.lerp(a.checkboxTheme, b.checkboxTheme, t),
|
checkboxTheme: CheckboxThemeData.lerp(a.checkboxTheme, b.checkboxTheme, t),
|
||||||
@ -1786,6 +1809,7 @@ class ThemeData with Diagnosticable {
|
|||||||
timePickerTheme: TimePickerThemeData.lerp(a.timePickerTheme, b.timePickerTheme, t),
|
timePickerTheme: TimePickerThemeData.lerp(a.timePickerTheme, b.timePickerTheme, t),
|
||||||
toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!,
|
toggleButtonsTheme: ToggleButtonsThemeData.lerp(a.toggleButtonsTheme, b.toggleButtonsTheme, t)!,
|
||||||
tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!,
|
tooltipTheme: TooltipThemeData.lerp(a.tooltipTheme, b.tooltipTheme, t)!,
|
||||||
|
buttonBarTheme: ButtonBarThemeData.lerp(a.buttonBarTheme, b.buttonBarTheme, t),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1847,7 +1871,6 @@ class ThemeData with Diagnosticable {
|
|||||||
other.bottomAppBarTheme == bottomAppBarTheme &&
|
other.bottomAppBarTheme == bottomAppBarTheme &&
|
||||||
other.bottomNavigationBarTheme == bottomNavigationBarTheme &&
|
other.bottomNavigationBarTheme == bottomNavigationBarTheme &&
|
||||||
other.bottomSheetTheme == bottomSheetTheme &&
|
other.bottomSheetTheme == bottomSheetTheme &&
|
||||||
other.buttonBarTheme == buttonBarTheme &&
|
|
||||||
other.buttonTheme == buttonTheme &&
|
other.buttonTheme == buttonTheme &&
|
||||||
other.cardTheme == cardTheme &&
|
other.cardTheme == cardTheme &&
|
||||||
other.checkboxTheme == checkboxTheme &&
|
other.checkboxTheme == checkboxTheme &&
|
||||||
@ -1885,7 +1908,8 @@ class ThemeData with Diagnosticable {
|
|||||||
other.textSelectionTheme == textSelectionTheme &&
|
other.textSelectionTheme == textSelectionTheme &&
|
||||||
other.timePickerTheme == timePickerTheme &&
|
other.timePickerTheme == timePickerTheme &&
|
||||||
other.toggleButtonsTheme == toggleButtonsTheme &&
|
other.toggleButtonsTheme == toggleButtonsTheme &&
|
||||||
other.tooltipTheme == tooltipTheme;
|
other.tooltipTheme == tooltipTheme &&
|
||||||
|
other.buttonBarTheme == buttonBarTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -1945,7 +1969,6 @@ class ThemeData with Diagnosticable {
|
|||||||
bottomAppBarTheme,
|
bottomAppBarTheme,
|
||||||
bottomNavigationBarTheme,
|
bottomNavigationBarTheme,
|
||||||
bottomSheetTheme,
|
bottomSheetTheme,
|
||||||
buttonBarTheme,
|
|
||||||
buttonTheme,
|
buttonTheme,
|
||||||
cardTheme,
|
cardTheme,
|
||||||
checkboxTheme,
|
checkboxTheme,
|
||||||
@ -1984,6 +2007,8 @@ class ThemeData with Diagnosticable {
|
|||||||
timePickerTheme,
|
timePickerTheme,
|
||||||
toggleButtonsTheme,
|
toggleButtonsTheme,
|
||||||
tooltipTheme,
|
tooltipTheme,
|
||||||
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
|
buttonBarTheme,
|
||||||
];
|
];
|
||||||
return Object.hashAll(values);
|
return Object.hashAll(values);
|
||||||
}
|
}
|
||||||
@ -2044,7 +2069,6 @@ class ThemeData with Diagnosticable {
|
|||||||
properties.add(DiagnosticsProperty<BottomAppBarTheme>('bottomAppBarTheme', bottomAppBarTheme, defaultValue: defaultData.bottomAppBarTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<BottomAppBarTheme>('bottomAppBarTheme', bottomAppBarTheme, defaultValue: defaultData.bottomAppBarTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<BottomNavigationBarThemeData>('bottomNavigationBarTheme', bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<BottomNavigationBarThemeData>('bottomNavigationBarTheme', bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<BottomSheetThemeData>('bottomSheetTheme', bottomSheetTheme, defaultValue: defaultData.bottomSheetTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<BottomSheetThemeData>('bottomSheetTheme', bottomSheetTheme, defaultValue: defaultData.bottomSheetTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<ButtonBarThemeData>('buttonBarTheme', buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel.debug));
|
|
||||||
properties.add(DiagnosticsProperty<ButtonThemeData>('buttonTheme', buttonTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<ButtonThemeData>('buttonTheme', buttonTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<CardTheme>('cardTheme', cardTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<CardTheme>('cardTheme', cardTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<CheckboxThemeData>('checkboxTheme', checkboxTheme, defaultValue: defaultData.checkboxTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<CheckboxThemeData>('checkboxTheme', checkboxTheme, defaultValue: defaultData.checkboxTheme, level: DiagnosticLevel.debug));
|
||||||
@ -2083,6 +2107,8 @@ class ThemeData with Diagnosticable {
|
|||||||
properties.add(DiagnosticsProperty<TimePickerThemeData>('timePickerTheme', timePickerTheme, defaultValue: defaultData.timePickerTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<TimePickerThemeData>('timePickerTheme', timePickerTheme, defaultValue: defaultData.timePickerTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<ToggleButtonsThemeData>('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<ToggleButtonsThemeData>('toggleButtonsTheme', toggleButtonsTheme, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<TooltipThemeData>('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<TooltipThemeData>('tooltipTheme', tooltipTheme, level: DiagnosticLevel.debug));
|
||||||
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
|
properties.add(DiagnosticsProperty<ButtonBarThemeData>('buttonBarTheme', buttonBarTheme, defaultValue: defaultData.buttonBarTheme, level: DiagnosticLevel.debug));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
packages/flutter/test_fixes/material/button_bar.dart
Normal file
14
packages/flutter/test_fixes/material/button_bar.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/145523
|
||||||
|
ButtonBar();
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/145523
|
||||||
|
ThemeData theme = ThemeData();
|
||||||
|
theme = ThemeData(buttonBarTheme: ButtonBarThemeData());
|
||||||
|
}
|
14
packages/flutter/test_fixes/material/button_bar.dart.expect
Normal file
14
packages/flutter/test_fixes/material/button_bar.dart.expect
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/145523
|
||||||
|
OverflowBar();
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/145523
|
||||||
|
ThemeData theme = ThemeData();
|
||||||
|
theme = ThemeData();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user