Unverified Commit 3567140d authored by Qun Cheng's avatar Qun Cheng Committed by GitHub

Deprecate `useMaterial3` parameter in `ThemeData.copyWith()` (#131455)

parent 9cdde86f
...@@ -1686,4 +1686,15 @@ transforms: ...@@ -1686,4 +1686,15 @@ transforms:
kind: 'fragment' kind: 'fragment'
value: 'arguments[colorScheme]' value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/131455
- title: "Remove 'useMaterial3'"
date: 2023-07-27
element:
uris: [ 'material.dart' ]
method: 'copyWith'
inClass: 'ThemeData'
changes:
- kind: 'removeParameter'
name: 'useMaterial3'
# 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.
...@@ -1525,7 +1525,6 @@ class ThemeData with Diagnosticable { ...@@ -1525,7 +1525,6 @@ class ThemeData with Diagnosticable {
TargetPlatform? platform, TargetPlatform? platform,
ScrollbarThemeData? scrollbarTheme, ScrollbarThemeData? scrollbarTheme,
InteractiveInkFeatureFactory? splashFactory, InteractiveInkFeatureFactory? splashFactory,
bool? useMaterial3,
VisualDensity? visualDensity, VisualDensity? visualDensity,
// COLOR // COLOR
// [colorScheme] is the preferred way to configure colors. The other color // [colorScheme] is the preferred way to configure colors. The other color
...@@ -1637,6 +1636,14 @@ class ThemeData with Diagnosticable { ...@@ -1637,6 +1636,14 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v3.3.0-0.6.pre.', 'This feature was deprecated after v3.3.0-0.6.pre.',
) )
Color? bottomAppBarColor, Color? bottomAppBarColor,
@Deprecated(
'Use a ThemeData constructor (.from, .light, or .dark) instead. '
'These constructors all have a useMaterial3 argument, '
'and they set appropriate default values based on its value. '
'See the useMaterial3 API documentation for full details. '
'This feature was deprecated after v3.13.0-0.2.pre.',
)
bool? useMaterial3,
}) { }) {
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault(); cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
return ThemeData.raw( return ThemeData.raw(
......
...@@ -234,4 +234,7 @@ void main() { ...@@ -234,4 +234,7 @@ void main() {
themeData = ThemeData(bottomAppBarColor: Colors.green); themeData = ThemeData(bottomAppBarColor: Colors.green);
themeData = ThemeData.raw(bottomAppBarColor: Colors.green); themeData = ThemeData.raw(bottomAppBarColor: Colors.green);
themeData = ThemeData.copyWith(bottomAppBarColor: Colors.green); themeData = ThemeData.copyWith(bottomAppBarColor: Colors.green);
// Changes made in https://github.com/flutter/flutter/pull/131455
ThemeData themeData = ThemeData.copyWith(useMaterial3: false);
} }
...@@ -440,4 +440,7 @@ void main() { ...@@ -440,4 +440,7 @@ void main() {
themeData = ThemeData(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
themeData = ThemeData.raw(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData.raw(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
themeData = ThemeData.copyWith(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green)); themeData = ThemeData.copyWith(bottomAppBarTheme: BottomAppBarTheme(color: Colors.green));
// Changes made in https://github.com/flutter/flutter/pull/131455
ThemeData themeData = ThemeData.copyWith();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment