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
5bce52d6
Commit
5bce52d6
authored
May 12, 2017
by
Alexandre Ardhuin
Committed by
GitHub
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try use_string_buffers lint (#10034)
parent
18eac03d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
28 deletions
+45
-28
.analysis_options
.analysis_options
+1
-1
.analysis_options_repo
.analysis_options_repo
+1
-1
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+6
-4
object.dart
packages/flutter/lib/src/rendering/object.dart
+6
-4
semantics.dart
packages/flutter/lib/src/rendering/semantics.dart
+7
-4
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+6
-4
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+7
-4
overlay.dart
packages/flutter/lib/src/widgets/overlay.dart
+11
-6
No files found.
.analysis_options
View file @
5bce52d6
...
@@ -136,7 +136,7 @@ linter:
...
@@ -136,7 +136,7 @@ linter:
- unnecessary_this
- unnecessary_this
# - use_rethrow_when_possible # not yet tested
# - use_rethrow_when_possible # not yet tested
# - use_setters_to_change_properties # not yet tested
# - use_setters_to_change_properties # not yet tested
# - use_string_buffers #
not yet tested
# - use_string_buffers #
https://github.com/dart-lang/linter/pull/664
# - use_to_and_as_if_applicable # not yet tested
# - use_to_and_as_if_applicable # not yet tested
# === pub rules ===
# === pub rules ===
...
...
.analysis_options_repo
View file @
5bce52d6
...
@@ -134,7 +134,7 @@ linter:
...
@@ -134,7 +134,7 @@ linter:
- unnecessary_this
- unnecessary_this
# - use_rethrow_when_possible # not yet tested
# - use_rethrow_when_possible # not yet tested
# - use_setters_to_change_properties # not yet tested
# - use_setters_to_change_properties # not yet tested
# - use_string_buffers #
not yet tested
# - use_string_buffers #
https://github.com/dart-lang/linter/pull/664
# - use_to_and_as_if_applicable # not yet tested
# - use_to_and_as_if_applicable # not yet tested
# === pub rules ===
# === pub rules ===
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
5bce52d6
...
@@ -349,19 +349,21 @@ class ContainerLayer extends Layer {
...
@@ -349,19 +349,21 @@ class ContainerLayer extends Layer {
String
debugDescribeChildren
(
String
prefix
)
{
String
debugDescribeChildren
(
String
prefix
)
{
if
(
firstChild
==
null
)
if
(
firstChild
==
null
)
return
''
;
return
''
;
String
result
=
'
$prefix
\
u2502
\n
'
;
final
StringBuffer
result
=
new
StringBuffer
()
..
write
(
prefix
)
..
write
(
'
\
u2502
\n
'
);
Layer
child
=
firstChild
;
Layer
child
=
firstChild
;
int
count
=
1
;
int
count
=
1
;
while
(
child
!=
lastChild
)
{
while
(
child
!=
lastChild
)
{
result
+=
'
${child.toStringDeep("$prefix \u251C\u2500child $count: ", "$prefix \u2502")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u251C
\
u2500child
$count
: "
,
"
$prefix
\
u2502"
))
;
count
+=
1
;
count
+=
1
;
child
=
child
.
nextSibling
;
child
=
child
.
nextSibling
;
}
}
if
(
child
!=
null
)
{
if
(
child
!=
null
)
{
assert
(
child
==
lastChild
);
assert
(
child
==
lastChild
);
result
+=
'
${child.toStringDeep("$prefix \u2514\u2500child $count: ", "$prefix ")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u2514
\
u2500child
$count
: "
,
"
$prefix
"
))
;
}
}
return
result
;
return
result
.
toString
()
;
}
}
}
}
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
5bce52d6
...
@@ -3059,20 +3059,22 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent
...
@@ -3059,20 +3059,22 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent
@override
@override
String
debugDescribeChildren
(
String
prefix
)
{
String
debugDescribeChildren
(
String
prefix
)
{
if
(
firstChild
!=
null
)
{
if
(
firstChild
!=
null
)
{
String
result
=
'
$prefix
\
u2502
\n
'
;
final
StringBuffer
result
=
new
StringBuffer
()
..
write
(
prefix
)
..
write
(
'
\
u2502
\n
'
);
ChildType
child
=
firstChild
;
ChildType
child
=
firstChild
;
int
count
=
1
;
int
count
=
1
;
while
(
child
!=
lastChild
)
{
while
(
child
!=
lastChild
)
{
result
+=
'
${child.toStringDeep("$prefix \u251C\u2500child $count: ", "$prefix \u2502")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u251C
\
u2500child
$count
: "
,
"
$prefix
\
u2502"
))
;
count
+=
1
;
count
+=
1
;
final
ParentDataType
childParentData
=
child
.
parentData
;
final
ParentDataType
childParentData
=
child
.
parentData
;
child
=
childParentData
.
nextSibling
;
child
=
childParentData
.
nextSibling
;
}
}
if
(
child
!=
null
)
{
if
(
child
!=
null
)
{
assert
(
child
==
lastChild
);
assert
(
child
==
lastChild
);
result
+=
'
${child.toStringDeep("$prefix \u2514\u2500child $count: ", "$prefix ")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u2514
\
u2500child
$count
: "
,
"
$prefix
"
))
;
}
}
return
result
;
return
result
.
toString
()
;
}
}
return
''
;
return
''
;
}
}
...
...
packages/flutter/lib/src/rendering/semantics.dart
View file @
5bce52d6
...
@@ -590,15 +590,18 @@ class SemanticsNode extends AbstractNode {
...
@@ -590,15 +590,18 @@ class SemanticsNode extends AbstractNode {
/// Returns a string representation of this node and its descendants.
/// Returns a string representation of this node and its descendants.
String
toStringDeep
([
String
prefixLineOne
=
''
,
String
prefixOtherLines
=
''
])
{
String
toStringDeep
([
String
prefixLineOne
=
''
,
String
prefixOtherLines
=
''
])
{
String
result
=
'
$prefixLineOne$this
\n
'
;
final
StringBuffer
result
=
new
StringBuffer
()
..
write
(
prefixLineOne
)
..
write
(
this
)
..
write
(
'
\n
'
);
if
(
_children
!=
null
&&
_children
.
isNotEmpty
)
{
if
(
_children
!=
null
&&
_children
.
isNotEmpty
)
{
for
(
int
index
=
0
;
index
<
_children
.
length
-
1
;
index
+=
1
)
{
for
(
int
index
=
0
;
index
<
_children
.
length
-
1
;
index
+=
1
)
{
final
SemanticsNode
child
=
_children
[
index
];
final
SemanticsNode
child
=
_children
[
index
];
result
+=
'
${child.toStringDeep("$prefixOtherLines \u251C", "$prefixOtherLines \u2502")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefixOtherLines
\
u251C"
,
"
$prefixOtherLines
\
u2502"
))
;
}
}
result
+=
'
${_children.last.toStringDeep("$prefixOtherLines \u2514", "$prefixOtherLines ")}
'
;
result
.
write
(
_children
.
last
.
toStringDeep
(
"
$prefixOtherLines
\
u2514"
,
"
$prefixOtherLines
"
))
;
}
}
return
result
;
return
result
.
toString
()
;
}
}
}
}
...
...
packages/flutter/lib/src/rendering/viewport.dart
View file @
5bce52d6
...
@@ -476,16 +476,18 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
...
@@ -476,16 +476,18 @@ abstract class RenderViewportBase<ParentDataClass extends ContainerParentDataMix
if
(
firstChild
==
null
)
if
(
firstChild
==
null
)
return
'
$prefix
\n
'
;
return
'
$prefix
\n
'
;
int
count
=
indexOfFirstChild
;
int
count
=
indexOfFirstChild
;
String
result
=
'
$prefix
\
u2502
\n
'
;
final
StringBuffer
result
=
new
StringBuffer
()
..
write
(
prefix
)
..
write
(
'
\
u2502
\n
'
);
RenderSliver
child
=
firstChild
;
RenderSliver
child
=
firstChild
;
while
(
child
!=
lastChild
)
{
while
(
child
!=
lastChild
)
{
result
+=
'
${child.toStringDeep("$prefix \u251C\u2500${labelForChild(count)}
: ", "
$prefix
\
u2502")}'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u251C
\
u2500
${labelForChild(count)}
: "
,
"
$prefix
\
u2502"
))
;
count
+=
1
;
count
+=
1
;
child
=
childAfter
(
child
);
child
=
childAfter
(
child
);
}
}
assert
(
child
==
lastChild
);
assert
(
child
==
lastChild
);
result
+=
'
${child.toStringDeep("$prefix \u2514\u2500${labelForChild(count)}
: ", "
$prefix
")}'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u2514
\
u2500
${labelForChild(count)}
: "
,
"
$prefix
"
))
;
return
result
;
return
result
.
toString
()
;
}
}
// API TO BE IMPLEMENTED BY SUBCLASSES
// API TO BE IMPLEMENTED BY SUBCLASSES
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
5bce52d6
...
@@ -2936,16 +2936,19 @@ abstract class Element implements BuildContext {
...
@@ -2936,16 +2936,19 @@ abstract class Element implements BuildContext {
/// A detailed, textual description of this element, includings its children.
/// A detailed, textual description of this element, includings its children.
String
toStringDeep
([
String
prefixLineOne
=
''
,
String
prefixOtherLines
=
''
])
{
String
toStringDeep
([
String
prefixLineOne
=
''
,
String
prefixOtherLines
=
''
])
{
String
result
=
'
$prefixLineOne$this
\n
'
;
final
StringBuffer
result
=
new
StringBuffer
()
..
write
(
prefixLineOne
)
..
write
(
this
)
..
write
(
'
\n
'
);
final
List
<
Element
>
children
=
<
Element
>[];
final
List
<
Element
>
children
=
<
Element
>[];
visitChildren
(
children
.
add
);
visitChildren
(
children
.
add
);
if
(
children
.
isNotEmpty
)
{
if
(
children
.
isNotEmpty
)
{
final
Element
last
=
children
.
removeLast
();
final
Element
last
=
children
.
removeLast
();
for
(
Element
child
in
children
)
for
(
Element
child
in
children
)
result
+=
'
${child.toStringDeep("$prefixOtherLines\u251C", "$prefixOtherLines\u2502")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefixOtherLines
\
u251C"
,
"
$prefixOtherLines
\
u2502"
))
;
result
+=
'
${last.toStringDeep("$prefixOtherLines\u2514", "$prefixOtherLines ")}
'
;
result
.
write
(
last
.
toStringDeep
(
"
$prefixOtherLines
\
u2514"
,
"
$prefixOtherLines
"
))
;
}
}
return
result
;
return
result
.
toString
()
;
}
}
/// Returns true if the element has been marked as needing rebuilding.
/// Returns true if the element has been marked as needing rebuilding.
...
...
packages/flutter/lib/src/widgets/overlay.dart
View file @
5bce52d6
...
@@ -560,26 +560,31 @@ class _RenderTheatre extends RenderBox
...
@@ -560,26 +560,31 @@ class _RenderTheatre extends RenderBox
@override
@override
String
debugDescribeChildren
(
String
prefix
)
{
String
debugDescribeChildren
(
String
prefix
)
{
String
result
=
''
;
final
StringBuffer
result
=
new
StringBuffer
()
;
if
(
child
!=
null
)
if
(
child
!=
null
)
result
+=
'
$prefix
\
u2502
\n
${child.toStringDeep('$prefix \u251C\u2500onstage: ', '$prefix \u254E')}
'
;
result
..
write
(
prefix
)
..
write
(
'
\
u2502
\n
'
)
..
write
(
child
.
toStringDeep
(
'
$prefix
\
u251C
\
u2500onstage: '
,
'
$prefix
\
u254E'
));
if
(
firstChild
!=
null
)
{
if
(
firstChild
!=
null
)
{
RenderBox
child
=
firstChild
;
RenderBox
child
=
firstChild
;
int
count
=
1
;
int
count
=
1
;
while
(
child
!=
lastChild
)
{
while
(
child
!=
lastChild
)
{
result
+=
'
${child.toStringDeep("$prefix \u254E\u254Coffstage $count: ", "$prefix \u254E")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u254E
\
u254Coffstage
$count
: "
,
"
$prefix
\
u254E"
))
;
count
+=
1
;
count
+=
1
;
final
StackParentData
childParentData
=
child
.
parentData
;
final
StackParentData
childParentData
=
child
.
parentData
;
child
=
childParentData
.
nextSibling
;
child
=
childParentData
.
nextSibling
;
}
}
if
(
child
!=
null
)
{
if
(
child
!=
null
)
{
assert
(
child
==
lastChild
);
assert
(
child
==
lastChild
);
result
+=
'
${child.toStringDeep("$prefix \u2514\u254Coffstage $count: ", "$prefix ")}
'
;
result
.
write
(
child
.
toStringDeep
(
"
$prefix
\
u2514
\
u254Coffstage
$count
: "
,
"
$prefix
"
))
;
}
}
}
else
{
}
else
{
result
+=
'
$prefix
\
u2514
\
u254Cno offstage children'
;
result
..
write
(
prefix
)
..
write
(
'
\
u2514
\
u254Cno offstage children'
);
}
}
return
result
;
return
result
.
toString
()
;
}
}
@override
@override
...
...
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