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
b5ce0616
Unverified
Commit
b5ce0616
authored
Jun 25, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Jun 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable lint use_full_hex_values_for_flutter_colors (#35056)
parent
fecf99ff
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
138 additions
and
138 deletions
+138
-138
analysis_options.yaml
analysis_options.yaml
+1
-1
button_test.dart
packages/flutter/test/cupertino/button_test.dart
+6
-6
text_field_test.dart
packages/flutter/test/cupertino/text_field_test.dart
+4
-4
bottom_navigation_bar_test.dart
...ges/flutter/test/material/bottom_navigation_bar_test.dart
+6
-6
button_bar_test.dart
packages/flutter/test/material/button_bar_test.dart
+3
-3
button_theme_test.dart
packages/flutter/test/material/button_theme_test.dart
+4
-4
colors_test.dart
packages/flutter/test/material/colors_test.dart
+30
-30
flat_button_test.dart
packages/flutter/test/material/flat_button_test.dart
+11
-11
input_decorator_test.dart
packages/flutter/test/material/input_decorator_test.dart
+2
-2
outline_button_test.dart
packages/flutter/test/material/outline_button_test.dart
+12
-12
raised_button_test.dart
packages/flutter/test/material/raised_button_test.dart
+11
-11
tabs_test.dart
packages/flutter/test/material/tabs_test.dart
+2
-2
text_theme_test.dart
packages/flutter/test/material/text_theme_test.dart
+3
-3
layers_test.dart
packages/flutter/test/rendering/layers_test.dart
+28
-28
table_border_test.dart
packages/flutter/test/rendering/table_border_test.dart
+6
-6
state_setting_in_scrollables_test.dart
...utter/test/widgets/state_setting_in_scrollables_test.dart
+6
-6
text_golden_test.dart
packages/flutter/test/widgets/text_golden_test.dart
+2
-2
title_test.dart
packages/flutter/test/widgets/title_test.dart
+1
-1
No files found.
analysis_options.yaml
View file @
b5ce0616
...
...
@@ -182,7 +182,7 @@ linter:
-
unnecessary_this
-
unrelated_type_equality_checks
# - unsafe_html # not yet tested
# - use_full_hex_values_for_flutter_colors # not yet tested
-
use_full_hex_values_for_flutter_colors
# - use_function_type_syntax_for_parameters # not yet tested
-
use_rethrow_when_possible
# - use_setters_to_change_properties # not yet tested
...
...
packages/flutter/test/cupertino/button_test.dart
View file @
b5ce0616
...
...
@@ -203,8 +203,8 @@ void main() {
testWidgets
(
'Can specify colors'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
boilerplate
(
child:
CupertinoButton
(
child:
const
Text
(
'Skeuomorph me'
),
color:
const
Color
(
0x0000FF
),
disabledColor:
const
Color
(
0x00FF00
),
color:
const
Color
(
0x0000
00
FF
),
disabledColor:
const
Color
(
0x00
00
FF00
),
onPressed:
()
{
},
)));
...
...
@@ -212,12 +212,12 @@ void main() {
find
.
widgetWithText
(
DecoratedBox
,
'Skeuomorph me'
)
).
decoration
;
expect
(
boxDecoration
.
color
,
const
Color
(
0x0000FF
));
expect
(
boxDecoration
.
color
,
const
Color
(
0x0000
00
FF
));
await
tester
.
pumpWidget
(
boilerplate
(
child:
const
CupertinoButton
(
child:
Text
(
'Skeuomorph me'
),
color:
Color
(
0x0000FF
),
disabledColor:
Color
(
0x00FF00
),
color:
Color
(
0x0000
00
FF
),
disabledColor:
Color
(
0x00
00
FF00
),
onPressed:
null
,
)));
...
...
@@ -225,7 +225,7 @@ void main() {
find
.
widgetWithText
(
DecoratedBox
,
'Skeuomorph me'
)
).
decoration
;
expect
(
boxDecoration
.
color
,
const
Color
(
0x00FF00
));
expect
(
boxDecoration
.
color
,
const
Color
(
0x00
00
FF00
));
});
testWidgets
(
'Button respects themes'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/cupertino/text_field_test.dart
View file @
b5ce0616
...
...
@@ -600,11 +600,11 @@ void main() {
child:
CupertinoTextField
(
placeholder:
'placeholder'
,
style:
TextStyle
(
color:
Color
(
0
X
00FFFFFF
),
color:
Color
(
0
x
00FFFFFF
),
fontWeight:
FontWeight
.
w300
,
),
placeholderStyle:
TextStyle
(
color:
Color
(
0
X
AAFFFFFF
),
color:
Color
(
0
x
AAFFFFFF
),
fontWeight:
FontWeight
.
w600
),
),
...
...
@@ -613,14 +613,14 @@ void main() {
);
final
Text
placeholder
=
tester
.
widget
(
find
.
text
(
'placeholder'
));
expect
(
placeholder
.
style
.
color
,
const
Color
(
0
X
AAFFFFFF
));
expect
(
placeholder
.
style
.
color
,
const
Color
(
0
x
AAFFFFFF
));
expect
(
placeholder
.
style
.
fontWeight
,
FontWeight
.
w600
);
await
tester
.
enterText
(
find
.
byType
(
CupertinoTextField
),
'input'
);
await
tester
.
pump
();
final
EditableText
inputText
=
tester
.
widget
(
find
.
text
(
'input'
));
expect
(
inputText
.
style
.
color
,
const
Color
(
0
X
00FFFFFF
));
expect
(
inputText
.
style
.
color
,
const
Color
(
0
x
00FFFFFF
));
expect
(
inputText
.
style
.
fontWeight
,
FontWeight
.
w300
);
},
);
...
...
packages/flutter/test/material/bottom_navigation_bar_test.dart
View file @
b5ce0616
...
...
@@ -199,8 +199,8 @@ void main() {
});
testWidgets
(
'Custom selected and unselected icon themes'
,
(
WidgetTester
tester
)
async
{
const
IconThemeData
selectedIconTheme
=
IconThemeData
(
size:
36
,
color:
Color
(
1
));
const
IconThemeData
unselectedIconTheme
=
IconThemeData
(
size:
18
,
color:
Color
(
2
));
const
IconThemeData
selectedIconTheme
=
IconThemeData
(
size:
36
,
color:
Color
(
0x0000000
1
));
const
IconThemeData
unselectedIconTheme
=
IconThemeData
(
size:
18
,
color:
Color
(
0x0000000
2
));
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
@@ -233,10 +233,10 @@ void main() {
});
testWidgets
(
'color on icon theme overrides selected and unselected item colors'
,
(
WidgetTester
tester
)
async
{
const
IconThemeData
selectedIconTheme
=
IconThemeData
(
size:
36
,
color:
Color
(
1
));
const
IconThemeData
unselectedIconTheme
=
IconThemeData
(
size:
18
,
color:
Color
(
2
));
const
Color
selectedItemColor
=
Color
(
3
);
const
Color
unselectedItemColor
=
Color
(
4
);
const
IconThemeData
selectedIconTheme
=
IconThemeData
(
size:
36
,
color:
Color
(
0x0000000
1
));
const
IconThemeData
unselectedIconTheme
=
IconThemeData
(
size:
18
,
color:
Color
(
0x0000000
2
));
const
Color
selectedItemColor
=
Color
(
0x0000000
3
);
const
Color
unselectedItemColor
=
Color
(
0x0000000
4
);
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
packages/flutter/test/material/button_bar_test.dart
View file @
b5ce0616
...
...
@@ -70,7 +70,7 @@ void main() {
await
tester
.
pumpWidget
(
MaterialApp
(
theme:
ThemeData
(
accentColor:
const
Color
(
1
)),
theme:
ThemeData
(
accentColor:
const
Color
(
0x0000000
1
)),
home:
Builder
(
builder:
(
BuildContext
context
)
{
return
Center
(
...
...
@@ -104,7 +104,7 @@ void main() {
),
);
expect
(
tester
.
widget
<
RawMaterialButton
>(
find
.
byType
(
RawMaterialButton
)).
textStyle
.
color
,
const
Color
(
1
));
expect
(
tester
.
widget
<
RawMaterialButton
>(
find
.
byType
(
RawMaterialButton
)).
textStyle
.
color
,
const
Color
(
0x0000000
1
));
// Show the dialog
await
tester
.
tap
(
find
.
text
(
'button'
));
...
...
@@ -114,6 +114,6 @@ void main() {
of:
find
.
text
(
'enabled'
),
matching:
find
.
byType
(
RawMaterialButton
),
);
expect
(
tester
.
widget
<
RawMaterialButton
>(
dialogButton
).
textStyle
.
color
,
const
Color
(
1
));
expect
(
tester
.
widget
<
RawMaterialButton
>(
dialogButton
).
textStyle
.
color
,
const
Color
(
0x0000000
1
));
});
}
packages/flutter/test/material/button_theme_test.dart
View file @
b5ce0616
...
...
@@ -331,10 +331,10 @@ void main() {
testWidgets
(
'button theme with stateful color changes color in states'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
packages/flutter/test/material/colors_test.dart
View file @
b5ce0616
...
...
@@ -14,42 +14,42 @@ void main() {
const
MaterialColor
color
=
MaterialColor
(
500
,
<
int
,
Color
>{
50
:
Color
(
50
),
100
:
Color
(
100
),
200
:
Color
(
200
),
300
:
Color
(
300
),
400
:
Color
(
400
),
500
:
Color
(
500
),
600
:
Color
(
600
),
700
:
Color
(
700
),
800
:
Color
(
800
),
900
:
Color
(
900
),
50
:
Color
(
0x000000
50
),
100
:
Color
(
0x00000
100
),
200
:
Color
(
0x00000
200
),
300
:
Color
(
0x00000
300
),
400
:
Color
(
0x00000
400
),
500
:
Color
(
0x00000
500
),
600
:
Color
(
0x00000
600
),
700
:
Color
(
0x00000
700
),
800
:
Color
(
0x00000
800
),
900
:
Color
(
0x00000
900
),
},
);
expect
(
color
.
value
,
500
);
expect
(
color
[
50
].
value
,
50
);
expect
(
color
[
100
].
value
,
100
);
expect
(
color
[
200
].
value
,
200
);
expect
(
color
[
300
].
value
,
300
);
expect
(
color
[
400
].
value
,
400
);
expect
(
color
[
500
].
value
,
500
);
expect
(
color
[
600
].
value
,
600
);
expect
(
color
[
700
].
value
,
700
);
expect
(
color
[
800
].
value
,
800
);
expect
(
color
[
900
].
value
,
900
);
expect
(
color
[
50
].
value
,
0x000000
50
);
expect
(
color
[
100
].
value
,
0x00000
100
);
expect
(
color
[
200
].
value
,
0x00000
200
);
expect
(
color
[
300
].
value
,
0x00000
300
);
expect
(
color
[
400
].
value
,
0x00000
400
);
expect
(
color
[
500
].
value
,
0x00000
500
);
expect
(
color
[
600
].
value
,
0x00000
600
);
expect
(
color
[
700
].
value
,
0x00000
700
);
expect
(
color
[
800
].
value
,
0x00000
800
);
expect
(
color
[
900
].
value
,
0x00000
900
);
expect
(
color
.
shade50
.
value
,
50
);
expect
(
color
.
shade100
.
value
,
100
);
expect
(
color
.
shade200
.
value
,
200
);
expect
(
color
.
shade300
.
value
,
300
);
expect
(
color
.
shade400
.
value
,
400
);
expect
(
color
.
shade500
.
value
,
500
);
expect
(
color
.
shade600
.
value
,
600
);
expect
(
color
.
shade700
.
value
,
700
);
expect
(
color
.
shade800
.
value
,
800
);
expect
(
color
.
shade900
.
value
,
900
);
expect
(
color
.
shade50
.
value
,
0x000000
50
);
expect
(
color
.
shade100
.
value
,
0x00000
100
);
expect
(
color
.
shade200
.
value
,
0x00000
200
);
expect
(
color
.
shade300
.
value
,
0x00000
300
);
expect
(
color
.
shade400
.
value
,
0x00000
400
);
expect
(
color
.
shade500
.
value
,
0x00000
500
);
expect
(
color
.
shade600
.
value
,
0x00000
600
);
expect
(
color
.
shade700
.
value
,
0x00000
700
);
expect
(
color
.
shade800
.
value
,
0x00000
800
);
expect
(
color
.
shade900
.
value
,
0x00000
900
);
});
test
(
'Colors swatches do not contain duplicates'
,
()
{
...
...
packages/flutter/test/material/flat_button_test.dart
View file @
b5ce0616
...
...
@@ -147,10 +147,10 @@ void main() {
testWidgets
(
'FlatButton uses stateful color for text color in different states'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
@@ -214,10 +214,10 @@ void main() {
final
FocusNode
focusNode
=
FocusNode
();
final
Key
buttonKey
=
UniqueKey
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
@@ -279,9 +279,9 @@ void main() {
testWidgets
(
'FlatButton ignores disabled text color if text color is stateful'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
disabledColor
=
Color
(
1
);
const
Color
defaultColor
=
Color
(
2
);
const
Color
unusedDisabledTextColor
=
Color
(
3
);
const
Color
disabledColor
=
Color
(
0x0000000
1
);
const
Color
defaultColor
=
Color
(
0x0000000
2
);
const
Color
unusedDisabledTextColor
=
Color
(
0x0000000
3
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
disabled
))
{
...
...
packages/flutter/test/material/input_decorator_test.dart
View file @
b5ce0616
...
...
@@ -3015,8 +3015,8 @@ void main() {
suffixStyle:
TextStyle
(
height:
8.0
),
counterStyle:
TextStyle
(
height:
9.0
),
filled:
true
,
fillColor:
Color
(
0x10
),
focusColor:
Color
(
0x20
),
fillColor:
Color
(
0x
000000
10
),
focusColor:
Color
(
0x
000000
20
),
errorBorder:
UnderlineInputBorder
(),
focusedBorder:
OutlineInputBorder
(),
focusedErrorBorder:
UnderlineInputBorder
(),
...
...
packages/flutter/test/material/outline_button_test.dart
View file @
b5ce0616
...
...
@@ -150,10 +150,10 @@ void main() {
testWidgets
(
'OutlineButton uses stateful color for text color in different states'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
@@ -217,10 +217,10 @@ void main() {
final
FocusNode
focusNode
=
FocusNode
();
final
Key
buttonKey
=
UniqueKey
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
@@ -282,9 +282,9 @@ void main() {
testWidgets
(
'OutlineButton ignores disabled text color if text color is stateful'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
disabledColor
=
Color
(
1
);
const
Color
defaultColor
=
Color
(
2
);
const
Color
unusedDisabledTextColor
=
Color
(
3
);
const
Color
disabledColor
=
Color
(
0x0000000
1
);
const
Color
defaultColor
=
Color
(
0x0000000
2
);
const
Color
unusedDisabledTextColor
=
Color
(
0x0000000
3
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
disabled
))
{
...
...
@@ -425,7 +425,7 @@ void main() {
..
path
(
color:
disabledBorderColor
,
strokeWidth:
borderWidth
));
_checkPhysicalLayer
(
tester
.
element
(
outlineButton
),
const
Color
(
0
),
const
Color
(
0
x00000000
),
clipPath:
clipPath
,
clipRect:
clipRect
,
);
...
...
packages/flutter/test/material/raised_button_test.dart
View file @
b5ce0616
...
...
@@ -82,10 +82,10 @@ void main() {
testWidgets
(
'RaisedButton uses stateful color for text color in different states'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
@@ -150,10 +150,10 @@ void main() {
final
FocusNode
focusNode
=
FocusNode
();
final
Key
buttonKey
=
UniqueKey
();
const
Color
pressedColor
=
Color
(
1
);
const
Color
hoverColor
=
Color
(
2
);
const
Color
focusedColor
=
Color
(
3
);
const
Color
defaultColor
=
Color
(
4
);
const
Color
pressedColor
=
Color
(
0x0000000
1
);
const
Color
hoverColor
=
Color
(
0x0000000
2
);
const
Color
focusedColor
=
Color
(
0x0000000
3
);
const
Color
defaultColor
=
Color
(
0x0000000
4
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
pressed
))
{
...
...
@@ -215,9 +215,9 @@ void main() {
testWidgets
(
'RaisedButton ignores disabled text color if text color is stateful'
,
(
WidgetTester
tester
)
async
{
final
FocusNode
focusNode
=
FocusNode
();
const
Color
disabledColor
=
Color
(
1
);
const
Color
defaultColor
=
Color
(
2
);
const
Color
unusedDisabledTextColor
=
Color
(
3
);
const
Color
disabledColor
=
Color
(
0x0000000
1
);
const
Color
defaultColor
=
Color
(
0x0000000
2
);
const
Color
unusedDisabledTextColor
=
Color
(
0x0000000
3
);
Color
getTextColor
(
Set
<
MaterialState
>
states
)
{
if
(
states
.
contains
(
MaterialState
.
disabled
))
{
...
...
packages/flutter/test/material/tabs_test.dart
View file @
b5ce0616
...
...
@@ -2282,8 +2282,8 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/15008.
testWidgets
(
'TabBar with one tab has correct color'
,
(
WidgetTester
tester
)
async
{
const
Tab
tab
=
Tab
(
text:
'A'
);
const
Color
selectedTabColor
=
Color
(
1
);
const
Color
unselectedTabColor
=
Color
(
2
);
const
Color
selectedTabColor
=
Color
(
0x0000000
1
);
const
Color
unselectedTabColor
=
Color
(
0x0000000
2
);
await
tester
.
pumpWidget
(
boilerplate
(
child:
const
DefaultTabController
(
...
...
packages/flutter/test/material/text_theme_test.dart
View file @
b5ce0616
...
...
@@ -74,10 +74,10 @@ void main() {
// The `displayColor` is applied to [display4], [display3], [display2],
// [display1], and [caption]. The `bodyColor` is applied to the remaining
// text styles.
const
Color
displayColor
=
Color
(
1
);
const
Color
bodyColor
=
Color
(
2
);
const
Color
displayColor
=
Color
(
0x0000000
1
);
const
Color
bodyColor
=
Color
(
0x0000000
2
);
const
String
fontFamily
=
'fontFamily'
;
const
Color
decorationColor
=
Color
(
3
);
const
Color
decorationColor
=
Color
(
0x0000000
3
);
const
TextDecorationStyle
decorationStyle
=
TextDecorationStyle
.
dashed
;
final
TextDecoration
decoration
=
TextDecoration
.
combine
(<
TextDecoration
>[
TextDecoration
.
underline
,
...
...
packages/flutter/test/rendering/layers_test.dart
View file @
b5ce0616
...
...
@@ -251,7 +251,7 @@ void main() {
});
test
(
'mutating ShaderMaskLayer fields triggers needsAddToScene'
,
()
{
const
Gradient
gradient
=
RadialGradient
(
colors:
<
Color
>[
Color
(
0
),
Color
(
1
)]);
const
Gradient
gradient
=
RadialGradient
(
colors:
<
Color
>[
Color
(
0
x00000000
),
Color
(
0x0000000
1
)]);
final
Shader
shader
=
gradient
.
createShader
(
Rect
.
zero
);
final
ShaderMaskLayer
layer
=
ShaderMaskLayer
(
shader:
shader
,
maskRect:
Rect
.
zero
,
blendMode:
BlendMode
.
clear
);
checkNeedsAddToScene
(
layer
,
()
{
...
...
@@ -274,7 +274,7 @@ void main() {
test
(
'mutating PhysicalModelLayer fields triggers needsAddToScene'
,
()
{
final
PhysicalModelLayer
layer
=
PhysicalModelLayer
(
clipPath:
Path
(),
elevation:
0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
));
clipPath:
Path
(),
elevation:
0
,
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0x0000000
0
));
checkNeedsAddToScene
(
layer
,
()
{
final
Path
newPath
=
Path
();
newPath
.
addRect
(
unitRect
);
...
...
@@ -284,10 +284,10 @@ void main() {
layer
.
elevation
=
1
;
});
checkNeedsAddToScene
(
layer
,
()
{
layer
.
color
=
const
Color
(
1
);
layer
.
color
=
const
Color
(
0x0000000
1
);
});
checkNeedsAddToScene
(
layer
,
()
{
layer
.
shadowColor
=
const
Color
(
1
);
layer
.
shadowColor
=
const
Color
(
0x0000000
1
);
});
});
...
...
@@ -330,14 +330,14 @@ void main() {
final
PhysicalModelLayer
layerA
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
0
,
0
,
20
,
20
)),
elevation:
3.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
final
PhysicalModelLayer
layerB
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
10
,
10
,
20
,
20
)),
elevation:
2.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
_testConflicts
(
layerA
,
layerB
,
expectedErrorCount:
1
);
});
...
...
@@ -354,14 +354,14 @@ void main() {
final
PhysicalModelLayer
layerA
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
0
,
0
,
20
,
20
)),
elevation:
3.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
final
PhysicalModelLayer
layerB
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
10
,
10
,
20
,
20
)),
elevation:
2.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
_testConflicts
(
layerA
,
layerB
,
expectedErrorCount:
0
,
enableCheck:
false
);
});
...
...
@@ -376,14 +376,14 @@ void main() {
final
PhysicalModelLayer
layerA
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
0
,
0
,
20
,
20
)),
elevation:
3.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
final
PhysicalModelLayer
layerB
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
20
,
20
,
20
,
20
)),
elevation:
2.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
_testConflicts
(
layerA
,
layerB
,
expectedErrorCount:
0
);
});
...
...
@@ -400,22 +400,22 @@ void main() {
final
PhysicalModelLayer
layerA
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
0
,
0
,
20
,
20
)),
elevation:
3.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
layerA
.
append
(
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
2
,
2
,
10
,
10
)),
elevation:
1.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
));
final
PhysicalModelLayer
layerB
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
20
,
20
,
20
,
20
)),
elevation:
2.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
_testConflicts
(
layerA
,
layerB
,
expectedErrorCount:
0
);
});
...
...
@@ -435,22 +435,22 @@ void main() {
final
PhysicalModelLayer
layerA
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
0
,
0
,
20
,
20
)),
elevation:
3.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
layerA
.
append
(
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
15
,
15
,
25
,
25
)),
elevation:
2.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
));
final
PhysicalModelLayer
layerB
=
PhysicalModelLayer
(
clipPath:
Path
()..
addRect
(
const
Rect
.
fromLTWH
(
20
,
20
,
20
,
20
)),
elevation:
4.0
,
color:
const
Color
(
0
),
shadowColor:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
shadowColor:
const
Color
(
0
x00000000
),
);
_testConflicts
(
layerA
,
layerB
,
expectedErrorCount:
1
);
...
...
packages/flutter/test/rendering/table_border_test.dart
View file @
b5ce0616
...
...
@@ -63,12 +63,12 @@ void main() {
});
test
(
'TableBorder.lerp'
,
()
{
const
BorderSide
side1
=
BorderSide
(
width:
1.0
,
color:
Color
(
1
));
const
BorderSide
side2
=
BorderSide
(
width:
2.0
,
color:
Color
(
2
));
const
BorderSide
side3
=
BorderSide
(
width:
3.0
,
color:
Color
(
3
));
const
BorderSide
side4
=
BorderSide
(
width:
4.0
,
color:
Color
(
4
));
const
BorderSide
side5
=
BorderSide
(
width:
5.0
,
color:
Color
(
5
));
const
BorderSide
side6
=
BorderSide
(
width:
6.0
,
color:
Color
(
6
));
const
BorderSide
side1
=
BorderSide
(
width:
1.0
,
color:
Color
(
0x0000000
1
));
const
BorderSide
side2
=
BorderSide
(
width:
2.0
,
color:
Color
(
0x0000000
2
));
const
BorderSide
side3
=
BorderSide
(
width:
3.0
,
color:
Color
(
0x0000000
3
));
const
BorderSide
side4
=
BorderSide
(
width:
4.0
,
color:
Color
(
0x0000000
4
));
const
BorderSide
side5
=
BorderSide
(
width:
5.0
,
color:
Color
(
0x0000000
5
));
const
BorderSide
side6
=
BorderSide
(
width:
6.0
,
color:
Color
(
0x0000000
6
));
const
TableBorder
tableA
=
TableBorder
(
top:
side1
,
right:
side2
,
...
...
packages/flutter/test/widgets/state_setting_in_scrollables_test.dart
View file @
b5ce0616
...
...
@@ -28,38 +28,38 @@ class FooState extends State<Foo> {
scrollController
.
animateTo
(
200.0
,
duration:
const
Duration
(
milliseconds:
500
),
curve:
Curves
.
linear
);
},
child:
const
DecoratedBox
(
decoration:
BoxDecoration
(
color:
Color
(
0
)),
decoration:
BoxDecoration
(
color:
Color
(
0
x00000000
)),
child:
SizedBox
(
height:
200.0
,
),
),
),
const
DecoratedBox
(
decoration:
BoxDecoration
(
color:
Color
(
0
)),
decoration:
BoxDecoration
(
color:
Color
(
0
x00000000
)),
child:
SizedBox
(
height:
200.0
,
),
),
const
DecoratedBox
(
decoration:
BoxDecoration
(
color:
Color
(
0
)),
decoration:
BoxDecoration
(
color:
Color
(
0
x00000000
)),
child:
SizedBox
(
height:
200.0
,
),
),
const
DecoratedBox
(
decoration:
BoxDecoration
(
color:
Color
(
0
)),
decoration:
BoxDecoration
(
color:
Color
(
0
x00000000
)),
child:
SizedBox
(
height:
200.0
,
),
),
const
DecoratedBox
(
decoration:
BoxDecoration
(
color:
Color
(
0
)),
decoration:
BoxDecoration
(
color:
Color
(
0
x00000000
)),
child:
SizedBox
(
height:
200.0
,
),
),
const
DecoratedBox
(
decoration:
BoxDecoration
(
color:
Color
(
0
)),
decoration:
BoxDecoration
(
color:
Color
(
0
x00000000
)),
child:
SizedBox
(
height:
200.0
,
),
...
...
packages/flutter/test/widgets/text_golden_test.dart
View file @
b5ce0616
...
...
@@ -736,13 +736,13 @@ void main() {
child:
Text
.
rich
(
TextSpan
(
text:
'inner'
,
style:
TextStyle
(
color:
Color
(
0xf
f
402f4ff
)),
style:
TextStyle
(
color:
Color
(
0xf402f4ff
)),
children:
<
InlineSpan
>[
WidgetSpan
(
child:
Text
.
rich
(
TextSpan
(
text:
'inner2'
,
style:
TextStyle
(
color:
Color
(
0xf
f
003ffff
)),
style:
TextStyle
(
color:
Color
(
0xf003ffff
)),
children:
<
InlineSpan
>[
WidgetSpan
(
child:
SizedBox
(
...
...
packages/flutter/test/widgets/title_test.dart
View file @
b5ce0616
...
...
@@ -40,7 +40,7 @@ void main() {
testWidgets
(
'should not allow non-opaque color'
,
(
WidgetTester
tester
)
async
{
expect
(()
=>
Title
(
color:
const
Color
(
0
),
color:
const
Color
(
0
x00000000
),
child:
Container
(),
),
throwsAssertionError
);
});
...
...
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