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
18362ec6
Commit
18362ec6
authored
Nov 16, 2016
by
Ian Hickson
Committed by
GitHub
Nov 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the debugDumpFoo output (#6882)
parent
bf2c46e2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
27 deletions
+25
-27
print.dart
packages/flutter/lib/src/foundation/print.dart
+14
-11
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-1
view.dart
packages/flutter/lib/src/rendering/view.dart
+7
-0
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+3
-15
No files found.
packages/flutter/lib/src/foundation/print.dart
View file @
18362ec6
...
...
@@ -80,24 +80,27 @@ final RegExp _indentPattern = new RegExp('^ *(?:[-+*] |[0-9]+[.):] )?');
enum
_WordWrapParseMode
{
inSpace
,
inWord
,
atBreak
}
/// Wraps the given string at the given width.
///
/// Wrapping occurs at space characters (U+0020). Lines that start
///
with an octothorpe ("#", U+0023) are not wrapped (so for example,
///
Dart stack traces
won't be wrapped).
/// Wrapping occurs at space characters (U+0020). Lines that start
with an
///
octothorpe ("#", U+0023) are not wrapped (so for example, Dart stack traces
/// won't be wrapped).
///
///
This is not suitable for use with arbitrary Unicode text. F
or
/// example
, it doesn't implement UAX #14, can't handle ideographic
///
text, doesn't hyphenate, and so forth. It is only intended for
///
formatting error messages
.
///
Subsequent lines attempt to duplicate the indentation of the first line, f
or
/// example
if the first line starts with multiple spaces. In addition, if a
///
`wrapIndent` argument is provided, each line after the first is prefixed by
///
that string
.
///
/// The default [debugPrint] implementation uses this for its line
/// wrapping.
Iterable
<
String
>
debugWordWrap
(
String
message
,
int
width
)
sync
*
{
/// This is not suitable for use with arbitrary Unicode text. For example, it
/// doesn't implement UAX #14, can't handle ideographic text, doesn't hyphenate,
/// and so forth. It is only intended for formatting error messages.
///
/// The default [debugPrint] implementation uses this for its line wrapping.
Iterable
<
String
>
debugWordWrap
(
String
message
,
int
width
,
{
String
wrapIndent:
''
})
sync
*
{
if
(
message
.
length
<
width
||
message
[
0
]
==
'#'
)
{
yield
message
;
return
;
}
Match
prefixMatch
=
_indentPattern
.
matchAsPrefix
(
message
);
String
prefix
=
' '
*
prefixMatch
.
group
(
0
).
length
;
String
prefix
=
wrapIndent
+
' '
*
prefixMatch
.
group
(
0
).
length
;
int
start
=
0
;
int
startForLengthCalculations
=
0
;
bool
addPrefix
=
false
;
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
18362ec6
...
...
@@ -2410,7 +2410,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
List
<
String
>
description
=
<
String
>[];
debugFillDescription
(
description
);
result
+=
description
.
expand
((
String
description
)
=>
de
scription
.
split
(
'
\n
'
))
.
expand
((
String
description
)
=>
de
bugWordWrap
(
description
,
65
,
wrapIndent:
'
'
))
.
map
/*<String>*/
((
String
line
)
=>
"
$descriptionPrefix$line
\n
"
)
.
join
();
if
(
childrenDescription
==
''
)
...
...
packages/flutter/lib/src/rendering/view.dart
View file @
18362ec6
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'dart:developer'
;
import
'dart:io'
show
Platform
;
import
'dart:ui'
as
ui
show
Scene
,
SceneBuilder
,
window
;
import
'package:vector_math/vector_math_64.dart'
;
...
...
@@ -171,8 +172,14 @@ class RenderView extends RenderObject with RenderObjectWithChildMixin<RenderBox>
@override
void
debugFillDescription
(
List
<
String
>
description
)
{
// call to ${super.debugFillDescription(prefix)} is omitted because the root superclasses don't include any interesting information for this class
assert
(()
{
description
.
add
(
'debug mode enabled -
${Platform.operatingSystem}
'
);
return
true
;
});
description
.
add
(
'window size:
${ui.window.physicalSize}
(in physical pixels)'
);
description
.
add
(
'device pixel ratio:
${ui.window.devicePixelRatio}
(physical pixels per logical pixel)'
);
description
.
add
(
'configuration:
$configuration
(in logical pixels)'
);
if
(
ui
.
window
.
semanticsEnabled
)
description
.
add
(
'semantics enabled'
);
}
}
packages/flutter/lib/src/widgets/framework.dart
View file @
18362ec6
...
...
@@ -2578,19 +2578,7 @@ abstract class Element implements BuildContext {
}
if
(
node
!=
null
)
chain
.
add
(
'
\
u22EF'
);
String
result
=
''
;
String
line
=
''
;
for
(
String
link
in
chain
)
{
if
(
line
!=
''
)
line
+=
'
\
u2190 '
;
if
(
link
.
length
>
3
&&
line
.
length
+
link
.
length
>
65
)
{
result
+=
'
$line
\n
'
;
line
=
' '
;
}
line
+=
link
;
}
result
+=
line
;
return
result
;
return
chain
.
join
(
'
\
u2190 '
);
}
/// A short, textual description of this element.
...
...
@@ -2637,8 +2625,8 @@ abstract class Element implements BuildContext {
if
(
children
.
length
>
0
)
{
Element
last
=
children
.
removeLast
();
for
(
Element
child
in
children
)
result
+=
'
${child.toStringDeep("$prefixOtherLines
\u251C", "$prefixOtherLines
\u2502")}
'
;
result
+=
'
${last.toStringDeep("$prefixOtherLines
\u2514", "$prefixOtherLines
")}
'
;
result
+=
'
${child.toStringDeep("$prefixOtherLines
\u251C", "$prefixOtherLines
\u2502")}
'
;
result
+=
'
${last.toStringDeep("$prefixOtherLines
\u2514", "$prefixOtherLines
")}
'
;
}
return
result
;
}
...
...
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