Unverified Commit 88539266 authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

Deprecate `ThemeData` `errorColor` and `backgroundColor` (#110162)

parent 0c2f7bc2
...@@ -202,7 +202,7 @@ class KeyPad extends StatelessWidget { ...@@ -202,7 +202,7 @@ class KeyPad extends StatelessWidget {
), ),
Expanded( Expanded(
child: Material( child: Material(
color: themeData.backgroundColor, color: themeData.colorScheme.background,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
CalcKey('\u232B', calcState!.handleDelTap), CalcKey('\u232B', calcState!.handleDelTap),
......
...@@ -203,7 +203,7 @@ class _ChipDemoState extends State<ChipDemo> { ...@@ -203,7 +203,7 @@ class _ChipDemoState extends State<ChipDemo> {
assert(name.length > 1); assert(name.length > 1);
final int hash = name.hashCode & 0xffff; final int hash = name.hashCode & 0xffff;
final double hue = (360.0 * hash / (1 << 15)) % 360.0; final double hue = (360.0 * hash / (1 << 15)) % 360.0;
final double themeValue = HSVColor.fromColor(theme.backgroundColor).value; final double themeValue = HSVColor.fromColor(theme.colorScheme.background).value;
return HSVColor.fromAHSV(1.0, hue, 0.4, themeValue).toColor(); return HSVColor.fromAHSV(1.0, hue, 0.4, themeValue).toColor();
} }
......
...@@ -87,7 +87,6 @@ ThemeData _buildShrineTheme() { ...@@ -87,7 +87,6 @@ ThemeData _buildShrineTheme() {
primaryColor: kShrinePink100, primaryColor: kShrinePink100,
scaffoldBackgroundColor: kShrineBackgroundWhite, scaffoldBackgroundColor: kShrineBackgroundWhite,
cardColor: kShrineBackgroundWhite, cardColor: kShrineBackgroundWhite,
errorColor: kShrineErrorRed,
primaryIconTheme: _customIconTheme(base.iconTheme), primaryIconTheme: _customIconTheme(base.iconTheme),
inputDecorationTheme: const InputDecorationTheme(border: CutCornersBorder()), inputDecorationTheme: const InputDecorationTheme(border: CutCornersBorder()),
textTheme: _buildShrineTextTheme(base.textTheme), textTheme: _buildShrineTextTheme(base.textTheme),
......
...@@ -22,6 +22,8 @@ ThemeData _buildDarkTheme() { ...@@ -22,6 +22,8 @@ ThemeData _buildDarkTheme() {
primary: primaryColor, primary: primaryColor,
secondary: secondaryColor, secondary: secondaryColor,
onPrimary: Colors.white, onPrimary: Colors.white,
error: const Color(0xFFB00020),
background: const Color(0xFF202124),
); );
final ThemeData base = ThemeData( final ThemeData base = ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
...@@ -32,8 +34,6 @@ ThemeData _buildDarkTheme() { ...@@ -32,8 +34,6 @@ ThemeData _buildDarkTheme() {
indicatorColor: Colors.white, indicatorColor: Colors.white,
canvasColor: const Color(0xFF202124), canvasColor: const Color(0xFF202124),
scaffoldBackgroundColor: const Color(0xFF202124), scaffoldBackgroundColor: const Color(0xFF202124),
backgroundColor: const Color(0xFF202124),
errorColor: const Color(0xFFB00020),
); );
return base.copyWith( return base.copyWith(
textTheme: _buildTextTheme(base.textTheme), textTheme: _buildTextTheme(base.textTheme),
...@@ -47,6 +47,7 @@ ThemeData _buildLightTheme() { ...@@ -47,6 +47,7 @@ ThemeData _buildLightTheme() {
final ColorScheme colorScheme = const ColorScheme.light().copyWith( final ColorScheme colorScheme = const ColorScheme.light().copyWith(
primary: primaryColor, primary: primaryColor,
secondary: secondaryColor, secondary: secondaryColor,
error: const Color(0xFFB00020),
); );
final ThemeData base = ThemeData( final ThemeData base = ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
...@@ -57,8 +58,6 @@ ThemeData _buildLightTheme() { ...@@ -57,8 +58,6 @@ ThemeData _buildLightTheme() {
splashFactory: InkRipple.splashFactory, splashFactory: InkRipple.splashFactory,
canvasColor: Colors.white, canvasColor: Colors.white,
scaffoldBackgroundColor: Colors.white, scaffoldBackgroundColor: Colors.white,
backgroundColor: Colors.white,
errorColor: const Color(0xFFB00020),
); );
return base.copyWith( return base.copyWith(
textTheme: _buildTextTheme(base.textTheme), textTheme: _buildTextTheme(base.textTheme),
......
...@@ -433,7 +433,7 @@ void sanityCheckDocs() { ...@@ -433,7 +433,7 @@ void sanityCheckDocs() {
// Check a "snippet" example, any one will do. // Check a "snippet" example, any one will do.
final File snippetExample = File('$kPublishRoot/api/widgets/ModalRoute/barrierColor.html'); final File snippetExample = File('$kPublishRoot/api/widgets/ModalRoute/barrierColor.html');
final RegExp snippetRegExp = RegExp(r'\s*<pre class="language-dart" id="sample-code">.*Color get barrierColor =&gt; Theme\.of\(navigator\.context\)\.backgroundColor;.*</pre>'); final RegExp snippetRegExp = RegExp(r'\s*<pre class="language-dart" id="sample-code">.*Color get barrierColor =&gt; Theme\.of\(navigator\.context\)\.colorScheme.background;.*</pre>');
_sanityCheckExample(snippetExample, snippetRegExp); _sanityCheckExample(snippetExample, snippetRegExp);
// Check a "dartpad" example, any one will do. // Check a "dartpad" example, any one will do.
......
...@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget { ...@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget {
// is in its error state. // is in its error state.
floatingLabelStyle: MaterialStateTextStyle.resolveWith( floatingLabelStyle: MaterialStateTextStyle.resolveWith(
(Set<MaterialState> states) { (Set<MaterialState> states) {
final Color color = states.contains(MaterialState.error) ? Theme.of(context).errorColor: Colors.orange; final Color color = states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error: Colors.orange;
return TextStyle(color: color, letterSpacing: 1.3); return TextStyle(color: color, letterSpacing: 1.3);
} }
), ),
......
...@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget { ...@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget {
// is in its error state. // is in its error state.
labelStyle: MaterialStateTextStyle.resolveWith( labelStyle: MaterialStateTextStyle.resolveWith(
(Set<MaterialState> states) { (Set<MaterialState> states) {
final Color color = states.contains(MaterialState.error) ? Theme.of(context).errorColor: Colors.orange; final Color color = states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error: Colors.orange;
return TextStyle(color: color, letterSpacing: 1.3); return TextStyle(color: color, letterSpacing: 1.3);
} }
), ),
......
...@@ -7,7 +7,7 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.fl ...@@ -7,7 +7,7 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.fl
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
testWidgets('InputDecorator label uses errorColor', (WidgetTester tester) async { testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const example.MyApp(), const example.MyApp(),
); );
...@@ -17,6 +17,6 @@ void main() { ...@@ -17,6 +17,6 @@ void main() {
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final AnimatedDefaultTextStyle label = tester.firstWidget(find.ancestor(of: find.text('Name'), matching: find.byType(AnimatedDefaultTextStyle))); final AnimatedDefaultTextStyle label = tester.firstWidget(find.ancestor(of: find.text('Name'), matching: find.byType(AnimatedDefaultTextStyle)));
expect(label.style.color, theme.data.errorColor); expect(label.style.color, theme.data.colorScheme.error);
}); });
} }
...@@ -7,13 +7,13 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.la ...@@ -7,13 +7,13 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.la
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
testWidgets('InputDecorator label uses errorColor', (WidgetTester tester) async { testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
const example.MyApp(), const example.MyApp(),
); );
final Theme theme = tester.firstWidget(find.byType(Theme)); final Theme theme = tester.firstWidget(find.byType(Theme));
final AnimatedDefaultTextStyle label = tester.firstWidget(find.ancestor(of: find.text('Name'), matching: find.byType(AnimatedDefaultTextStyle))); final AnimatedDefaultTextStyle label = tester.firstWidget(find.ancestor(of: find.text('Name'), matching: find.byType(AnimatedDefaultTextStyle)));
expect(label.style.color, theme.data.errorColor); expect(label.style.color, theme.data.colorScheme.error);
}); });
} }
This diff is collapsed.
...@@ -1957,7 +1957,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat ...@@ -1957,7 +1957,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
: themeData.disabledColor; : themeData.disabledColor;
} }
if (decoration.errorText != null) { if (decoration.errorText != null) {
return themeData.errorColor; return themeData.colorScheme.error;
} }
if (isFocused) { if (isFocused) {
return themeData.colorScheme.primary; return themeData.colorScheme.primary;
...@@ -2641,7 +2641,7 @@ class InputDecoration { ...@@ -2641,7 +2641,7 @@ class InputDecoration {
/// ///
/// Note that if you specify this style it will override the default behavior /// Note that if you specify this style it will override the default behavior
/// of [InputDecoration] that changes the color of the label to the /// of [InputDecoration] that changes the color of the label to the
/// [InputDecoration.errorStyle] color or [ThemeData.errorColor]. /// [InputDecoration.errorStyle] color or [ColorScheme.error].
/// ///
/// {@tool dartpad} /// {@tool dartpad}
/// It's possible to override the label style for just the error state, or /// It's possible to override the label style for just the error state, or
...@@ -2671,7 +2671,7 @@ class InputDecoration { ...@@ -2671,7 +2671,7 @@ class InputDecoration {
/// ///
/// Note that if you specify this style it will override the default behavior /// Note that if you specify this style it will override the default behavior
/// of [InputDecoration] that changes the color of the label to the /// of [InputDecoration] that changes the color of the label to the
/// [InputDecoration.errorStyle] color or [ThemeData.errorColor]. /// [InputDecoration.errorStyle] color or [ColorScheme.error].
/// ///
/// {@tool dartpad} /// {@tool dartpad}
/// It's possible to override the label style for just the error state, or /// It's possible to override the label style for just the error state, or
...@@ -4345,7 +4345,7 @@ class _InputDecoratorDefaultsM2 extends InputDecorationTheme { ...@@ -4345,7 +4345,7 @@ class _InputDecoratorDefaultsM2 extends InputDecorationTheme {
return TextStyle(color: Theme.of(context).disabledColor); return TextStyle(color: Theme.of(context).disabledColor);
} }
if (states.contains(MaterialState.error)) { if (states.contains(MaterialState.error)) {
return TextStyle(color: Theme.of(context).errorColor); return TextStyle(color: Theme.of(context).colorScheme.error);
} }
if (states.contains(MaterialState.focused)) { if (states.contains(MaterialState.focused)) {
return TextStyle(color: Theme.of(context).colorScheme.primary); return TextStyle(color: Theme.of(context).colorScheme.primary);
...@@ -4369,7 +4369,7 @@ class _InputDecoratorDefaultsM2 extends InputDecorationTheme { ...@@ -4369,7 +4369,7 @@ class _InputDecoratorDefaultsM2 extends InputDecorationTheme {
if (states.contains(MaterialState.disabled)) { if (states.contains(MaterialState.disabled)) {
return themeData.textTheme.bodySmall!.copyWith(color: Colors.transparent); return themeData.textTheme.bodySmall!.copyWith(color: Colors.transparent);
} }
return themeData.textTheme.bodySmall!.copyWith(color: themeData.errorColor); return themeData.textTheme.bodySmall!.copyWith(color: themeData.colorScheme.error);
}); });
@override @override
......
...@@ -1440,7 +1440,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements ...@@ -1440,7 +1440,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
} }
TextStyle _m2CounterErrorStyle(BuildContext context) => TextStyle _m2CounterErrorStyle(BuildContext context) =>
Theme.of(context).textTheme.bodySmall!.copyWith(color: Theme.of(context).errorColor); Theme.of(context).textTheme.bodySmall!.copyWith(color: Theme.of(context).colorScheme.error);
// BEGIN GENERATED TOKEN PROPERTIES - TextField // BEGIN GENERATED TOKEN PROPERTIES - TextField
......
...@@ -1319,7 +1319,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T ...@@ -1319,7 +1319,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
/// background color, one could say: /// background color, one could say:
/// ///
/// ```dart /// ```dart
/// Color get barrierColor => Theme.of(navigator.context).backgroundColor; /// Color get barrierColor => Theme.of(navigator.context).colorScheme.background;
/// ``` /// ```
/// ///
/// {@end-tool} /// {@end-tool}
......
...@@ -4621,7 +4621,7 @@ void main() { ...@@ -4621,7 +4621,7 @@ void main() {
), ),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(getBorderColor(tester), theme.errorColor); expect(getBorderColor(tester), theme.colorScheme.error);
// Disabled // Disabled
await tester.pumpWidget( await tester.pumpWidget(
......
...@@ -650,7 +650,6 @@ void main() { ...@@ -650,7 +650,6 @@ void main() {
useMaterial3: false, useMaterial3: false,
visualDensity: VisualDensity.standard, visualDensity: VisualDensity.standard,
// COLOR // COLOR
backgroundColor: Colors.black,
bottomAppBarColor: Colors.black, bottomAppBarColor: Colors.black,
canvasColor: Colors.black, canvasColor: Colors.black,
cardColor: Colors.black, cardColor: Colors.black,
...@@ -658,7 +657,6 @@ void main() { ...@@ -658,7 +657,6 @@ void main() {
dialogBackgroundColor: Colors.black, dialogBackgroundColor: Colors.black,
disabledColor: Colors.black, disabledColor: Colors.black,
dividerColor: Colors.black, dividerColor: Colors.black,
errorColor: Colors.black,
focusColor: Colors.black, focusColor: Colors.black,
highlightColor: Colors.black, highlightColor: Colors.black,
hintColor: Colors.black, hintColor: Colors.black,
...@@ -725,6 +723,8 @@ void main() { ...@@ -725,6 +723,8 @@ void main() {
androidOverscrollIndicator: AndroidOverscrollIndicator.glow, androidOverscrollIndicator: AndroidOverscrollIndicator.glow,
toggleableActiveColor: Colors.black, toggleableActiveColor: Colors.black,
selectedRowColor: Colors.black, selectedRowColor: Colors.black,
errorColor: Colors.black,
backgroundColor: Colors.black,
); );
final SliderThemeData otherSliderTheme = SliderThemeData.fromPrimaryColors( final SliderThemeData otherSliderTheme = SliderThemeData.fromPrimaryColors(
...@@ -762,7 +762,6 @@ void main() { ...@@ -762,7 +762,6 @@ void main() {
visualDensity: VisualDensity.standard, visualDensity: VisualDensity.standard,
// COLOR // COLOR
backgroundColor: Colors.white,
bottomAppBarColor: Colors.white, bottomAppBarColor: Colors.white,
canvasColor: Colors.white, canvasColor: Colors.white,
cardColor: Colors.white, cardColor: Colors.white,
...@@ -770,7 +769,6 @@ void main() { ...@@ -770,7 +769,6 @@ void main() {
dialogBackgroundColor: Colors.white, dialogBackgroundColor: Colors.white,
disabledColor: Colors.white, disabledColor: Colors.white,
dividerColor: Colors.white, dividerColor: Colors.white,
errorColor: Colors.white,
focusColor: Colors.white, focusColor: Colors.white,
highlightColor: Colors.white, highlightColor: Colors.white,
hintColor: Colors.white, hintColor: Colors.white,
...@@ -840,6 +838,8 @@ void main() { ...@@ -840,6 +838,8 @@ void main() {
androidOverscrollIndicator: AndroidOverscrollIndicator.stretch, androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
toggleableActiveColor: Colors.white, toggleableActiveColor: Colors.white,
selectedRowColor: Colors.white, selectedRowColor: Colors.white,
errorColor: Colors.white,
backgroundColor: Colors.white,
); );
final ThemeData themeDataCopy = theme.copyWith( final ThemeData themeDataCopy = theme.copyWith(
...@@ -862,7 +862,6 @@ void main() { ...@@ -862,7 +862,6 @@ void main() {
visualDensity: otherTheme.visualDensity, visualDensity: otherTheme.visualDensity,
// COLOR // COLOR
backgroundColor: otherTheme.backgroundColor,
bottomAppBarColor: otherTheme.bottomAppBarColor, bottomAppBarColor: otherTheme.bottomAppBarColor,
canvasColor: otherTheme.canvasColor, canvasColor: otherTheme.canvasColor,
cardColor: otherTheme.cardColor, cardColor: otherTheme.cardColor,
...@@ -870,7 +869,6 @@ void main() { ...@@ -870,7 +869,6 @@ void main() {
dialogBackgroundColor: otherTheme.dialogBackgroundColor, dialogBackgroundColor: otherTheme.dialogBackgroundColor,
disabledColor: otherTheme.disabledColor, disabledColor: otherTheme.disabledColor,
dividerColor: otherTheme.dividerColor, dividerColor: otherTheme.dividerColor,
errorColor: otherTheme.errorColor,
focusColor: otherTheme.focusColor, focusColor: otherTheme.focusColor,
highlightColor: otherTheme.highlightColor, highlightColor: otherTheme.highlightColor,
hintColor: otherTheme.hintColor, hintColor: otherTheme.hintColor,
...@@ -940,6 +938,8 @@ void main() { ...@@ -940,6 +938,8 @@ void main() {
androidOverscrollIndicator: otherTheme.androidOverscrollIndicator, androidOverscrollIndicator: otherTheme.androidOverscrollIndicator,
toggleableActiveColor: otherTheme.toggleableActiveColor, toggleableActiveColor: otherTheme.toggleableActiveColor,
selectedRowColor: otherTheme.selectedRowColor, selectedRowColor: otherTheme.selectedRowColor,
errorColor: otherTheme.errorColor,
backgroundColor: otherTheme.backgroundColor,
); );
// 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
...@@ -961,7 +961,6 @@ void main() { ...@@ -961,7 +961,6 @@ void main() {
expect(themeDataCopy.visualDensity, equals(otherTheme.visualDensity)); expect(themeDataCopy.visualDensity, equals(otherTheme.visualDensity));
// COLOR // COLOR
expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor));
expect(themeDataCopy.bottomAppBarColor, equals(otherTheme.bottomAppBarColor)); expect(themeDataCopy.bottomAppBarColor, equals(otherTheme.bottomAppBarColor));
expect(themeDataCopy.canvasColor, equals(otherTheme.canvasColor)); expect(themeDataCopy.canvasColor, equals(otherTheme.canvasColor));
expect(themeDataCopy.cardColor, equals(otherTheme.cardColor)); expect(themeDataCopy.cardColor, equals(otherTheme.cardColor));
...@@ -969,7 +968,6 @@ void main() { ...@@ -969,7 +968,6 @@ void main() {
expect(themeDataCopy.dialogBackgroundColor, equals(otherTheme.dialogBackgroundColor)); expect(themeDataCopy.dialogBackgroundColor, equals(otherTheme.dialogBackgroundColor));
expect(themeDataCopy.disabledColor, equals(otherTheme.disabledColor)); expect(themeDataCopy.disabledColor, equals(otherTheme.disabledColor));
expect(themeDataCopy.dividerColor, equals(otherTheme.dividerColor)); expect(themeDataCopy.dividerColor, equals(otherTheme.dividerColor));
expect(themeDataCopy.errorColor, equals(otherTheme.errorColor));
expect(themeDataCopy.focusColor, equals(otherTheme.focusColor)); expect(themeDataCopy.focusColor, equals(otherTheme.focusColor));
expect(themeDataCopy.highlightColor, equals(otherTheme.highlightColor)); expect(themeDataCopy.highlightColor, equals(otherTheme.highlightColor));
expect(themeDataCopy.hintColor, equals(otherTheme.hintColor)); expect(themeDataCopy.hintColor, equals(otherTheme.hintColor));
...@@ -1044,6 +1042,8 @@ void main() { ...@@ -1044,6 +1042,8 @@ void main() {
expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator)); expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator));
expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor)); expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor));
expect(themeDataCopy.selectedRowColor, equals(otherTheme.selectedRowColor)); expect(themeDataCopy.selectedRowColor, equals(otherTheme.selectedRowColor));
expect(themeDataCopy.errorColor, equals(otherTheme.errorColor));
expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor));
}); });
testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async { testWidgets('ThemeData.toString has less than 200 characters output', (WidgetTester tester) async {
...@@ -1117,11 +1117,9 @@ void main() { ...@@ -1117,11 +1117,9 @@ void main() {
'unselectedWidgetColor', 'unselectedWidgetColor',
'disabledColor', 'disabledColor',
'secondaryHeaderColor', 'secondaryHeaderColor',
'backgroundColor',
'dialogBackgroundColor', 'dialogBackgroundColor',
'indicatorColor', 'indicatorColor',
'hintColor', 'hintColor',
'errorColor',
// TYPOGRAPHY & ICONOGRAPHY // TYPOGRAPHY & ICONOGRAPHY
'typography', 'typography',
'textTheme', 'textTheme',
...@@ -1175,6 +1173,8 @@ void main() { ...@@ -1175,6 +1173,8 @@ void main() {
'androidOverscrollIndicator', 'androidOverscrollIndicator',
'toggleableActiveColor', 'toggleableActiveColor',
'selectedRowColor', 'selectedRowColor',
'errorColor',
'backgroundColor',
}; };
final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder(); final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();
......
...@@ -516,7 +516,7 @@ void main() { ...@@ -516,7 +516,7 @@ void main() {
colorScheme = ColorScheme.highContrastLight(primaryVariant: Colors.black, secondaryVariant: Colors.white); colorScheme = ColorScheme.highContrastLight(primaryVariant: Colors.black, secondaryVariant: Colors.white);
colorScheme = ColorScheme.highContrastDark(primaryVariant: Colors.black, secondaryVariant: Colors.white); colorScheme = ColorScheme.highContrastDark(primaryVariant: Colors.black, secondaryVariant: Colors.white);
colorScheme = colorScheme.copyWith(primaryVariant: Colors.black, secondaryVariant: Colors.white); colorScheme = colorScheme.copyWith(primaryVariant: Colors.black, secondaryVariant: Colors.white);
colorScheme.primaryVariant; colorScheme.primaryVariant; // Removing field reference not supported.
colorScheme.secondaryVariant; colorScheme.secondaryVariant;
// Changes made in https://github.com/flutter/flutter/pull/96115 // Changes made in https://github.com/flutter/flutter/pull/96115
...@@ -644,4 +644,48 @@ void main() { ...@@ -644,4 +644,48 @@ void main() {
style = textTheme.caption; style = textTheme.caption;
style = textTheme.button; style = textTheme.button;
style = textTheme.overline; style = textTheme.overline;
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(errorColor: Colors.red);
themeData = ThemeData(errorColor: Colors.red, primarySwatch: Colors.blue);
themeData = ThemeData(errorColor: Colors.red, colorScheme: ColorScheme.light());
themeData = ThemeData(errorColor: Colors.red, colorScheme: ColorScheme.light(), primarySwatch: Colors.blue);
themeData = ThemeData(otherParam: '');
themeData = ThemeData.raw(errorColor: Colors.red);
themeData = ThemeData.raw(errorColor: Colors.red, primarySwatch: Colors.blue);
themeData = ThemeData.raw(errorColor: Colors.red, colorScheme: ColorScheme.light());
themeData = ThemeData.raw(errorColor: Colors.red, colorScheme: ColorScheme.light(), primarySwatch: Colors.blue);
themeData = ThemeData.raw(otherParam: '');
themeData = themeData.copyWith(errorColor: Colors.red);
themeData = themeData.copyWith(otherParam: '');
themeData = themeData.copyWith(errorColor: Colors.red, primarySwatch: Colors.blue);
themeData = themeData.copyWith(errorColor: Colors.red, colorScheme: ColorScheme.light());
themeData = themeData.copyWith(errorColor: Colors.red, colorScheme: ColorScheme.light(), primarySwatch: Colors.blue);
themeData.errorColor;
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(backgroundColor: Colors.grey);
themeData = ThemeData(backgroundColor: Colors.grey, primarySwatch: Colors.blue);
themeData = ThemeData(backgroundColor: Colors.grey, colorScheme: ColorScheme.light());
themeData = ThemeData(backgroundColor: Colors.grey, colorScheme: ColorScheme.light(), primarySwatch: Colors.blue);
themeData = ThemeData(otherParam: '');
themeData = ThemeData.raw(backgroundColor: Colors.grey);
themeData = ThemeData.raw(backgroundColor: Colors.grey, primarySwatch: Colors.blue);
themeData = ThemeData.raw(backgroundColor: Colors.grey, colorScheme: ColorScheme.light());
themeData = ThemeData.raw(backgroundColor: Colors.grey, colorScheme: ColorScheme.light(), primarySwatch: Colors.blue);
themeData = ThemeData.raw(otherParam: '');
themeData = themeData.copyWith(backgroundColor: Colors.grey);
themeData = themeData.copyWith(otherParam: '');
themeData = themeData.copyWith(backgroundColor: Colors.grey, primarySwatch: Colors.blue);
themeData = themeData.copyWith(backgroundColor: Colors.grey, colorScheme: ColorScheme.light());
themeData = themeData.copyWith(backgroundColor: Colors.grey, colorScheme: ColorScheme.light(), primarySwatch: Colors.blue);
themeData.backgroundColor;
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(backgroundColor: Colors.grey, errorColor: Colors.red);
themeData = ThemeData.raw(backgroundColor: Colors.grey, errorColor: Colors.red);
themeData = themeData.copyWith(backgroundColor: Colors.grey, errorColor: Colors.red);
} }
...@@ -490,7 +490,7 @@ void main() { ...@@ -490,7 +490,7 @@ void main() {
colorScheme = ColorScheme.highContrastLight(); colorScheme = ColorScheme.highContrastLight();
colorScheme = ColorScheme.highContrastDark(); colorScheme = ColorScheme.highContrastDark();
colorScheme = colorScheme.copyWith(); colorScheme = colorScheme.copyWith();
colorScheme.primaryContainer; colorScheme.primaryContainer; // Removing field reference not supported.
colorScheme.secondaryContainer; colorScheme.secondaryContainer;
// Changes made in https://github.com/flutter/flutter/pull/96115 // Changes made in https://github.com/flutter/flutter/pull/96115
...@@ -848,4 +848,48 @@ void main() { ...@@ -848,4 +848,48 @@ void main() {
style = textTheme.bodySmall; style = textTheme.bodySmall;
style = textTheme.labelLarge; style = textTheme.labelLarge;
style = textTheme.labelSmall; style = textTheme.labelSmall;
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(colorScheme: ColorScheme(error: Colors.red));
themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(error: Colors.red));
themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(error: Colors.red));
themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, error: Colors.red));
themeData = ThemeData(otherParam: '');
themeData = ThemeData.raw(colorScheme: ColorScheme(error: Colors.red));
themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(error: Colors.red));
themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(error: Colors.red));
themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, error: Colors.red));
themeData = ThemeData.raw(otherParam: '');
themeData = themeData.copyWith(colorScheme: ColorScheme(error: Colors.red));
themeData = themeData.copyWith(otherParam: '');
themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(error: Colors.red));
themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(error: Colors.red));
themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, error: Colors.red));
themeData.colorScheme.error;
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(colorScheme: ColorScheme(background: Colors.grey));
themeData = ThemeData(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey));
themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(background: Colors.grey));
themeData = ThemeData(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, background: Colors.grey));
themeData = ThemeData(otherParam: '');
themeData = ThemeData.raw(colorScheme: ColorScheme(background: Colors.grey));
themeData = ThemeData.raw(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey));
themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(background: Colors.grey));
themeData = ThemeData.raw(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, background: Colors.grey));
themeData = ThemeData.raw(otherParam: '');
themeData = themeData.copyWith(colorScheme: ColorScheme(background: Colors.grey));
themeData = themeData.copyWith(otherParam: '');
themeData = themeData.copyWith(colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey));
themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(background: Colors.grey));
themeData = themeData.copyWith(colorScheme: ColorScheme.light().copyWith(primarySwatch: Colors.blue, background: Colors.grey));
themeData.colorScheme.background;
// Changes made in https://github.com/flutter/flutter/pull/110162
ThemeData themeData = ThemeData();
themeData = ThemeData(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
themeData = ThemeData.raw(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
themeData = themeData.copyWith(colorScheme: ColorScheme(error: Colors.red).copyWith(background: Colors.grey));
} }
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