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
9b56c1c5
Commit
9b56c1c5
authored
May 10, 2017
by
Alexandre Ardhuin
Committed by
GitHub
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable always_put_control_body_on_new_line lint (#9950)
parent
e4546584
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
17 deletions
+32
-17
.analysis_options
.analysis_options
+1
-1
.analysis_options_repo
.analysis_options_repo
+1
-1
test_step.dart
dev/integration_tests/channels/lib/src/test_step.dart
+20
-10
text_form_field_demo.dart
...utter_gallery/lib/demo/material/text_form_field_demo.dart
+8
-4
button_tap_test.dart
examples/platform_channel/test_driver/button_tap_test.dart
+2
-1
No files found.
.analysis_options
View file @
9b56c1c5
...
...
@@ -66,7 +66,7 @@ linter:
# === style rules ===
- always_declare_return_types
# - always_put_control_body_on_new_line # not yet tested
- always_put_control_body_on_new_line
- always_require_non_null_named_parameters
- always_specify_types
- annotate_overrides
...
...
.analysis_options_repo
View file @
9b56c1c5
...
...
@@ -64,7 +64,7 @@ linter:
# === style rules ===
- always_declare_return_types
# - always_put_control_body_on_new_line # not yet tested
- always_put_control_body_on_new_line
- always_require_non_null_named_parameters
- always_specify_types
- annotate_overrides
...
...
dev/integration_tests/channels/lib/src/test_step.dart
View file @
9b56c1c5
...
...
@@ -102,7 +102,8 @@ Future<TestStepResult> resultOfHandshake(
dynamic
error
,
)
async
{
assert
(
message
!=
nothing
);
while
(
received
.
length
<
2
)
received
.
add
(
nothing
);
while
(
received
.
length
<
2
)
received
.
add
(
nothing
);
TestStatus
status
;
if
(!
_deepEquals
(
messageEcho
,
message
)
||
received
.
length
!=
2
||
...
...
@@ -136,11 +137,16 @@ String _toString(dynamic message) {
}
bool
_deepEquals
(
dynamic
a
,
dynamic
b
)
{
if
(
a
==
b
)
return
true
;
if
(
a
is
double
&&
a
.
isNaN
)
return
b
is
double
&&
b
.
isNaN
;
if
(
a
is
ByteData
)
return
b
is
ByteData
&&
_deepEqualsByteData
(
a
,
b
);
if
(
a
is
List
)
return
b
is
List
&&
_deepEqualsList
(
a
,
b
);
if
(
a
is
Map
)
return
b
is
Map
&&
_deepEqualsMap
(
a
,
b
);
if
(
a
==
b
)
return
true
;
if
(
a
is
double
&&
a
.
isNaN
)
return
b
is
double
&&
b
.
isNaN
;
if
(
a
is
ByteData
)
return
b
is
ByteData
&&
_deepEqualsByteData
(
a
,
b
);
if
(
a
is
List
)
return
b
is
List
&&
_deepEqualsList
(
a
,
b
);
if
(
a
is
Map
)
return
b
is
Map
&&
_deepEqualsMap
(
a
,
b
);
return
false
;
}
...
...
@@ -152,17 +158,21 @@ bool _deepEqualsByteData(ByteData a, ByteData b) {
}
bool
_deepEqualsList
(
List
<
dynamic
>
a
,
List
<
dynamic
>
b
)
{
if
(
a
.
length
!=
b
.
length
)
return
false
;
if
(
a
.
length
!=
b
.
length
)
return
false
;
for
(
int
i
=
0
;
i
<
a
.
length
;
i
++)
{
if
(!
_deepEquals
(
a
[
i
],
b
[
i
]))
return
false
;
if
(!
_deepEquals
(
a
[
i
],
b
[
i
]))
return
false
;
}
return
true
;
}
bool
_deepEqualsMap
(
Map
<
dynamic
,
dynamic
>
a
,
Map
<
dynamic
,
dynamic
>
b
)
{
if
(
a
.
length
!=
b
.
length
)
return
false
;
if
(
a
.
length
!=
b
.
length
)
return
false
;
for
(
dynamic
key
in
a
.
keys
)
{
if
(!
b
.
containsKey
(
key
)
||
!
_deepEquals
(
a
[
key
],
b
[
key
]))
return
false
;
if
(!
b
.
containsKey
(
key
)
||
!
_deepEquals
(
a
[
key
],
b
[
key
]))
return
false
;
}
return
true
;
}
examples/flutter_gallery/lib/demo/material/text_form_field_demo.dart
View file @
9b56c1c5
...
...
@@ -206,19 +206,23 @@ class _UsNumberTextInputFormatter extends TextInputFormatter {
final
StringBuffer
newText
=
new
StringBuffer
();
if
(
newTextLength
>=
1
)
{
newText
.
write
(
'('
);
if
(
newValue
.
selection
.
end
>=
1
)
selectionIndex
++;
if
(
newValue
.
selection
.
end
>=
1
)
selectionIndex
++;
}
if
(
newTextLength
>=
4
)
{
newText
.
write
(
newValue
.
text
.
substring
(
0
,
usedSubstringIndex
=
3
)
+
') '
);
if
(
newValue
.
selection
.
end
>=
3
)
selectionIndex
+=
2
;
if
(
newValue
.
selection
.
end
>=
3
)
selectionIndex
+=
2
;
}
if
(
newTextLength
>=
7
)
{
newText
.
write
(
newValue
.
text
.
substring
(
3
,
usedSubstringIndex
=
6
)
+
'-'
);
if
(
newValue
.
selection
.
end
>=
6
)
selectionIndex
++;
if
(
newValue
.
selection
.
end
>=
6
)
selectionIndex
++;
}
if
(
newTextLength
>=
11
)
{
newText
.
write
(
newValue
.
text
.
substring
(
6
,
usedSubstringIndex
=
10
)
+
' '
);
if
(
newValue
.
selection
.
end
>=
10
)
selectionIndex
++;
if
(
newValue
.
selection
.
end
>=
10
)
selectionIndex
++;
}
// Dump the rest.
if
(
newTextLength
>=
usedSubstringIndex
)
...
...
examples/platform_channel/test_driver/button_tap_test.dart
View file @
9b56c1c5
...
...
@@ -14,7 +14,8 @@ void main() {
});
tearDownAll
(()
async
{
if
(
driver
!=
null
)
driver
.
close
();
if
(
driver
!=
null
)
driver
.
close
();
});
test
(
'tap on the button, verify result'
,
()
async
{
...
...
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