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 {
),
Expanded(
child: Material(
color: themeData.backgroundColor,
color: themeData.colorScheme.background,
child: Column(
children: <Widget>[
CalcKey('\u232B', calcState!.handleDelTap),
......
......@@ -203,7 +203,7 @@ class _ChipDemoState extends State<ChipDemo> {
assert(name.length > 1);
final int hash = name.hashCode & 0xffff;
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();
}
......
......@@ -87,7 +87,6 @@ ThemeData _buildShrineTheme() {
primaryColor: kShrinePink100,
scaffoldBackgroundColor: kShrineBackgroundWhite,
cardColor: kShrineBackgroundWhite,
errorColor: kShrineErrorRed,
primaryIconTheme: _customIconTheme(base.iconTheme),
inputDecorationTheme: const InputDecorationTheme(border: CutCornersBorder()),
textTheme: _buildShrineTextTheme(base.textTheme),
......
......@@ -22,6 +22,8 @@ ThemeData _buildDarkTheme() {
primary: primaryColor,
secondary: secondaryColor,
onPrimary: Colors.white,
error: const Color(0xFFB00020),
background: const Color(0xFF202124),
);
final ThemeData base = ThemeData(
brightness: Brightness.dark,
......@@ -32,8 +34,6 @@ ThemeData _buildDarkTheme() {
indicatorColor: Colors.white,
canvasColor: const Color(0xFF202124),
scaffoldBackgroundColor: const Color(0xFF202124),
backgroundColor: const Color(0xFF202124),
errorColor: const Color(0xFFB00020),
);
return base.copyWith(
textTheme: _buildTextTheme(base.textTheme),
......@@ -47,6 +47,7 @@ ThemeData _buildLightTheme() {
final ColorScheme colorScheme = const ColorScheme.light().copyWith(
primary: primaryColor,
secondary: secondaryColor,
error: const Color(0xFFB00020),
);
final ThemeData base = ThemeData(
brightness: Brightness.light,
......@@ -57,8 +58,6 @@ ThemeData _buildLightTheme() {
splashFactory: InkRipple.splashFactory,
canvasColor: Colors.white,
scaffoldBackgroundColor: Colors.white,
backgroundColor: Colors.white,
errorColor: const Color(0xFFB00020),
);
return base.copyWith(
textTheme: _buildTextTheme(base.textTheme),
......
......@@ -433,7 +433,7 @@ void sanityCheckDocs() {
// Check a "snippet" example, any one will do.
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);
// Check a "dartpad" example, any one will do.
......
......@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget {
// is in its error state.
floatingLabelStyle: MaterialStateTextStyle.resolveWith(
(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);
}
),
......
......@@ -41,7 +41,7 @@ class InputDecoratorExample extends StatelessWidget {
// is in its error state.
labelStyle: MaterialStateTextStyle.resolveWith(
(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);
}
),
......
......@@ -7,7 +7,7 @@ import 'package:flutter_api_samples/material/input_decorator/input_decoration.fl
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('InputDecorator label uses errorColor', (WidgetTester tester) async {
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget(
const example.MyApp(),
);
......@@ -17,6 +17,6 @@ void main() {
await tester.pumpAndSettle();
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
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('InputDecorator label uses errorColor', (WidgetTester tester) async {
testWidgets('InputDecorator label uses error color', (WidgetTester tester) async {
await tester.pumpWidget(
const example.MyApp(),
);
final Theme theme = tester.firstWidget(find.byType(Theme));
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);
});
}
......@@ -17,6 +17,454 @@
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.background'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
field: 'backgroundColor'
inClass: 'ThemeData'
changes:
- kind: 'rename'
newName: 'colorScheme.background'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.background'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
method: 'copyWith'
inClass: 'ThemeData'
oneOf:
- if: "backgroundColor != '' && primarySwatch == '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch == '' && colorScheme ==''"
- kind: 'removeParameter'
name: 'backgroundColor'
- if: "backgroundColor != '' && primarySwatch != '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme.fromSwatch(primarySwatch: {% primarySwatch %}).copyWith(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch != '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- kind: 'removeParameter'
name: 'primarySwatch'
- if: "backgroundColor != '' && primarySwatch == '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch == '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- if: "backgroundColor != '' && primarySwatch != '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(primarySwatch: {% primarySwatch %}, background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch != '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- kind: 'removeParameter'
name: 'primarySwatch'
variables:
backgroundColor:
kind: 'fragment'
value: 'arguments[backgroundColor]'
primarySwatch:
kind: 'fragment'
value: 'arguments[primarySwatch]'
colorScheme:
kind: 'fragment'
value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.background'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
constructor: 'raw'
inClass: 'ThemeData'
oneOf:
- if: "backgroundColor != '' && primarySwatch == '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch == '' && colorScheme ==''"
- kind: 'removeParameter'
name: 'backgroundColor'
- if: "backgroundColor != '' && primarySwatch != '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme.fromSwatch(primarySwatch: {% primarySwatch %}).copyWith(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch != '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- kind: 'removeParameter'
name: 'primarySwatch'
- if: "backgroundColor != '' && primarySwatch == '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch == '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- if: "backgroundColor != '' && primarySwatch != '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(primarySwatch: {% primarySwatch %}, background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch != '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- kind: 'removeParameter'
name: 'primarySwatch'
variables:
backgroundColor:
kind: 'fragment'
value: 'arguments[backgroundColor]'
primarySwatch:
kind: 'fragment'
value: 'arguments[primarySwatch]'
colorScheme:
kind: 'fragment'
value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.background'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'ThemeData'
oneOf:
- if: "backgroundColor != '' && primarySwatch == '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch == '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- if: "backgroundColor != '' && primarySwatch != '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme.fromSwatch(primarySwatch: {% primarySwatch %}).copyWith(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch != '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- kind: 'removeParameter'
name: 'primarySwatch'
- if: "backgroundColor != '' && primarySwatch == '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch == '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- if: "backgroundColor != '' && primarySwatch != '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(primarySwatch: {% primarySwatch %}, background: {% backgroundColor %})'
requiredIf: "backgroundColor != '' && primarySwatch != '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'backgroundColor'
- kind: 'removeParameter'
name: 'primarySwatch'
variables:
backgroundColor:
kind: 'fragment'
value: 'arguments[backgroundColor]'
primarySwatch:
kind: 'fragment'
value: 'arguments[primarySwatch]'
colorScheme:
kind: 'fragment'
value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.error'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
field: 'errorColor'
inClass: 'ThemeData'
changes:
- kind: 'rename'
newName: 'colorScheme.error'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.error'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
method: 'copyWith'
inClass: 'ThemeData'
oneOf:
- if: "errorColor != '' && primarySwatch == '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch == '' && colorScheme ==''"
- kind: 'removeParameter'
name: 'errorColor'
- if: "errorColor != '' && primarySwatch != '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme.fromSwatch(primarySwatch: {% primarySwatch %}).copyWith(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch != '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'errorColor'
- kind: 'removeParameter'
name: 'primarySwatch'
- if: "errorColor != '' && primarySwatch == '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch == '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'errorColor'
- if: "errorColor != '' && primarySwatch != '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(primarySwatch: {% primarySwatch %}, error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch != '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'errorColor'
- kind: 'removeParameter'
name: 'primarySwatch'
variables:
errorColor:
kind: 'fragment'
value: 'arguments[errorColor]'
primarySwatch:
kind: 'fragment'
value: 'arguments[primarySwatch]'
colorScheme:
kind: 'fragment'
value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.error'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
constructor: 'raw'
inClass: 'ThemeData'
oneOf:
- if: "errorColor != '' && primarySwatch == '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch == '' && colorScheme ==''"
- kind: 'removeParameter'
name: 'errorColor'
- if: "errorColor != '' && primarySwatch != '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme.fromSwatch(primarySwatch: {% primarySwatch %}).copyWith(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch != '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'errorColor'
- kind: 'removeParameter'
name: 'primarySwatch'
- if: "errorColor != '' && primarySwatch == '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch == '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'errorColor'
- if: "errorColor != '' && primarySwatch != '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(primarySwatch: {% primarySwatch %}, error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch != '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'errorColor'
- kind: 'removeParameter'
name: 'primarySwatch'
variables:
errorColor:
kind: 'fragment'
value: 'arguments[errorColor]'
primarySwatch:
kind: 'fragment'
value: 'arguments[primarySwatch]'
colorScheme:
kind: 'fragment'
value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/110162
- title: "Migrate to 'ColorScheme.error'"
date: 2022-08-24
element:
uris: [ 'material.dart' ]
constructor: ''
inClass: 'ThemeData'
oneOf:
- if: "errorColor != '' && primarySwatch == '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch == '' && colorScheme ==''"
- kind: 'removeParameter'
name: 'errorColor'
- if: "errorColor != '' && primarySwatch != '' && colorScheme == ''"
changes:
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: 'ColorScheme.fromSwatch(primarySwatch: {% primarySwatch %}).copyWith(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch != '' && colorScheme == ''"
- kind: 'removeParameter'
name: 'errorColor'
- kind: 'removeParameter'
name: 'primarySwatch'
- if: "errorColor != '' && primarySwatch == '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch == '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'errorColor'
- if: "errorColor != '' && primarySwatch != '' && colorScheme != ''"
changes:
- kind: 'removeParameter'
name: 'colorScheme' # Remove to add back with modification
- kind: 'addParameter'
index: 56
name: 'colorScheme'
style: optional_named
argumentValue:
expression: '{% colorScheme %}.copyWith(primarySwatch: {% primarySwatch %}, error: {% errorColor %})'
requiredIf: "errorColor != '' && primarySwatch != '' && colorScheme != ''"
- kind: 'removeParameter'
name: 'errorColor'
- kind: 'removeParameter'
name: 'primarySwatch'
variables:
errorColor:
kind: 'fragment'
value: 'arguments[errorColor]'
primarySwatch:
kind: 'fragment'
value: 'arguments[primarySwatch]'
colorScheme:
kind: 'fragment'
value: 'arguments[colorScheme]'
# Changes made in https://github.com/flutter/flutter/pull/109817
- title: "Rename to 'displayLarge'"
date: 2022-08-18
......@@ -5049,4 +5497,4 @@ transforms:
- kind: 'removeParameter'
name: 'brightness'
# 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.
\ No newline at end of file
......@@ -1957,7 +1957,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
: themeData.disabledColor;
}
if (decoration.errorText != null) {
return themeData.errorColor;
return themeData.colorScheme.error;
}
if (isFocused) {
return themeData.colorScheme.primary;
......@@ -2641,7 +2641,7 @@ class InputDecoration {
///
/// Note that if you specify this style it will override the default behavior
/// 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}
/// It's possible to override the label style for just the error state, or
......@@ -2671,7 +2671,7 @@ class InputDecoration {
///
/// Note that if you specify this style it will override the default behavior
/// 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}
/// It's possible to override the label style for just the error state, or
......@@ -4345,7 +4345,7 @@ class _InputDecoratorDefaultsM2 extends InputDecorationTheme {
return TextStyle(color: Theme.of(context).disabledColor);
}
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)) {
return TextStyle(color: Theme.of(context).colorScheme.primary);
......@@ -4369,7 +4369,7 @@ class _InputDecoratorDefaultsM2 extends InputDecorationTheme {
if (states.contains(MaterialState.disabled)) {
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
......
......@@ -1440,7 +1440,7 @@ class _TextFieldState extends State<TextField> with RestorationMixin implements
}
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
......
......@@ -295,7 +295,6 @@ class ThemeData with Diagnosticable {
// [colorScheme] is the preferred way to configure colors. The other color
// properties (as well as primaryColorBrightness, and primarySwatch)
// will gradually be phased out, see https://github.com/flutter/flutter/issues/91772.
Color? backgroundColor,
Color? bottomAppBarColor,
Brightness? brightness,
Color? canvasColor,
......@@ -305,7 +304,6 @@ class ThemeData with Diagnosticable {
Color? dialogBackgroundColor,
Color? disabledColor,
Color? dividerColor,
Color? errorColor,
Color? focusColor,
Color? highlightColor,
Color? hintColor,
......@@ -424,6 +422,16 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v3.1.0-0.0.pre.',
)
Color? selectedRowColor,
@Deprecated(
'Use colorScheme.error instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Color? errorColor,
@Deprecated(
'Use colorScheme.background instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Color? backgroundColor,
}) {
// GENERAL CONFIGURATION
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
......@@ -507,19 +515,17 @@ class ThemeData with Diagnosticable {
primaryColorDark: primaryColorDark,
accentColor: accentColor,
cardColor: cardColor,
backgroundColor: backgroundColor,
errorColor: errorColor,
backgroundColor: isDark ? Colors.grey[700]! : primarySwatch[200]!,
errorColor: Colors.red[700],
brightness: effectiveBrightness,
);
selectedRowColor ??= Colors.grey[100]!;
unselectedWidgetColor ??= isDark ? Colors.white70 : Colors.black54;
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
secondaryHeaderColor ??= isDark ? Colors.grey[700]! : primarySwatch[50]!;
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
dialogBackgroundColor ??= isDark ? Colors.grey[800]! : Colors.white;
indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor;
hintColor ??= isDark ? Colors.white60 : Colors.black.withOpacity(0.6);
errorColor ??= Colors.red[700]!;
// The default [buttonTheme] is here because it doesn't use the defaults for
// [disabledColor], [highlightColor], and [splashColor].
buttonTheme ??= ButtonThemeData(
......@@ -587,12 +593,14 @@ class ThemeData with Diagnosticable {
tooltipTheme ??= const TooltipThemeData();
expansionTileTheme ??= const ExpansionTileThemeData();
// DEPRECATED (newest deprecations at the bottom)
// DEPRECATED (newest deprecations at the bottom)
accentTextTheme = defaultAccentTextTheme.merge(accentTextTheme);
accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
buttonColor ??= isDark ? primarySwatch[600]! : Colors.grey[300]!;
fixTextFieldOutlineLabel ??= true;
primaryColorBrightness = estimatedPrimaryColorBrightness;
errorColor ??= Colors.red[700]!;
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
return ThemeData.raw(
// For the sanity of the reader, make sure these properties are in the same
......@@ -613,7 +621,6 @@ class ThemeData with Diagnosticable {
useMaterial3: useMaterial3,
visualDensity: visualDensity,
// COLOR
backgroundColor: backgroundColor,
bottomAppBarColor: bottomAppBarColor,
canvasColor: canvasColor,
cardColor: cardColor,
......@@ -621,7 +628,6 @@ class ThemeData with Diagnosticable {
dialogBackgroundColor: dialogBackgroundColor,
disabledColor: disabledColor,
dividerColor: dividerColor,
errorColor: errorColor,
focusColor: focusColor,
highlightColor: highlightColor,
hintColor: hintColor,
......@@ -688,6 +694,8 @@ class ThemeData with Diagnosticable {
androidOverscrollIndicator: androidOverscrollIndicator,
toggleableActiveColor: toggleableActiveColor,
selectedRowColor: selectedRowColor,
errorColor: errorColor,
backgroundColor: backgroundColor,
);
}
......@@ -720,7 +728,6 @@ class ThemeData with Diagnosticable {
// [colorScheme] is the preferred way to configure colors. The other color
// properties will gradually be phased out, see
// https://github.com/flutter/flutter/issues/91772.
required this.backgroundColor,
required this.bottomAppBarColor,
required this.canvasColor,
required this.cardColor,
......@@ -728,7 +735,6 @@ class ThemeData with Diagnosticable {
required this.dialogBackgroundColor,
required this.disabledColor,
required this.dividerColor,
required this.errorColor,
required this.focusColor,
required this.highlightColor,
required this.hintColor,
......@@ -845,6 +851,16 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v3.1.0-0.0.pre.',
)
Color? selectedRowColor,
@Deprecated(
'Use colorScheme.error instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Color? errorColor,
@Deprecated(
'Use colorScheme.background instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Color? backgroundColor,
}) : // DEPRECATED (newest deprecations at the bottom)
// should not be `required`, use getter pattern to avoid breakages.
_accentColor = accentColor,
......@@ -856,6 +872,8 @@ class ThemeData with Diagnosticable {
_primaryColorBrightness = primaryColorBrightness,
_toggleableActiveColor = toggleableActiveColor,
_selectedRowColor = selectedRowColor,
_errorColor = errorColor,
_backgroundColor = backgroundColor,
// GENERAL CONFIGURATION
assert(applyElevationOverlayColor != null),
assert(extensions != null),
......@@ -868,7 +886,6 @@ class ThemeData with Diagnosticable {
assert(useMaterial3 != null),
assert(visualDensity != null),
// COLOR
assert(backgroundColor != null),
assert(bottomAppBarColor != null),
assert(canvasColor != null),
assert(cardColor != null),
......@@ -876,7 +893,6 @@ class ThemeData with Diagnosticable {
assert(dialogBackgroundColor != null),
assert(disabledColor != null),
assert(dividerColor != null),
assert(errorColor != null),
assert(focusColor != null),
assert(highlightColor != null),
assert(hintColor != null),
......@@ -932,7 +948,17 @@ class ThemeData with Diagnosticable {
assert(textSelectionTheme != null),
assert(timePickerTheme != null),
assert(toggleButtonsTheme != null),
assert(tooltipTheme != null);
assert(tooltipTheme != null),
// DEPRECATED (newest deprecations at the bottom)
assert(accentColor != null),
assert(accentColorBrightness != null),
assert(accentTextTheme != null),
assert(accentIconTheme != null),
assert(buttonColor != null),
assert(fixTextFieldOutlineLabel != null),
assert(primaryColorBrightness != null),
assert(errorColor != null),
assert(backgroundColor != null);
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
/// text styles of the optional [textTheme].
......@@ -1277,10 +1303,6 @@ class ThemeData with Diagnosticable {
// COLOR
/// A color that contrasts with the [primaryColor], e.g. used as the
/// remaining part of a progress bar.
final Color backgroundColor;
/// The default color of the [BottomAppBar].
///
/// This can be overridden by specifying [BottomAppBar.color].
......@@ -1317,9 +1339,6 @@ class ThemeData with Diagnosticable {
/// [Divider.createBorderSide].
final Color dividerColor;
/// The color to use for input validation errors, e.g. in [TextField] fields.
final Color errorColor;
/// The focus color used indicate that a component has the input focus.
final Color focusColor;
......@@ -1683,6 +1702,24 @@ class ThemeData with Diagnosticable {
)
final AndroidOverscrollIndicator? androidOverscrollIndicator;
/// Obsolete property that was used for input validation errors, e.g. in
/// [TextField] fields. Use [ColorScheme.error] instead.
@Deprecated(
'Use colorScheme.error instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Color get errorColor => _errorColor!;
final Color? _errorColor;
/// Obsolete property that was unused by the framework.
/// Use [ColorScheme.background] instead.
@Deprecated(
'Use colorScheme.background instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Color get backgroundColor => _backgroundColor!;
final Color? _backgroundColor;
/// Creates a copy of this theme but with the given fields replaced with the new values.
///
/// The [brightness] value is applied to the [colorScheme].
......@@ -1708,7 +1745,6 @@ class ThemeData with Diagnosticable {
// [colorScheme] is the preferred way to configure colors. The other color
// properties will gradually be phased out, see
// https://github.com/flutter/flutter/issues/91772.
Color? backgroundColor,
Color? bottomAppBarColor,
Brightness? brightness,
Color? canvasColor,
......@@ -1717,7 +1753,6 @@ class ThemeData with Diagnosticable {
Color? dialogBackgroundColor,
Color? disabledColor,
Color? dividerColor,
Color? errorColor,
Color? focusColor,
Color? highlightColor,
Color? hintColor,
......@@ -1834,6 +1869,16 @@ class ThemeData with Diagnosticable {
'This feature was deprecated after v3.1.0-0.0.pre.',
)
Color? selectedRowColor,
@Deprecated(
'Use colorScheme.error instead. '
'This feature was deprecated after v2.6.0-11.0.pre.',
)
Color? errorColor,
@Deprecated(
'Use colorScheme.background instead. '
'This feature was deprecated after v2.6.0-11.0.pre.',
)
Color? backgroundColor,
}) {
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
return ThemeData.raw(
......@@ -1855,7 +1900,6 @@ class ThemeData with Diagnosticable {
useMaterial3: useMaterial3 ?? this.useMaterial3,
visualDensity: visualDensity ?? this.visualDensity,
// COLOR
backgroundColor: backgroundColor ?? this.backgroundColor,
bottomAppBarColor: bottomAppBarColor ?? this.bottomAppBarColor,
canvasColor: canvasColor ?? this.canvasColor,
cardColor: cardColor ?? this.cardColor,
......@@ -1863,7 +1907,6 @@ class ThemeData with Diagnosticable {
dialogBackgroundColor: dialogBackgroundColor ?? this.dialogBackgroundColor,
disabledColor: disabledColor ?? this.disabledColor,
dividerColor: dividerColor ?? this.dividerColor,
errorColor: errorColor ?? this.errorColor,
focusColor: focusColor ?? this.focusColor,
highlightColor: highlightColor ?? this.highlightColor,
hintColor: hintColor ?? this.hintColor,
......@@ -1930,6 +1973,8 @@ class ThemeData with Diagnosticable {
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor,
selectedRowColor: selectedRowColor ?? _selectedRowColor,
errorColor: errorColor ?? _errorColor,
backgroundColor: backgroundColor ?? _backgroundColor,
);
}
......@@ -2055,7 +2100,6 @@ class ThemeData with Diagnosticable {
useMaterial3: t < 0.5 ? a.useMaterial3 : b.useMaterial3,
visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t),
// COLOR
backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t)!,
bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t)!,
canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!,
cardColor: Color.lerp(a.cardColor, b.cardColor, t)!,
......@@ -2063,7 +2107,6 @@ class ThemeData with Diagnosticable {
dialogBackgroundColor: Color.lerp(a.dialogBackgroundColor, b.dialogBackgroundColor, t)!,
disabledColor: Color.lerp(a.disabledColor, b.disabledColor, t)!,
dividerColor: Color.lerp(a.dividerColor, b.dividerColor, t)!,
errorColor: Color.lerp(a.errorColor, b.errorColor, t)!,
focusColor: Color.lerp(a.focusColor, b.focusColor, t)!,
highlightColor: Color.lerp(a.highlightColor, b.highlightColor, t)!,
hintColor: Color.lerp(a.hintColor, b.hintColor, t)!,
......@@ -2130,6 +2173,8 @@ class ThemeData with Diagnosticable {
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t),
selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, t),
errorColor: Color.lerp(a.errorColor, b.errorColor, t),
backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t),
);
}
......@@ -2157,7 +2202,6 @@ class ThemeData with Diagnosticable {
other.useMaterial3 == useMaterial3 &&
other.visualDensity == visualDensity &&
// COLOR
other.backgroundColor == backgroundColor &&
other.bottomAppBarColor == bottomAppBarColor &&
other.canvasColor == canvasColor &&
other.cardColor == cardColor &&
......@@ -2165,7 +2209,6 @@ class ThemeData with Diagnosticable {
other.dialogBackgroundColor == dialogBackgroundColor &&
other.disabledColor == disabledColor &&
other.dividerColor == dividerColor &&
other.errorColor == errorColor &&
other.focusColor == focusColor &&
other.highlightColor == highlightColor &&
other.hintColor == hintColor &&
......@@ -2231,7 +2274,9 @@ class ThemeData with Diagnosticable {
other.primaryColorBrightness == primaryColorBrightness &&
other.androidOverscrollIndicator == androidOverscrollIndicator &&
other.toggleableActiveColor == toggleableActiveColor &&
other.selectedRowColor == selectedRowColor;
other.selectedRowColor == selectedRowColor &&
other.errorColor == errorColor &&
other.backgroundColor == backgroundColor;
}
@override
......@@ -2256,7 +2301,6 @@ class ThemeData with Diagnosticable {
useMaterial3,
visualDensity,
// COLOR
backgroundColor,
bottomAppBarColor,
canvasColor,
cardColor,
......@@ -2264,7 +2308,6 @@ class ThemeData with Diagnosticable {
dialogBackgroundColor,
disabledColor,
dividerColor,
errorColor,
focusColor,
highlightColor,
hintColor,
......@@ -2331,6 +2374,8 @@ class ThemeData with Diagnosticable {
androidOverscrollIndicator,
toggleableActiveColor,
selectedRowColor,
errorColor,
backgroundColor,
];
return Object.hashAll(values);
}
......@@ -2357,7 +2402,6 @@ class ThemeData with Diagnosticable {
properties.add(DiagnosticsProperty<bool>('useMaterial3', useMaterial3, defaultValue: defaultData.useMaterial3, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: defaultData.visualDensity, level: DiagnosticLevel.debug));
// COLORS
properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('bottomAppBarColor', bottomAppBarColor, defaultValue: defaultData.bottomAppBarColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('canvasColor', canvasColor, defaultValue: defaultData.canvasColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('cardColor', cardColor, defaultValue: defaultData.cardColor, level: DiagnosticLevel.debug));
......@@ -2365,7 +2409,6 @@ class ThemeData with Diagnosticable {
properties.add(ColorProperty('dialogBackgroundColor', dialogBackgroundColor, defaultValue: defaultData.dialogBackgroundColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('disabledColor', disabledColor, defaultValue: defaultData.disabledColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('dividerColor', dividerColor, defaultValue: defaultData.dividerColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('errorColor', errorColor, defaultValue: defaultData.errorColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('focusColor', focusColor, defaultValue: defaultData.focusColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('highlightColor', highlightColor, defaultValue: defaultData.highlightColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('hintColor', hintColor, defaultValue: defaultData.hintColor, level: DiagnosticLevel.debug));
......@@ -2432,6 +2475,8 @@ class ThemeData with Diagnosticable {
properties.add(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug));
properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('selectedRowColor', selectedRowColor, defaultValue: defaultData.selectedRowColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('errorColor', errorColor, defaultValue: defaultData.errorColor, level: DiagnosticLevel.debug));
properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor, level: DiagnosticLevel.debug));
}
}
......
......@@ -1319,7 +1319,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
/// background color, one could say:
///
/// ```dart
/// Color get barrierColor => Theme.of(navigator.context).backgroundColor;
/// Color get barrierColor => Theme.of(navigator.context).colorScheme.background;
/// ```
///
/// {@end-tool}
......
......@@ -4621,7 +4621,7 @@ void main() {
),
);
await tester.pumpAndSettle();
expect(getBorderColor(tester), theme.errorColor);
expect(getBorderColor(tester), theme.colorScheme.error);
// Disabled
await tester.pumpWidget(
......
......@@ -650,7 +650,6 @@ void main() {
useMaterial3: false,
visualDensity: VisualDensity.standard,
// COLOR
backgroundColor: Colors.black,
bottomAppBarColor: Colors.black,
canvasColor: Colors.black,
cardColor: Colors.black,
......@@ -658,7 +657,6 @@ void main() {
dialogBackgroundColor: Colors.black,
disabledColor: Colors.black,
dividerColor: Colors.black,
errorColor: Colors.black,
focusColor: Colors.black,
highlightColor: Colors.black,
hintColor: Colors.black,
......@@ -725,6 +723,8 @@ void main() {
androidOverscrollIndicator: AndroidOverscrollIndicator.glow,
toggleableActiveColor: Colors.black,
selectedRowColor: Colors.black,
errorColor: Colors.black,
backgroundColor: Colors.black,
);
final SliderThemeData otherSliderTheme = SliderThemeData.fromPrimaryColors(
......@@ -762,7 +762,6 @@ void main() {
visualDensity: VisualDensity.standard,
// COLOR
backgroundColor: Colors.white,
bottomAppBarColor: Colors.white,
canvasColor: Colors.white,
cardColor: Colors.white,
......@@ -770,7 +769,6 @@ void main() {
dialogBackgroundColor: Colors.white,
disabledColor: Colors.white,
dividerColor: Colors.white,
errorColor: Colors.white,
focusColor: Colors.white,
highlightColor: Colors.white,
hintColor: Colors.white,
......@@ -840,6 +838,8 @@ void main() {
androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
toggleableActiveColor: Colors.white,
selectedRowColor: Colors.white,
errorColor: Colors.white,
backgroundColor: Colors.white,
);
final ThemeData themeDataCopy = theme.copyWith(
......@@ -862,7 +862,6 @@ void main() {
visualDensity: otherTheme.visualDensity,
// COLOR
backgroundColor: otherTheme.backgroundColor,
bottomAppBarColor: otherTheme.bottomAppBarColor,
canvasColor: otherTheme.canvasColor,
cardColor: otherTheme.cardColor,
......@@ -870,7 +869,6 @@ void main() {
dialogBackgroundColor: otherTheme.dialogBackgroundColor,
disabledColor: otherTheme.disabledColor,
dividerColor: otherTheme.dividerColor,
errorColor: otherTheme.errorColor,
focusColor: otherTheme.focusColor,
highlightColor: otherTheme.highlightColor,
hintColor: otherTheme.hintColor,
......@@ -940,6 +938,8 @@ void main() {
androidOverscrollIndicator: otherTheme.androidOverscrollIndicator,
toggleableActiveColor: otherTheme.toggleableActiveColor,
selectedRowColor: otherTheme.selectedRowColor,
errorColor: otherTheme.errorColor,
backgroundColor: otherTheme.backgroundColor,
);
// For the sanity of the reader, make sure these properties are in the same
......@@ -961,7 +961,6 @@ void main() {
expect(themeDataCopy.visualDensity, equals(otherTheme.visualDensity));
// COLOR
expect(themeDataCopy.backgroundColor, equals(otherTheme.backgroundColor));
expect(themeDataCopy.bottomAppBarColor, equals(otherTheme.bottomAppBarColor));
expect(themeDataCopy.canvasColor, equals(otherTheme.canvasColor));
expect(themeDataCopy.cardColor, equals(otherTheme.cardColor));
......@@ -969,7 +968,6 @@ void main() {
expect(themeDataCopy.dialogBackgroundColor, equals(otherTheme.dialogBackgroundColor));
expect(themeDataCopy.disabledColor, equals(otherTheme.disabledColor));
expect(themeDataCopy.dividerColor, equals(otherTheme.dividerColor));
expect(themeDataCopy.errorColor, equals(otherTheme.errorColor));
expect(themeDataCopy.focusColor, equals(otherTheme.focusColor));
expect(themeDataCopy.highlightColor, equals(otherTheme.highlightColor));
expect(themeDataCopy.hintColor, equals(otherTheme.hintColor));
......@@ -1044,6 +1042,8 @@ void main() {
expect(themeDataCopy.androidOverscrollIndicator, equals(otherTheme.androidOverscrollIndicator));
expect(themeDataCopy.toggleableActiveColor, equals(otherTheme.toggleableActiveColor));
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 {
......@@ -1117,11 +1117,9 @@ void main() {
'unselectedWidgetColor',
'disabledColor',
'secondaryHeaderColor',
'backgroundColor',
'dialogBackgroundColor',
'indicatorColor',
'hintColor',
'errorColor',
// TYPOGRAPHY & ICONOGRAPHY
'typography',
'textTheme',
......@@ -1175,6 +1173,8 @@ void main() {
'androidOverscrollIndicator',
'toggleableActiveColor',
'selectedRowColor',
'errorColor',
'backgroundColor',
};
final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();
......
......@@ -516,7 +516,7 @@ void main() {
colorScheme = ColorScheme.highContrastLight(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.primaryVariant;
colorScheme.primaryVariant; // Removing field reference not supported.
colorScheme.secondaryVariant;
// Changes made in https://github.com/flutter/flutter/pull/96115
......@@ -644,4 +644,48 @@ void main() {
style = textTheme.caption;
style = textTheme.button;
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() {
colorScheme = ColorScheme.highContrastLight();
colorScheme = ColorScheme.highContrastDark();
colorScheme = colorScheme.copyWith();
colorScheme.primaryContainer;
colorScheme.primaryContainer; // Removing field reference not supported.
colorScheme.secondaryContainer;
// Changes made in https://github.com/flutter/flutter/pull/96115
......@@ -798,54 +798,98 @@ void main() {
themeData.selectedRowColor; // Removing field reference not supported.
// Changes made in https://github.com/flutter/flutter/pull/109817
var TextTheme textTheme = TextTheme(
displayLarge: headline1Style,
displayMedium: headline2Style,
displaySmall: headline3Style,
headlineMedium: headline4Style,
headlineSmall: headline5Style,
titleLarge: headline6Style,
titleMedium: subtitle1Style,
titleSmall: subtitle2Style,
bodyLarge: bodyText1Style,
bodyMedium: bodyText2Style,
bodySmall: captionStyle,
labelLarge: buttonStyle,
labelSmall: overlineStyle,
);
var TextTheme textTheme = TextTheme(error: '');
// Changes made in https://github.com/flutter/flutter/pull/109817
var TextTheme copiedTextTheme = TextTheme.copyWith(
displayLarge: headline1Style,
displayMedium: headline2Style,
displaySmall: headline3Style,
headlineMedium: headline4Style,
headlineSmall: headline5Style,
titleLarge: headline6Style,
titleMedium: subtitle1Style,
titleSmall: subtitle2Style,
bodyLarge: bodyText1Style,
bodyMedium: bodyText2Style,
bodySmall: captionStyle,
labelLarge: buttonStyle,
labelSmall: overlineStyle,
);
var TextTheme copiedTextTheme = TextTheme.copyWith(error: '');
// Changes made in https://github.com/flutter/flutter/pull/109817
var style;
style = textTheme.displayLarge;
style = textTheme.displayMedium;
style = textTheme.displaySmall;
style = textTheme.headlineMedium;
style = textTheme.headlineSmall;
style = textTheme.titleLarge;
style = textTheme.titleMedium;
style = textTheme.titleSmall;
style = textTheme.bodyLarge;
style = textTheme.bodyMedium;
style = textTheme.bodySmall;
style = textTheme.labelLarge;
style = textTheme.labelSmall;
var TextTheme textTheme = TextTheme(
displayLarge: headline1Style,
displayMedium: headline2Style,
displaySmall: headline3Style,
headlineMedium: headline4Style,
headlineSmall: headline5Style,
titleLarge: headline6Style,
titleMedium: subtitle1Style,
titleSmall: subtitle2Style,
bodyLarge: bodyText1Style,
bodyMedium: bodyText2Style,
bodySmall: captionStyle,
labelLarge: buttonStyle,
labelSmall: overlineStyle,
);
var TextTheme textTheme = TextTheme(error: '');
// Changes made in https://github.com/flutter/flutter/pull/109817
var TextTheme copiedTextTheme = TextTheme.copyWith(
displayLarge: headline1Style,
displayMedium: headline2Style,
displaySmall: headline3Style,
headlineMedium: headline4Style,
headlineSmall: headline5Style,
titleLarge: headline6Style,
titleMedium: subtitle1Style,
titleSmall: subtitle2Style,
bodyLarge: bodyText1Style,
bodyMedium: bodyText2Style,
bodySmall: captionStyle,
labelLarge: buttonStyle,
labelSmall: overlineStyle,
);
var TextTheme copiedTextTheme = TextTheme.copyWith(error: '');
// Changes made in https://github.com/flutter/flutter/pull/109817
var style;
style = textTheme.displayLarge;
style = textTheme.displayMedium;
style = textTheme.displaySmall;
style = textTheme.headlineMedium;
style = textTheme.headlineSmall;
style = textTheme.titleLarge;
style = textTheme.titleMedium;
style = textTheme.titleSmall;
style = textTheme.bodyLarge;
style = textTheme.bodyMedium;
style = textTheme.bodySmall;
style = textTheme.labelLarge;
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