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
4cc6880c
Unverified
Commit
4cc6880c
authored
Jun 07, 2019
by
Michael Goderbauer
Committed by
GitHub
Jun 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused/dead code from Diagnostics (#33996)
parent
4c0145d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
33 deletions
+2
-33
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+2
-33
No files found.
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
4cc6880c
...
@@ -684,24 +684,19 @@ class _SerializeConfig {
...
@@ -684,24 +684,19 @@ class _SerializeConfig {
this
.
groupName
,
this
.
groupName
,
this
.
summaryTree
=
false
,
this
.
summaryTree
=
false
,
this
.
subtreeDepth
=
1
,
this
.
subtreeDepth
=
1
,
this
.
pathToInclude
,
this
.
includeProperties
=
false
,
this
.
includeProperties
=
false
,
this
.
expandPropertyValues
=
true
,
this
.
expandPropertyValues
=
true
,
this
.
includeToStringDeep
=
false
,
this
.
maxDescendentsTruncatableNode
=
-
1
,
this
.
maxDescendentsTruncatableNode
=
-
1
,
});
});
_SerializeConfig
.
merge
(
_SerializeConfig
.
merge
(
_SerializeConfig
base
,
{
_SerializeConfig
base
,
{
int
subtreeDepth
,
int
subtreeDepth
,
Iterable
<
Diagnosticable
>
pathToInclude
,
})
:
groupName
=
base
.
groupName
,
})
:
groupName
=
base
.
groupName
,
summaryTree
=
base
.
summaryTree
,
summaryTree
=
base
.
summaryTree
,
subtreeDepth
=
subtreeDepth
??
base
.
subtreeDepth
,
subtreeDepth
=
subtreeDepth
??
base
.
subtreeDepth
,
pathToInclude
=
pathToInclude
??
base
.
pathToInclude
,
includeProperties
=
base
.
includeProperties
,
includeProperties
=
base
.
includeProperties
,
expandPropertyValues
=
base
.
expandPropertyValues
,
expandPropertyValues
=
base
.
expandPropertyValues
,
includeToStringDeep
=
base
.
includeToStringDeep
,
maxDescendentsTruncatableNode
=
base
.
maxDescendentsTruncatableNode
;
maxDescendentsTruncatableNode
=
base
.
maxDescendentsTruncatableNode
;
/// Optional object group name used to manage manage lifetimes of object
/// Optional object group name used to manage manage lifetimes of object
...
@@ -718,10 +713,6 @@ class _SerializeConfig {
...
@@ -718,10 +713,6 @@ class _SerializeConfig {
/// How many levels of children to include in the JSON payload.
/// How many levels of children to include in the JSON payload.
final
int
subtreeDepth
;
final
int
subtreeDepth
;
/// Path of nodes through the children of this node to include even if
/// subtreeDepth is exceeded.
final
Iterable
<
Diagnosticable
>
pathToInclude
;
/// Include information about properties in the JSON instead of requiring
/// Include information about properties in the JSON instead of requiring
/// a separate request to determine properties.
/// a separate request to determine properties.
final
bool
includeProperties
;
final
bool
includeProperties
;
...
@@ -737,9 +728,6 @@ class _SerializeConfig {
...
@@ -737,9 +728,6 @@ class _SerializeConfig {
/// is required before objects in the tree will ever be garbage collected.
/// is required before objects in the tree will ever be garbage collected.
bool
get
interactive
=>
groupName
!=
null
;
bool
get
interactive
=>
groupName
!=
null
;
/// Include the text rendering of the nodes (helpful for debugging).
final
bool
includeToStringDeep
;
final
int
maxDescendentsTruncatableNode
;
final
int
maxDescendentsTruncatableNode
;
}
}
...
@@ -980,7 +968,6 @@ mixin WidgetInspectorService {
...
@@ -980,7 +968,6 @@ mixin WidgetInspectorService {
details
.
toDiagnosticsNode
(),
details
.
toDiagnosticsNode
(),
_SerializeConfig
(
_SerializeConfig
(
groupName:
_consoleObjectGroup
,
groupName:
_consoleObjectGroup
,
includeToStringDeep:
true
,
subtreeDepth:
5
,
subtreeDepth:
5
,
includeProperties:
true
,
includeProperties:
true
,
expandPropertyValues:
true
,
expandPropertyValues:
true
,
...
@@ -1484,8 +1471,7 @@ mixin WidgetInspectorService {
...
@@ -1484,8 +1471,7 @@ mixin WidgetInspectorService {
}
}
}
}
if
(
config
.
subtreeDepth
>
0
||
if
(
config
.
subtreeDepth
>
0
)
{
(
config
.
pathToInclude
!=
null
&&
config
.
pathToInclude
.
isNotEmpty
))
{
json
[
'children'
]
=
_nodesToJson
(
_getChildrenHelper
(
node
,
config
),
config
,
parent:
node
);
json
[
'children'
]
=
_nodesToJson
(
_getChildrenHelper
(
node
,
config
),
config
,
parent:
node
);
}
}
...
@@ -1599,16 +1585,6 @@ mixin WidgetInspectorService {
...
@@ -1599,16 +1585,6 @@ mixin WidgetInspectorService {
}
}
final
List
<
Map
<
String
,
Object
>>
json
=
nodes
.
map
<
Map
<
String
,
Object
>>(
final
List
<
Map
<
String
,
Object
>>
json
=
nodes
.
map
<
Map
<
String
,
Object
>>(
(
DiagnosticsNode
node
)
{
(
DiagnosticsNode
node
)
{
if
(
config
.
pathToInclude
!=
null
&&
config
.
pathToInclude
.
isNotEmpty
)
{
if
(
config
.
pathToInclude
.
first
==
node
.
value
)
{
return
_nodeToJson
(
node
,
_SerializeConfig
.
merge
(
config
,
pathToInclude:
config
.
pathToInclude
.
skip
(
1
)),
);
}
else
{
return
_nodeToJson
(
node
,
_SerializeConfig
.
merge
(
config
));
}
}
// The tricky special case here is that when in the detailsTree,
// The tricky special case here is that when in the detailsTree,
// we keep subtreeDepth from going down to zero until we reach nodes
// we keep subtreeDepth from going down to zero until we reach nodes
// that also exist in the summary tree. This ensures that every time
// that also exist in the summary tree. This ensures that every time
...
@@ -1708,19 +1684,12 @@ mixin WidgetInspectorService {
...
@@ -1708,19 +1684,12 @@ mixin WidgetInspectorService {
return
_isValueCreatedByLocalProject
(
value
);
return
_isValueCreatedByLocalProject
(
value
);
}
}
bool
_isDeepStyle
(
DiagnosticsTreeStyle
style
)
=>
false
;
List
<
DiagnosticsNode
>
_getChildrenFiltered
(
List
<
DiagnosticsNode
>
_getChildrenFiltered
(
DiagnosticsNode
node
,
DiagnosticsNode
node
,
_SerializeConfig
config
,
_SerializeConfig
config
,
)
{
)
{
final
List
<
DiagnosticsNode
>
children
=
<
DiagnosticsNode
>[];
final
List
<
DiagnosticsNode
>
children
=
<
DiagnosticsNode
>[];
final
Object
value
=
node
.
value
;
final
List
<
DiagnosticsNode
>
rawChildren
=
node
.
getChildren
();
List
<
DiagnosticsNode
>
rawChildren
=
node
.
getChildren
();
if
(
rawChildren
.
isEmpty
&&
node
is
DiagnosticsProperty
&&
value
is
Diagnosticable
&&
config
.
expandPropertyValues
&&
_isDeepStyle
(
node
.
style
))
{
rawChildren
=
value
.
toDiagnosticsNode
().
getChildren
();
}
for
(
DiagnosticsNode
child
in
rawChildren
)
{
for
(
DiagnosticsNode
child
in
rawChildren
)
{
if
(!
config
.
summaryTree
||
_shouldShowInSummaryTree
(
child
))
{
if
(!
config
.
summaryTree
||
_shouldShowInSummaryTree
(
child
))
{
...
...
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