Deprecate ThemeData
errorColor
and backgroundColor
(#110162)
This commit is contained in:
parent
0c2f7bc2a2
commit
8853926601
@ -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> {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
|
|
||||||
// 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 => Theme\.of\(navigator\.context\)\.backgroundColor;.*</pre>');
|
final RegExp snippetRegExp = RegExp(r'\s*<pre class="language-dart" id="sample-code">.*Color get barrierColor => 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 {
|
|||||||
// 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 {
|
|||||||
// 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
|
|||||||
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() {
|
|||||||
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
|
|||||||
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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,454 @@
|
|||||||
|
|
||||||
version: 1
|
version: 1
|
||||||
transforms:
|
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
|
# Changes made in https://github.com/flutter/flutter/pull/109817
|
||||||
- title: "Rename to 'displayLarge'"
|
- title: "Rename to 'displayLarge'"
|
||||||
date: 2022-08-18
|
date: 2022-08-18
|
||||||
@ -5049,4 +5497,4 @@ transforms:
|
|||||||
- kind: 'removeParameter'
|
- kind: 'removeParameter'
|
||||||
name: 'brightness'
|
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.
|
@ -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 {
|
|||||||
///
|
///
|
||||||
/// 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 {
|
|||||||
///
|
///
|
||||||
/// 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 {
|
|||||||
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 {
|
|||||||
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
|
|||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
|
@ -295,7 +295,6 @@ class ThemeData with Diagnosticable {
|
|||||||
// [colorScheme] is the preferred way to configure colors. The other color
|
// [colorScheme] is the preferred way to configure colors. The other color
|
||||||
// properties (as well as primaryColorBrightness, and primarySwatch)
|
// properties (as well as primaryColorBrightness, and primarySwatch)
|
||||||
// will gradually be phased out, see https://github.com/flutter/flutter/issues/91772.
|
// will gradually be phased out, see https://github.com/flutter/flutter/issues/91772.
|
||||||
Color? backgroundColor,
|
|
||||||
Color? bottomAppBarColor,
|
Color? bottomAppBarColor,
|
||||||
Brightness? brightness,
|
Brightness? brightness,
|
||||||
Color? canvasColor,
|
Color? canvasColor,
|
||||||
@ -305,7 +304,6 @@ class ThemeData with Diagnosticable {
|
|||||||
Color? dialogBackgroundColor,
|
Color? dialogBackgroundColor,
|
||||||
Color? disabledColor,
|
Color? disabledColor,
|
||||||
Color? dividerColor,
|
Color? dividerColor,
|
||||||
Color? errorColor,
|
|
||||||
Color? focusColor,
|
Color? focusColor,
|
||||||
Color? highlightColor,
|
Color? highlightColor,
|
||||||
Color? hintColor,
|
Color? hintColor,
|
||||||
@ -424,6 +422,16 @@ class ThemeData with Diagnosticable {
|
|||||||
'This feature was deprecated after v3.1.0-0.0.pre.',
|
'This feature was deprecated after v3.1.0-0.0.pre.',
|
||||||
)
|
)
|
||||||
Color? selectedRowColor,
|
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
|
// GENERAL CONFIGURATION
|
||||||
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
||||||
@ -507,19 +515,17 @@ class ThemeData with Diagnosticable {
|
|||||||
primaryColorDark: primaryColorDark,
|
primaryColorDark: primaryColorDark,
|
||||||
accentColor: accentColor,
|
accentColor: accentColor,
|
||||||
cardColor: cardColor,
|
cardColor: cardColor,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: isDark ? Colors.grey[700]! : primarySwatch[200]!,
|
||||||
errorColor: errorColor,
|
errorColor: Colors.red[700],
|
||||||
brightness: effectiveBrightness,
|
brightness: effectiveBrightness,
|
||||||
);
|
);
|
||||||
selectedRowColor ??= Colors.grey[100]!;
|
selectedRowColor ??= Colors.grey[100]!;
|
||||||
unselectedWidgetColor ??= isDark ? Colors.white70 : Colors.black54;
|
unselectedWidgetColor ??= isDark ? Colors.white70 : Colors.black54;
|
||||||
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
|
// Spec doesn't specify a dark theme secondaryHeaderColor, this is a guess.
|
||||||
secondaryHeaderColor ??= isDark ? Colors.grey[700]! : primarySwatch[50]!;
|
secondaryHeaderColor ??= isDark ? Colors.grey[700]! : primarySwatch[50]!;
|
||||||
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
|
|
||||||
dialogBackgroundColor ??= isDark ? Colors.grey[800]! : Colors.white;
|
dialogBackgroundColor ??= isDark ? Colors.grey[800]! : Colors.white;
|
||||||
indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor;
|
indicatorColor ??= accentColor == primaryColor ? Colors.white : accentColor;
|
||||||
hintColor ??= isDark ? Colors.white60 : Colors.black.withOpacity(0.6);
|
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
|
// The default [buttonTheme] is here because it doesn't use the defaults for
|
||||||
// [disabledColor], [highlightColor], and [splashColor].
|
// [disabledColor], [highlightColor], and [splashColor].
|
||||||
buttonTheme ??= ButtonThemeData(
|
buttonTheme ??= ButtonThemeData(
|
||||||
@ -587,12 +593,14 @@ class ThemeData with Diagnosticable {
|
|||||||
tooltipTheme ??= const TooltipThemeData();
|
tooltipTheme ??= const TooltipThemeData();
|
||||||
expansionTileTheme ??= const ExpansionTileThemeData();
|
expansionTileTheme ??= const ExpansionTileThemeData();
|
||||||
|
|
||||||
// DEPRECATED (newest deprecations at the bottom)
|
// DEPRECATED (newest deprecations at the bottom)
|
||||||
accentTextTheme = defaultAccentTextTheme.merge(accentTextTheme);
|
accentTextTheme = defaultAccentTextTheme.merge(accentTextTheme);
|
||||||
accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
|
accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
|
||||||
buttonColor ??= isDark ? primarySwatch[600]! : Colors.grey[300]!;
|
buttonColor ??= isDark ? primarySwatch[600]! : Colors.grey[300]!;
|
||||||
fixTextFieldOutlineLabel ??= true;
|
fixTextFieldOutlineLabel ??= true;
|
||||||
primaryColorBrightness = estimatedPrimaryColorBrightness;
|
primaryColorBrightness = estimatedPrimaryColorBrightness;
|
||||||
|
errorColor ??= Colors.red[700]!;
|
||||||
|
backgroundColor ??= isDark ? Colors.grey[700]! : primarySwatch[200]!;
|
||||||
|
|
||||||
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
|
||||||
@ -613,7 +621,6 @@ class ThemeData with Diagnosticable {
|
|||||||
useMaterial3: useMaterial3,
|
useMaterial3: useMaterial3,
|
||||||
visualDensity: visualDensity,
|
visualDensity: visualDensity,
|
||||||
// COLOR
|
// COLOR
|
||||||
backgroundColor: backgroundColor,
|
|
||||||
bottomAppBarColor: bottomAppBarColor,
|
bottomAppBarColor: bottomAppBarColor,
|
||||||
canvasColor: canvasColor,
|
canvasColor: canvasColor,
|
||||||
cardColor: cardColor,
|
cardColor: cardColor,
|
||||||
@ -621,7 +628,6 @@ class ThemeData with Diagnosticable {
|
|||||||
dialogBackgroundColor: dialogBackgroundColor,
|
dialogBackgroundColor: dialogBackgroundColor,
|
||||||
disabledColor: disabledColor,
|
disabledColor: disabledColor,
|
||||||
dividerColor: dividerColor,
|
dividerColor: dividerColor,
|
||||||
errorColor: errorColor,
|
|
||||||
focusColor: focusColor,
|
focusColor: focusColor,
|
||||||
highlightColor: highlightColor,
|
highlightColor: highlightColor,
|
||||||
hintColor: hintColor,
|
hintColor: hintColor,
|
||||||
@ -688,6 +694,8 @@ class ThemeData with Diagnosticable {
|
|||||||
androidOverscrollIndicator: androidOverscrollIndicator,
|
androidOverscrollIndicator: androidOverscrollIndicator,
|
||||||
toggleableActiveColor: toggleableActiveColor,
|
toggleableActiveColor: toggleableActiveColor,
|
||||||
selectedRowColor: selectedRowColor,
|
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
|
// [colorScheme] is the preferred way to configure colors. The other color
|
||||||
// properties will gradually be phased out, see
|
// properties will gradually be phased out, see
|
||||||
// https://github.com/flutter/flutter/issues/91772.
|
// https://github.com/flutter/flutter/issues/91772.
|
||||||
required this.backgroundColor,
|
|
||||||
required this.bottomAppBarColor,
|
required this.bottomAppBarColor,
|
||||||
required this.canvasColor,
|
required this.canvasColor,
|
||||||
required this.cardColor,
|
required this.cardColor,
|
||||||
@ -728,7 +735,6 @@ class ThemeData with Diagnosticable {
|
|||||||
required this.dialogBackgroundColor,
|
required this.dialogBackgroundColor,
|
||||||
required this.disabledColor,
|
required this.disabledColor,
|
||||||
required this.dividerColor,
|
required this.dividerColor,
|
||||||
required this.errorColor,
|
|
||||||
required this.focusColor,
|
required this.focusColor,
|
||||||
required this.highlightColor,
|
required this.highlightColor,
|
||||||
required this.hintColor,
|
required this.hintColor,
|
||||||
@ -845,6 +851,16 @@ class ThemeData with Diagnosticable {
|
|||||||
'This feature was deprecated after v3.1.0-0.0.pre.',
|
'This feature was deprecated after v3.1.0-0.0.pre.',
|
||||||
)
|
)
|
||||||
Color? selectedRowColor,
|
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)
|
}) : // DEPRECATED (newest deprecations at the bottom)
|
||||||
// should not be `required`, use getter pattern to avoid breakages.
|
// should not be `required`, use getter pattern to avoid breakages.
|
||||||
_accentColor = accentColor,
|
_accentColor = accentColor,
|
||||||
@ -856,6 +872,8 @@ class ThemeData with Diagnosticable {
|
|||||||
_primaryColorBrightness = primaryColorBrightness,
|
_primaryColorBrightness = primaryColorBrightness,
|
||||||
_toggleableActiveColor = toggleableActiveColor,
|
_toggleableActiveColor = toggleableActiveColor,
|
||||||
_selectedRowColor = selectedRowColor,
|
_selectedRowColor = selectedRowColor,
|
||||||
|
_errorColor = errorColor,
|
||||||
|
_backgroundColor = backgroundColor,
|
||||||
// GENERAL CONFIGURATION
|
// GENERAL CONFIGURATION
|
||||||
assert(applyElevationOverlayColor != null),
|
assert(applyElevationOverlayColor != null),
|
||||||
assert(extensions != null),
|
assert(extensions != null),
|
||||||
@ -868,7 +886,6 @@ class ThemeData with Diagnosticable {
|
|||||||
assert(useMaterial3 != null),
|
assert(useMaterial3 != null),
|
||||||
assert(visualDensity != null),
|
assert(visualDensity != null),
|
||||||
// COLOR
|
// COLOR
|
||||||
assert(backgroundColor != null),
|
|
||||||
assert(bottomAppBarColor != null),
|
assert(bottomAppBarColor != null),
|
||||||
assert(canvasColor != null),
|
assert(canvasColor != null),
|
||||||
assert(cardColor != null),
|
assert(cardColor != null),
|
||||||
@ -876,7 +893,6 @@ class ThemeData with Diagnosticable {
|
|||||||
assert(dialogBackgroundColor != null),
|
assert(dialogBackgroundColor != null),
|
||||||
assert(disabledColor != null),
|
assert(disabledColor != null),
|
||||||
assert(dividerColor != null),
|
assert(dividerColor != null),
|
||||||
assert(errorColor != null),
|
|
||||||
assert(focusColor != null),
|
assert(focusColor != null),
|
||||||
assert(highlightColor != null),
|
assert(highlightColor != null),
|
||||||
assert(hintColor != null),
|
assert(hintColor != null),
|
||||||
@ -932,7 +948,17 @@ class ThemeData with Diagnosticable {
|
|||||||
assert(textSelectionTheme != null),
|
assert(textSelectionTheme != null),
|
||||||
assert(timePickerTheme != null),
|
assert(timePickerTheme != null),
|
||||||
assert(toggleButtonsTheme != 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
|
/// Create a [ThemeData] based on the colors in the given [colorScheme] and
|
||||||
/// text styles of the optional [textTheme].
|
/// text styles of the optional [textTheme].
|
||||||
@ -1277,10 +1303,6 @@ class ThemeData with Diagnosticable {
|
|||||||
|
|
||||||
// COLOR
|
// 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].
|
/// The default color of the [BottomAppBar].
|
||||||
///
|
///
|
||||||
/// This can be overridden by specifying [BottomAppBar.color].
|
/// This can be overridden by specifying [BottomAppBar.color].
|
||||||
@ -1317,9 +1339,6 @@ class ThemeData with Diagnosticable {
|
|||||||
/// [Divider.createBorderSide].
|
/// [Divider.createBorderSide].
|
||||||
final Color dividerColor;
|
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.
|
/// The focus color used indicate that a component has the input focus.
|
||||||
final Color focusColor;
|
final Color focusColor;
|
||||||
|
|
||||||
@ -1683,6 +1702,24 @@ class ThemeData with Diagnosticable {
|
|||||||
)
|
)
|
||||||
final AndroidOverscrollIndicator? androidOverscrollIndicator;
|
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.
|
/// 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].
|
||||||
@ -1708,7 +1745,6 @@ class ThemeData with Diagnosticable {
|
|||||||
// [colorScheme] is the preferred way to configure colors. The other color
|
// [colorScheme] is the preferred way to configure colors. The other color
|
||||||
// properties will gradually be phased out, see
|
// properties will gradually be phased out, see
|
||||||
// https://github.com/flutter/flutter/issues/91772.
|
// https://github.com/flutter/flutter/issues/91772.
|
||||||
Color? backgroundColor,
|
|
||||||
Color? bottomAppBarColor,
|
Color? bottomAppBarColor,
|
||||||
Brightness? brightness,
|
Brightness? brightness,
|
||||||
Color? canvasColor,
|
Color? canvasColor,
|
||||||
@ -1717,7 +1753,6 @@ class ThemeData with Diagnosticable {
|
|||||||
Color? dialogBackgroundColor,
|
Color? dialogBackgroundColor,
|
||||||
Color? disabledColor,
|
Color? disabledColor,
|
||||||
Color? dividerColor,
|
Color? dividerColor,
|
||||||
Color? errorColor,
|
|
||||||
Color? focusColor,
|
Color? focusColor,
|
||||||
Color? highlightColor,
|
Color? highlightColor,
|
||||||
Color? hintColor,
|
Color? hintColor,
|
||||||
@ -1834,6 +1869,16 @@ class ThemeData with Diagnosticable {
|
|||||||
'This feature was deprecated after v3.1.0-0.0.pre.',
|
'This feature was deprecated after v3.1.0-0.0.pre.',
|
||||||
)
|
)
|
||||||
Color? selectedRowColor,
|
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();
|
cupertinoOverrideTheme = cupertinoOverrideTheme?.noDefault();
|
||||||
return ThemeData.raw(
|
return ThemeData.raw(
|
||||||
@ -1855,7 +1900,6 @@ class ThemeData with Diagnosticable {
|
|||||||
useMaterial3: useMaterial3 ?? this.useMaterial3,
|
useMaterial3: useMaterial3 ?? this.useMaterial3,
|
||||||
visualDensity: visualDensity ?? this.visualDensity,
|
visualDensity: visualDensity ?? this.visualDensity,
|
||||||
// COLOR
|
// COLOR
|
||||||
backgroundColor: backgroundColor ?? this.backgroundColor,
|
|
||||||
bottomAppBarColor: bottomAppBarColor ?? this.bottomAppBarColor,
|
bottomAppBarColor: bottomAppBarColor ?? this.bottomAppBarColor,
|
||||||
canvasColor: canvasColor ?? this.canvasColor,
|
canvasColor: canvasColor ?? this.canvasColor,
|
||||||
cardColor: cardColor ?? this.cardColor,
|
cardColor: cardColor ?? this.cardColor,
|
||||||
@ -1863,7 +1907,6 @@ class ThemeData with Diagnosticable {
|
|||||||
dialogBackgroundColor: dialogBackgroundColor ?? this.dialogBackgroundColor,
|
dialogBackgroundColor: dialogBackgroundColor ?? this.dialogBackgroundColor,
|
||||||
disabledColor: disabledColor ?? this.disabledColor,
|
disabledColor: disabledColor ?? this.disabledColor,
|
||||||
dividerColor: dividerColor ?? this.dividerColor,
|
dividerColor: dividerColor ?? this.dividerColor,
|
||||||
errorColor: errorColor ?? this.errorColor,
|
|
||||||
focusColor: focusColor ?? this.focusColor,
|
focusColor: focusColor ?? this.focusColor,
|
||||||
highlightColor: highlightColor ?? this.highlightColor,
|
highlightColor: highlightColor ?? this.highlightColor,
|
||||||
hintColor: hintColor ?? this.hintColor,
|
hintColor: hintColor ?? this.hintColor,
|
||||||
@ -1930,6 +1973,8 @@ class ThemeData with Diagnosticable {
|
|||||||
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
|
androidOverscrollIndicator: androidOverscrollIndicator ?? this.androidOverscrollIndicator,
|
||||||
toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor,
|
toggleableActiveColor: toggleableActiveColor ?? _toggleableActiveColor,
|
||||||
selectedRowColor: selectedRowColor ?? _selectedRowColor,
|
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,
|
useMaterial3: t < 0.5 ? a.useMaterial3 : b.useMaterial3,
|
||||||
visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t),
|
visualDensity: VisualDensity.lerp(a.visualDensity, b.visualDensity, t),
|
||||||
// COLOR
|
// COLOR
|
||||||
backgroundColor: Color.lerp(a.backgroundColor, b.backgroundColor, t)!,
|
|
||||||
bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t)!,
|
bottomAppBarColor: Color.lerp(a.bottomAppBarColor, b.bottomAppBarColor, t)!,
|
||||||
canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!,
|
canvasColor: Color.lerp(a.canvasColor, b.canvasColor, t)!,
|
||||||
cardColor: Color.lerp(a.cardColor, b.cardColor, 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)!,
|
dialogBackgroundColor: Color.lerp(a.dialogBackgroundColor, b.dialogBackgroundColor, t)!,
|
||||||
disabledColor: Color.lerp(a.disabledColor, b.disabledColor, t)!,
|
disabledColor: Color.lerp(a.disabledColor, b.disabledColor, t)!,
|
||||||
dividerColor: Color.lerp(a.dividerColor, b.dividerColor, 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)!,
|
focusColor: Color.lerp(a.focusColor, b.focusColor, t)!,
|
||||||
highlightColor: Color.lerp(a.highlightColor, b.highlightColor, t)!,
|
highlightColor: Color.lerp(a.highlightColor, b.highlightColor, t)!,
|
||||||
hintColor: Color.lerp(a.hintColor, b.hintColor, 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,
|
androidOverscrollIndicator:t < 0.5 ? a.androidOverscrollIndicator : b.androidOverscrollIndicator,
|
||||||
toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t),
|
toggleableActiveColor: Color.lerp(a.toggleableActiveColor, b.toggleableActiveColor, t),
|
||||||
selectedRowColor: Color.lerp(a.selectedRowColor, b.selectedRowColor, 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.useMaterial3 == useMaterial3 &&
|
||||||
other.visualDensity == visualDensity &&
|
other.visualDensity == visualDensity &&
|
||||||
// COLOR
|
// COLOR
|
||||||
other.backgroundColor == backgroundColor &&
|
|
||||||
other.bottomAppBarColor == bottomAppBarColor &&
|
other.bottomAppBarColor == bottomAppBarColor &&
|
||||||
other.canvasColor == canvasColor &&
|
other.canvasColor == canvasColor &&
|
||||||
other.cardColor == cardColor &&
|
other.cardColor == cardColor &&
|
||||||
@ -2165,7 +2209,6 @@ class ThemeData with Diagnosticable {
|
|||||||
other.dialogBackgroundColor == dialogBackgroundColor &&
|
other.dialogBackgroundColor == dialogBackgroundColor &&
|
||||||
other.disabledColor == disabledColor &&
|
other.disabledColor == disabledColor &&
|
||||||
other.dividerColor == dividerColor &&
|
other.dividerColor == dividerColor &&
|
||||||
other.errorColor == errorColor &&
|
|
||||||
other.focusColor == focusColor &&
|
other.focusColor == focusColor &&
|
||||||
other.highlightColor == highlightColor &&
|
other.highlightColor == highlightColor &&
|
||||||
other.hintColor == hintColor &&
|
other.hintColor == hintColor &&
|
||||||
@ -2231,7 +2274,9 @@ class ThemeData with Diagnosticable {
|
|||||||
other.primaryColorBrightness == primaryColorBrightness &&
|
other.primaryColorBrightness == primaryColorBrightness &&
|
||||||
other.androidOverscrollIndicator == androidOverscrollIndicator &&
|
other.androidOverscrollIndicator == androidOverscrollIndicator &&
|
||||||
other.toggleableActiveColor == toggleableActiveColor &&
|
other.toggleableActiveColor == toggleableActiveColor &&
|
||||||
other.selectedRowColor == selectedRowColor;
|
other.selectedRowColor == selectedRowColor &&
|
||||||
|
other.errorColor == errorColor &&
|
||||||
|
other.backgroundColor == backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -2256,7 +2301,6 @@ class ThemeData with Diagnosticable {
|
|||||||
useMaterial3,
|
useMaterial3,
|
||||||
visualDensity,
|
visualDensity,
|
||||||
// COLOR
|
// COLOR
|
||||||
backgroundColor,
|
|
||||||
bottomAppBarColor,
|
bottomAppBarColor,
|
||||||
canvasColor,
|
canvasColor,
|
||||||
cardColor,
|
cardColor,
|
||||||
@ -2264,7 +2308,6 @@ class ThemeData with Diagnosticable {
|
|||||||
dialogBackgroundColor,
|
dialogBackgroundColor,
|
||||||
disabledColor,
|
disabledColor,
|
||||||
dividerColor,
|
dividerColor,
|
||||||
errorColor,
|
|
||||||
focusColor,
|
focusColor,
|
||||||
highlightColor,
|
highlightColor,
|
||||||
hintColor,
|
hintColor,
|
||||||
@ -2331,6 +2374,8 @@ class ThemeData with Diagnosticable {
|
|||||||
androidOverscrollIndicator,
|
androidOverscrollIndicator,
|
||||||
toggleableActiveColor,
|
toggleableActiveColor,
|
||||||
selectedRowColor,
|
selectedRowColor,
|
||||||
|
errorColor,
|
||||||
|
backgroundColor,
|
||||||
];
|
];
|
||||||
return Object.hashAll(values);
|
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<bool>('useMaterial3', useMaterial3, defaultValue: defaultData.useMaterial3, level: DiagnosticLevel.debug));
|
||||||
properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: defaultData.visualDensity, level: DiagnosticLevel.debug));
|
properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: defaultData.visualDensity, level: DiagnosticLevel.debug));
|
||||||
// COLORS
|
// 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('bottomAppBarColor', bottomAppBarColor, defaultValue: defaultData.bottomAppBarColor, level: DiagnosticLevel.debug));
|
||||||
properties.add(ColorProperty('canvasColor', canvasColor, defaultValue: defaultData.canvasColor, 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));
|
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('dialogBackgroundColor', dialogBackgroundColor, defaultValue: defaultData.dialogBackgroundColor, level: DiagnosticLevel.debug));
|
||||||
properties.add(ColorProperty('disabledColor', disabledColor, defaultValue: defaultData.disabledColor, 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('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('focusColor', focusColor, defaultValue: defaultData.focusColor, level: DiagnosticLevel.debug));
|
||||||
properties.add(ColorProperty('highlightColor', highlightColor, defaultValue: defaultData.highlightColor, 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));
|
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(EnumProperty<AndroidOverscrollIndicator>('androidOverscrollIndicator', androidOverscrollIndicator, defaultValue: null, level: DiagnosticLevel.debug));
|
||||||
properties.add(ColorProperty('toggleableActiveColor', toggleableActiveColor, defaultValue: defaultData.toggleableActiveColor, 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('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:
|
/// 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() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
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() {
|
|||||||
'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() {
|
|||||||
'androidOverscrollIndicator',
|
'androidOverscrollIndicator',
|
||||||
'toggleableActiveColor',
|
'toggleableActiveColor',
|
||||||
'selectedRowColor',
|
'selectedRowColor',
|
||||||
|
'errorColor',
|
||||||
|
'backgroundColor',
|
||||||
};
|
};
|
||||||
|
|
||||||
final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();
|
final DiagnosticPropertiesBuilder properties = DiagnosticPropertiesBuilder();
|
||||||
|
@ -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() {
|
|||||||
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() {
|
|||||||
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
|
||||||
@ -798,54 +798,98 @@ void main() {
|
|||||||
themeData.selectedRowColor; // Removing field reference not supported.
|
themeData.selectedRowColor; // Removing field reference not supported.
|
||||||
|
|
||||||
// Changes made in https://github.com/flutter/flutter/pull/109817
|
// Changes made in https://github.com/flutter/flutter/pull/109817
|
||||||
var TextTheme textTheme = TextTheme(
|
var TextTheme textTheme = TextTheme(
|
||||||
displayLarge: headline1Style,
|
displayLarge: headline1Style,
|
||||||
displayMedium: headline2Style,
|
displayMedium: headline2Style,
|
||||||
displaySmall: headline3Style,
|
displaySmall: headline3Style,
|
||||||
headlineMedium: headline4Style,
|
headlineMedium: headline4Style,
|
||||||
headlineSmall: headline5Style,
|
headlineSmall: headline5Style,
|
||||||
titleLarge: headline6Style,
|
titleLarge: headline6Style,
|
||||||
titleMedium: subtitle1Style,
|
titleMedium: subtitle1Style,
|
||||||
titleSmall: subtitle2Style,
|
titleSmall: subtitle2Style,
|
||||||
bodyLarge: bodyText1Style,
|
bodyLarge: bodyText1Style,
|
||||||
bodyMedium: bodyText2Style,
|
bodyMedium: bodyText2Style,
|
||||||
bodySmall: captionStyle,
|
bodySmall: captionStyle,
|
||||||
labelLarge: buttonStyle,
|
labelLarge: buttonStyle,
|
||||||
labelSmall: overlineStyle,
|
labelSmall: overlineStyle,
|
||||||
);
|
);
|
||||||
var TextTheme textTheme = TextTheme(error: '');
|
var TextTheme textTheme = TextTheme(error: '');
|
||||||
|
|
||||||
// Changes made in https://github.com/flutter/flutter/pull/109817
|
// Changes made in https://github.com/flutter/flutter/pull/109817
|
||||||
var TextTheme copiedTextTheme = TextTheme.copyWith(
|
var TextTheme copiedTextTheme = TextTheme.copyWith(
|
||||||
displayLarge: headline1Style,
|
displayLarge: headline1Style,
|
||||||
displayMedium: headline2Style,
|
displayMedium: headline2Style,
|
||||||
displaySmall: headline3Style,
|
displaySmall: headline3Style,
|
||||||
headlineMedium: headline4Style,
|
headlineMedium: headline4Style,
|
||||||
headlineSmall: headline5Style,
|
headlineSmall: headline5Style,
|
||||||
titleLarge: headline6Style,
|
titleLarge: headline6Style,
|
||||||
titleMedium: subtitle1Style,
|
titleMedium: subtitle1Style,
|
||||||
titleSmall: subtitle2Style,
|
titleSmall: subtitle2Style,
|
||||||
bodyLarge: bodyText1Style,
|
bodyLarge: bodyText1Style,
|
||||||
bodyMedium: bodyText2Style,
|
bodyMedium: bodyText2Style,
|
||||||
bodySmall: captionStyle,
|
bodySmall: captionStyle,
|
||||||
labelLarge: buttonStyle,
|
labelLarge: buttonStyle,
|
||||||
labelSmall: overlineStyle,
|
labelSmall: overlineStyle,
|
||||||
);
|
);
|
||||||
var TextTheme copiedTextTheme = TextTheme.copyWith(error: '');
|
var TextTheme copiedTextTheme = TextTheme.copyWith(error: '');
|
||||||
|
|
||||||
// Changes made in https://github.com/flutter/flutter/pull/109817
|
// Changes made in https://github.com/flutter/flutter/pull/109817
|
||||||
var style;
|
var style;
|
||||||
style = textTheme.displayLarge;
|
style = textTheme.displayLarge;
|
||||||
style = textTheme.displayMedium;
|
style = textTheme.displayMedium;
|
||||||
style = textTheme.displaySmall;
|
style = textTheme.displaySmall;
|
||||||
style = textTheme.headlineMedium;
|
style = textTheme.headlineMedium;
|
||||||
style = textTheme.headlineSmall;
|
style = textTheme.headlineSmall;
|
||||||
style = textTheme.titleLarge;
|
style = textTheme.titleLarge;
|
||||||
style = textTheme.titleMedium;
|
style = textTheme.titleMedium;
|
||||||
style = textTheme.titleSmall;
|
style = textTheme.titleSmall;
|
||||||
style = textTheme.bodyLarge;
|
style = textTheme.bodyLarge;
|
||||||
style = textTheme.bodyMedium;
|
style = textTheme.bodyMedium;
|
||||||
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));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user