Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
88539266
Unverified
Commit
88539266
authored
Sep 02, 2022
by
Pierre-Louis
Committed by
GitHub
Sep 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate `ThemeData` `errorColor` and `backgroundColor` (#110162)
parent
0c2f7bc2
Changes
18
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
698 additions
and
119 deletions
+698
-119
home.dart
...ation_tests/flutter_gallery/lib/demo/calculator/home.dart
+1
-1
chip_demo.dart
...on_tests/flutter_gallery/lib/demo/material/chip_demo.dart
+1
-1
app.dart
...ntegration_tests/flutter_gallery/lib/demo/shrine/app.dart
+0
-1
themes.dart
...integration_tests/flutter_gallery/lib/gallery/themes.dart
+3
-4
dartdoc.dart
dev/tools/dartdoc.dart
+1
-1
input_decoration.floating_label_style_error.0.dart
...orator/input_decoration.floating_label_style_error.0.dart
+1
-1
input_decoration.label_style_error.0.dart
...input_decorator/input_decoration.label_style_error.0.dart
+1
-1
input_decoration.floating_label_style_error.0_test.dart
...r/input_decoration.floating_label_style_error.0_test.dart
+2
-2
input_decoration.label_style_error.0_test.dart
..._decorator/input_decoration.label_style_error.0_test.dart
+2
-2
fix_data.yaml
packages/flutter/lib/fix_data.yaml
+449
-1
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+5
-5
text_field.dart
packages/flutter/lib/src/material/text_field.dart
+1
-1
theme_data.dart
packages/flutter/lib/src/material/theme_data.dart
+79
-34
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+1
-1
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+1
-1
theme_data_test.dart
packages/flutter/test/material/theme_data_test.dart
+10
-10
material.dart
packages/flutter/test_fixes/material.dart
+45
-1
material.dart.expect
packages/flutter/test_fixes/material.dart.expect
+95
-51
No files found.
dev/integration_tests/flutter_gallery/lib/demo/calculator/home.dart
View file @
88539266
...
...
@@ -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
),
...
...
dev/integration_tests/flutter_gallery/lib/demo/material/chip_demo.dart
View file @
88539266
...
...
@@ -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
();
}
...
...
dev/integration_tests/flutter_gallery/lib/demo/shrine/app.dart
View file @
88539266
...
...
@@ -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
),
...
...
dev/integration_tests/flutter_gallery/lib/gallery/themes.dart
View file @
88539266
...
...
@@ -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
),
...
...
dev/tools/dartdoc.dart
View file @
88539266
...
...
@@ -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 => 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
);
// Check a "dartpad" example, any one will do.
...
...
examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart
View file @
88539266
...
...
@@ -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
).
errorCol
or
:
Colors
.
orange
;
final
Color
color
=
states
.
contains
(
MaterialState
.
error
)
?
Theme
.
of
(
context
).
colorScheme
.
err
or
:
Colors
.
orange
;
return
TextStyle
(
color:
color
,
letterSpacing:
1.3
);
}
),
...
...
examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart
View file @
88539266
...
...
@@ -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
).
errorCol
or
:
Colors
.
orange
;
final
Color
color
=
states
.
contains
(
MaterialState
.
error
)
?
Theme
.
of
(
context
).
colorScheme
.
err
or
:
Colors
.
orange
;
return
TextStyle
(
color:
color
,
letterSpacing:
1.3
);
}
),
...
...
examples/api/test/material/input_decorator/input_decoration.floating_label_style_error.0_test.dart
View file @
88539266
...
...
@@ -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 error
C
olor'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'InputDecorator label uses error
c
olor'
,
(
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
.
errorCol
or
);
expect
(
label
.
style
.
color
,
theme
.
data
.
colorScheme
.
err
or
);
});
}
examples/api/test/material/input_decorator/input_decoration.label_style_error.0_test.dart
View file @
88539266
...
...
@@ -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 error
C
olor'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'InputDecorator label uses error
c
olor'
,
(
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
.
errorCol
or
);
expect
(
label
.
style
.
color
,
theme
.
data
.
colorScheme
.
err
or
);
});
}
packages/flutter/lib/fix_data.yaml
View file @
88539266
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/material/input_decorator.dart
View file @
88539266
...
...
@@ -1957,7 +1957,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
:
themeData
.
disabledColor
;
}
if
(
decoration
.
errorText
!=
null
)
{
return
themeData
.
errorCol
or
;
return
themeData
.
colorScheme
.
err
or
;
}
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.errorCol
or].
/// [InputDecoration.errorStyle] color or [
ColorScheme.err
or].
///
/// {@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.errorCol
or].
/// [InputDecoration.errorStyle] color or [
ColorScheme.err
or].
///
/// {@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
).
errorCol
or
);
return
TextStyle
(
color:
Theme
.
of
(
context
).
colorScheme
.
err
or
);
}
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
.
errorCol
or
);
return
themeData
.
textTheme
.
bodySmall
!.
copyWith
(
color:
themeData
.
colorScheme
.
err
or
);
});
@override
...
...
packages/flutter/lib/src/material/text_field.dart
View file @
88539266
...
...
@@ -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
).
errorCol
or
);
Theme
.
of
(
context
).
textTheme
.
bodySmall
!.
copyWith
(
color:
Theme
.
of
(
context
).
colorScheme
.
err
or
);
// BEGIN GENERATED TOKEN PROPERTIES - TextField
...
...
packages/flutter/lib/src/material/theme_data.dart
View file @
88539266
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/routes.dart
View file @
88539266
...
...
@@ -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}
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
88539266
...
...
@@ -4621,7 +4621,7 @@ void main() {
),
);
await
tester
.
pumpAndSettle
();
expect
(
getBorderColor
(
tester
),
theme
.
errorCol
or
);
expect
(
getBorderColor
(
tester
),
theme
.
colorScheme
.
err
or
);
// Disabled
await
tester
.
pumpWidget
(
...
...
packages/flutter/test/material/theme_data_test.dart
View file @
88539266
...
...
@@ -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
();
...
...
packages/flutter/test_fixes/material.dart
View file @
88539266
...
...
@@ -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
);
}
packages/flutter/test_fixes/material.dart.expect
View file @
88539266
...
...
@@ -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
...
...
@@ -848,4 +848,48 @@ void main() {
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));
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment