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
0ef0f0ba
Unverified
Commit
0ef0f0ba
authored
May 27, 2021
by
Alexandre Ardhuin
Committed by
GitHub
May 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lint from an improved unnecessary_parenthesis (#83433)
parent
7311b9d6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
27 deletions
+27
-27
gen_localizations.dart
dev/tools/localization/bin/gen_localizations.dart
+1
-1
alignment_test.dart
packages/flutter/test/painting/alignment_test.dart
+6
-6
border_radius_test.dart
packages/flutter/test/painting/border_radius_test.dart
+12
-12
edge_insets_test.dart
packages/flutter/test/painting/edge_insets_test.dart
+3
-3
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+4
-4
project_test.dart
packages/flutter_tools/test/general.shard/project_test.dart
+1
-1
No files found.
dev/tools/localization/bin/gen_localizations.dart
View file @
0ef0f0ba
...
...
@@ -271,7 +271,7 @@ $factoryDeclaration
if (languageToLocales[language].length == 1) {
output.writeln('''
case
'
$language
'
:
return
$generatedClassPrefix
$
{
(
languageToLocales
[
language
][
0
])
.
camelCase
()}(
$factoryArguments
);
''');
return
$generatedClassPrefix
$
{
languageToLocales
[
language
][
0
]
.
camelCase
()}(
$factoryArguments
);
''');
} else if (!languageToScriptCodes.containsKey(language)) { // Does not distinguish between scripts. Switch on countryCode directly.
output.writeln('''
case
'
$language
'
:
{
...
...
packages/flutter/test/painting/alignment_test.dart
View file @
0ef0f0ba
...
...
@@ -45,10 +45,10 @@ void main() {
expect
((
topEnd
*
0.0
).
add
(
topRight
*
0.0
),
center
);
expect
(
topEnd
.
add
(
topRight
)
*
0.0
,
(
topEnd
*
0.0
).
add
(
topRight
*
0.0
));
expect
(
topStart
.
add
(
topLeft
),
topLeft
.
add
(
topStart
));
expect
(
(
topStart
.
add
(
topLeft
)
).
resolve
(
TextDirection
.
ltr
),
(
topStart
.
resolve
(
TextDirection
.
ltr
))
+
topLeft
);
expect
(
(
topStart
.
add
(
topLeft
)
).
resolve
(
TextDirection
.
rtl
),
(
topStart
.
resolve
(
TextDirection
.
rtl
))
+
topLeft
);
expect
(
(
topStart
.
add
(
topLeft
)).
resolve
(
TextDirection
.
ltr
),
(
topStart
.
resolve
(
TextDirection
.
ltr
)
).
add
(
topLeft
));
expect
(
(
topStart
.
add
(
topLeft
)).
resolve
(
TextDirection
.
rtl
),
(
topStart
.
resolve
(
TextDirection
.
rtl
)
).
add
(
topLeft
));
expect
(
topStart
.
add
(
topLeft
).
resolve
(
TextDirection
.
ltr
),
(
topStart
.
resolve
(
TextDirection
.
ltr
))
+
topLeft
);
expect
(
topStart
.
add
(
topLeft
).
resolve
(
TextDirection
.
rtl
),
(
topStart
.
resolve
(
TextDirection
.
rtl
))
+
topLeft
);
expect
(
topStart
.
add
(
topLeft
).
resolve
(
TextDirection
.
ltr
),
topStart
.
resolve
(
TextDirection
.
ltr
).
add
(
topLeft
));
expect
(
topStart
.
add
(
topLeft
).
resolve
(
TextDirection
.
rtl
),
topStart
.
resolve
(
TextDirection
.
rtl
).
add
(
topLeft
));
expect
(
topStart
.
resolve
(
TextDirection
.
ltr
),
topLeft
);
expect
(
topStart
.
resolve
(
TextDirection
.
rtl
),
topRight
);
expect
(
topEnd
*
0.0
,
center
);
...
...
@@ -67,8 +67,8 @@ void main() {
for
(
final
TextDirection
x
in
TextDirection
.
values
)
{
expect
((
topEnd
*
0.0
).
add
(
topRight
*
0.0
).
resolve
(
x
),
center
.
add
(
center
).
resolve
(
x
));
expect
((
topEnd
*
0.0
).
add
(
topLeft
).
resolve
(
x
),
center
.
add
(
topLeft
).
resolve
(
x
));
expect
((
(
topEnd
*
0.0
).
resolve
(
x
)).
add
(
topLeft
.
resolve
(
x
)),
(
center
.
resolve
(
x
)
).
add
(
topLeft
.
resolve
(
x
)));
expect
((
(
topEnd
*
0.0
).
resolve
(
x
)).
add
(
topLeft
),
(
center
.
resolve
(
x
)
).
add
(
topLeft
));
expect
((
topEnd
*
0.0
).
resolve
(
x
).
add
(
topLeft
.
resolve
(
x
)),
center
.
resolve
(
x
).
add
(
topLeft
.
resolve
(
x
)));
expect
((
topEnd
*
0.0
).
resolve
(
x
).
add
(
topLeft
),
center
.
resolve
(
x
).
add
(
topLeft
));
expect
((
topEnd
*
0.0
).
resolve
(
x
),
center
.
resolve
(
x
));
}
expect
(
topStart
,
isNot
(
topLeft
));
...
...
packages/flutter/test/painting/border_radius_test.dart
View file @
0ef0f0ba
...
...
@@ -380,13 +380,13 @@ void main() {
bottomStart:
Radius
.
elliptical
(
120.0
,
130.0
),
bottomEnd:
Radius
.
elliptical
(
140.0
,
150.0
),
);
expect
(
(
a
.
subtract
(
b
)
).
resolve
(
TextDirection
.
ltr
),
BorderRadius
.
only
(
expect
(
a
.
subtract
(
b
).
resolve
(
TextDirection
.
ltr
),
BorderRadius
.
only
(
topLeft:
const
Radius
.
elliptical
(
10.0
,
20.0
)
-
Radius
.
zero
,
topRight:
const
Radius
.
elliptical
(
30.0
,
40.0
)
-
const
Radius
.
elliptical
(
100.0
,
110.0
),
bottomLeft:
const
Radius
.
elliptical
(
50.0
,
60.0
)
-
const
Radius
.
elliptical
(
120.0
,
130.0
),
bottomRight:
Radius
.
zero
-
const
Radius
.
elliptical
(
140.0
,
150.0
),
));
expect
(
(
a
.
subtract
(
b
)
).
resolve
(
TextDirection
.
rtl
),
BorderRadius
.
only
(
expect
(
a
.
subtract
(
b
).
resolve
(
TextDirection
.
rtl
),
BorderRadius
.
only
(
topLeft:
const
Radius
.
elliptical
(
10.0
,
20.0
)
-
const
Radius
.
elliptical
(
100.0
,
110.0
),
topRight:
const
Radius
.
elliptical
(
30.0
,
40.0
)
-
Radius
.
zero
,
bottomLeft:
const
Radius
.
elliptical
(
50.0
,
60.0
)
-
const
Radius
.
elliptical
(
140.0
,
150.0
),
...
...
@@ -405,13 +405,13 @@ void main() {
bottomStart:
Radius
.
elliptical
(
120.0
,
130.0
),
bottomEnd:
Radius
.
elliptical
(
140.0
,
150.0
),
);
expect
(
(
a
.
add
(
b
)
).
resolve
(
TextDirection
.
ltr
),
BorderRadius
.
only
(
expect
(
a
.
add
(
b
).
resolve
(
TextDirection
.
ltr
),
BorderRadius
.
only
(
topLeft:
const
Radius
.
elliptical
(
10.0
,
20.0
)
+
Radius
.
zero
,
topRight:
const
Radius
.
elliptical
(
30.0
,
40.0
)
+
const
Radius
.
elliptical
(
100.0
,
110.0
),
bottomLeft:
const
Radius
.
elliptical
(
50.0
,
60.0
)
+
const
Radius
.
elliptical
(
120.0
,
130.0
),
bottomRight:
Radius
.
zero
+
const
Radius
.
elliptical
(
140.0
,
150.0
),
));
expect
(
(
a
.
add
(
b
)
).
resolve
(
TextDirection
.
rtl
),
BorderRadius
.
only
(
expect
(
a
.
add
(
b
).
resolve
(
TextDirection
.
rtl
),
BorderRadius
.
only
(
topLeft:
const
Radius
.
elliptical
(
10.0
,
20.0
)
+
const
Radius
.
elliptical
(
100.0
,
110.0
),
topRight:
const
Radius
.
elliptical
(
30.0
,
40.0
)
+
Radius
.
zero
,
bottomLeft:
const
Radius
.
elliptical
(
50.0
,
60.0
)
+
const
Radius
.
elliptical
(
140.0
,
150.0
),
...
...
@@ -467,8 +467,8 @@ void main() {
bottomLeft:
Radius
.
elliptical
(-
3.0
,
-
5.0
),
// 0 + 0 - bL
bottomRight:
Radius
.
zero
,
// 0 + 0 - 0
);
expect
(
(
a
.
add
(
b
.
subtract
(
c
)
)).
resolve
(
TextDirection
.
ltr
),
ltr
);
expect
(
(
a
.
add
(
b
.
subtract
(
c
)
)).
resolve
(
TextDirection
.
rtl
),
rtl
);
expect
(
a
.
add
(
b
.
subtract
(
c
)).
resolve
(
TextDirection
.
ltr
),
ltr
);
expect
(
a
.
add
(
b
.
subtract
(
c
)).
resolve
(
TextDirection
.
rtl
),
rtl
);
});
test
(
'BorderRadiusGeometry add and subtract, more'
,
()
{
...
...
@@ -503,8 +503,8 @@ void main() {
bottomLeft:
Radius
.
elliptical
(
783.0
,
783.0
),
// bL + bE + bL
bottomRight:
Radius
.
elliptical
(
961.0
,
961.0
),
// bR + bS - bR
);
expect
(
(
a
.
add
(
b
.
subtract
(
c
)
)).
resolve
(
TextDirection
.
ltr
),
ltr
);
expect
(
(
a
.
add
(
b
.
subtract
(
c
)
)).
resolve
(
TextDirection
.
rtl
),
rtl
);
expect
(
a
.
add
(
b
.
subtract
(
c
)).
resolve
(
TextDirection
.
ltr
),
ltr
);
expect
(
a
.
add
(
b
.
subtract
(
c
)).
resolve
(
TextDirection
.
rtl
),
rtl
);
});
test
(
'BorderRadiusGeometry operators'
,
()
{
...
...
@@ -531,10 +531,10 @@ void main() {
bottomLeft:
Radius
.
elliptical
(
95.0
,
105.0
),
// 50,60 -> 140,150
bottomRight:
Radius
.
elliptical
(
60.0
,
65.0
),
// 0,0 -> 120,130
);
expect
(
(
a
.
add
(
b
.
subtract
(
a
)
*
0.5
)
).
resolve
(
TextDirection
.
ltr
),
ltr
);
expect
(
(
a
.
add
(
b
.
subtract
(
a
)
*
0.5
)
).
resolve
(
TextDirection
.
rtl
),
rtl
);
expect
(
(
a
.
add
(
b
.
subtract
(
a
)
*
0.0
)
).
resolve
(
TextDirection
.
ltr
),
a
);
expect
(
(
a
.
add
(
b
.
subtract
(
a
)
*
1.0
)
).
resolve
(
TextDirection
.
rtl
),
b
.
resolve
(
TextDirection
.
rtl
));
expect
(
a
.
add
(
b
.
subtract
(
a
)
*
0.5
).
resolve
(
TextDirection
.
ltr
),
ltr
);
expect
(
a
.
add
(
b
.
subtract
(
a
)
*
0.5
).
resolve
(
TextDirection
.
rtl
),
rtl
);
expect
(
a
.
add
(
b
.
subtract
(
a
)
*
0.0
).
resolve
(
TextDirection
.
ltr
),
a
);
expect
(
a
.
add
(
b
.
subtract
(
a
)
*
1.0
).
resolve
(
TextDirection
.
rtl
),
b
.
resolve
(
TextDirection
.
rtl
));
});
test
(
'BorderRadius copyWith, merge, ==, hashCode basics'
,
()
{
...
...
packages/flutter/test/painting/edge_insets_test.dart
View file @
0ef0f0ba
...
...
@@ -199,8 +199,8 @@ void main() {
expect
(
EdgeInsets
.
zero
.
toString
(),
'EdgeInsets.zero'
);
expect
(
const
EdgeInsets
.
only
(
top:
1.01
,
left:
1.01
,
right:
1.01
,
bottom:
1.01
).
toString
(),
'EdgeInsets.all(1.0)'
);
expect
(
const
EdgeInsetsDirectional
.
only
(
start:
1.01
,
end:
1.01
,
top:
1.01
,
bottom:
1.01
).
toString
(),
'EdgeInsetsDirectional(1.0, 1.0, 1.0, 1.0)'
);
expect
(
(
const
EdgeInsetsDirectional
.
only
(
start:
4.0
).
add
(
const
EdgeInsets
.
only
(
top:
3.0
)
)).
toString
(),
'EdgeInsetsDirectional(4.0, 3.0, 0.0, 0.0)'
);
expect
(
(
const
EdgeInsetsDirectional
.
only
(
top:
4.0
).
add
(
const
EdgeInsets
.
only
(
right:
3.0
)
)).
toString
(),
'EdgeInsets(0.0, 4.0, 3.0, 0.0)'
);
expect
(
(
const
EdgeInsetsDirectional
.
only
(
start:
4.0
).
add
(
const
EdgeInsets
.
only
(
left:
3.0
)
)).
toString
(),
'EdgeInsets(3.0, 0.0, 0.0, 0.0) + EdgeInsetsDirectional(4.0, 0.0, 0.0, 0.0)'
);
expect
(
const
EdgeInsetsDirectional
.
only
(
start:
4.0
).
add
(
const
EdgeInsets
.
only
(
top:
3.0
)).
toString
(),
'EdgeInsetsDirectional(4.0, 3.0, 0.0, 0.0)'
);
expect
(
const
EdgeInsetsDirectional
.
only
(
top:
4.0
).
add
(
const
EdgeInsets
.
only
(
right:
3.0
)).
toString
(),
'EdgeInsets(0.0, 4.0, 3.0, 0.0)'
);
expect
(
const
EdgeInsetsDirectional
.
only
(
start:
4.0
).
add
(
const
EdgeInsets
.
only
(
left:
3.0
)).
toString
(),
'EdgeInsets(3.0, 0.0, 0.0, 0.0) + EdgeInsetsDirectional(4.0, 0.0, 0.0, 0.0)'
);
});
}
packages/flutter/test/rendering/editable_test.dart
View file @
0ef0f0ba
...
...
@@ -3212,11 +3212,11 @@ void main() {
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
currentPainter
.
paintCount
,
1
);
editable
.
foregroundPainter
=
(
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
false
)
;
editable
.
foregroundPainter
=
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
false
;
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
currentPainter
.
paintCount
,
0
);
editable
.
foregroundPainter
=
(
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
true
)
;
editable
.
foregroundPainter
=
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
true
;
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
currentPainter
.
paintCount
,
1
);
});
...
...
@@ -3231,11 +3231,11 @@ void main() {
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
currentPainter
.
paintCount
,
1
);
editable
.
painter
=
(
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
false
)
;
editable
.
painter
=
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
false
;
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
currentPainter
.
paintCount
,
0
);
editable
.
painter
=
(
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
true
)
;
editable
.
painter
=
currentPainter
=
_TestRenderEditablePainter
()..
repaint
=
true
;
pumpFrame
(
phase:
EnginePhase
.
paint
);
expect
(
currentPainter
.
paintCount
,
1
);
});
...
...
packages/flutter_tools/test/general.shard/project_test.dart
View file @
0ef0f0ba
...
...
@@ -94,7 +94,7 @@ void main() {
_testInMemory
(
'treats missing pubspec.yaml as empty'
,
()
async
{
final
Directory
directory
=
globals
.
fs
.
directory
(
'myproject'
)
..
createSync
(
recursive:
true
);
expect
(
(
FlutterProject
.
fromDirectory
(
directory
)
).
manifest
.
isEmpty
,
expect
(
FlutterProject
.
fromDirectory
(
directory
).
manifest
.
isEmpty
,
true
,
);
});
...
...
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