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
4356d3b6
Unverified
Commit
4356d3b6
authored
Sep 13, 2022
by
Kenzie Davisson
Committed by
GitHub
Sep 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create an enum for widget inspector service extensions for use by tools (#111405)
parent
2d5e181b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
744 additions
and
188 deletions
+744
-188
service_extensions.dart
packages/flutter/lib/src/widgets/service_extensions.dart
+366
-0
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+27
-26
widget_inspector_test.dart
packages/flutter/test/widgets/widget_inspector_test.dart
+351
-162
No files found.
packages/flutter/lib/src/widgets/service_extensions.dart
View file @
4356d3b6
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
4356d3b6
...
...
@@ -29,6 +29,7 @@ import 'binding.dart';
import
'debug.dart'
;
import
'framework.dart'
;
import
'gesture_detector.dart'
;
import
'service_extensions.dart'
;
/// Signature for the builder callback used by
/// [WidgetInspector.selectButtonBuilder].
...
...
@@ -1007,7 +1008,7 @@ mixin WidgetInspectorService {
SchedulerBinding
.
instance
.
addPersistentFrameCallback
(
_onFrameStart
);
_registerBoolServiceExtension
(
name:
'structuredErrors'
,
name:
WidgetInspectorServiceExtensions
.
structuredErrors
.
name
,
getter:
()
async
=>
FlutterError
.
presentError
==
_reportStructuredError
,
setter:
(
bool
value
)
{
FlutterError
.
presentError
=
value
?
_reportStructuredError
:
defaultExceptionHandler
;
...
...
@@ -1016,7 +1017,7 @@ mixin WidgetInspectorService {
);
_registerBoolServiceExtension
(
name:
'show'
,
name:
WidgetInspectorServiceExtensions
.
show
.
name
,
getter:
()
async
=>
WidgetsApp
.
debugShowWidgetInspectorOverride
,
setter:
(
bool
value
)
{
if
(
WidgetsApp
.
debugShowWidgetInspectorOverride
==
value
)
{
...
...
@@ -1031,7 +1032,7 @@ mixin WidgetInspectorService {
// Service extensions that are only supported if widget creation locations
// are tracked.
_registerBoolServiceExtension
(
name:
'trackRebuildDirtyWidgets'
,
name:
WidgetInspectorServiceExtensions
.
trackRebuildDirtyWidgets
.
name
,
getter:
()
async
=>
_trackRebuildDirtyWidgets
,
setter:
(
bool
value
)
async
{
if
(
value
==
_trackRebuildDirtyWidgets
)
{
...
...
@@ -1054,7 +1055,7 @@ mixin WidgetInspectorService {
);
_registerBoolServiceExtension
(
name:
'trackRepaintWidgets'
,
name:
WidgetInspectorServiceExtensions
.
trackRepaintWidgets
.
name
,
getter:
()
async
=>
_trackRepaintWidgets
,
setter:
(
bool
value
)
async
{
if
(
value
==
_trackRepaintWidgets
)
{
...
...
@@ -1081,92 +1082,92 @@ mixin WidgetInspectorService {
}
_registerSignalServiceExtension
(
name:
'disposeAllGroups'
,
name:
WidgetInspectorServiceExtensions
.
disposeAllGroups
.
name
,
callback:
()
async
{
disposeAllGroups
();
return
null
;
},
);
_registerObjectGroupServiceExtension
(
name:
'disposeGroup'
,
name:
WidgetInspectorServiceExtensions
.
disposeGroup
.
name
,
callback:
(
String
name
)
async
{
disposeGroup
(
name
);
return
null
;
},
);
_registerSignalServiceExtension
(
name:
'isWidgetTreeReady'
,
name:
WidgetInspectorServiceExtensions
.
isWidgetTreeReady
.
name
,
callback:
isWidgetTreeReady
,
);
_registerServiceExtensionWithArg
(
name:
'disposeId'
,
name:
WidgetInspectorServiceExtensions
.
disposeId
.
name
,
callback:
(
String
?
objectId
,
String
objectGroup
)
async
{
disposeId
(
objectId
,
objectGroup
);
return
null
;
},
);
_registerServiceExtensionVarArgs
(
name:
'setPubRootDirectories'
,
name:
WidgetInspectorServiceExtensions
.
setPubRootDirectories
.
name
,
callback:
(
List
<
String
>
args
)
async
{
setPubRootDirectories
(
args
);
return
null
;
},
);
_registerServiceExtensionVarArgs
(
name:
'addPubRootDirectories'
,
name:
WidgetInspectorServiceExtensions
.
addPubRootDirectories
.
name
,
callback:
(
List
<
String
>
args
)
async
{
addPubRootDirectories
(
args
);
return
null
;
},
);
_registerServiceExtensionVarArgs
(
name:
'removePubRootDirectories'
,
name:
WidgetInspectorServiceExtensions
.
removePubRootDirectories
.
name
,
callback:
(
List
<
String
>
args
)
async
{
removePubRootDirectories
(
args
);
return
null
;
},
);
_registerServiceExtensionWithArg
(
name:
'setSelectionById'
,
name:
WidgetInspectorServiceExtensions
.
setSelectionById
.
name
,
callback:
setSelectionById
,
);
_registerServiceExtensionWithArg
(
name:
'getParentChain'
,
name:
WidgetInspectorServiceExtensions
.
getParentChain
.
name
,
callback:
_getParentChain
,
);
_registerServiceExtensionWithArg
(
name:
'getProperties'
,
name:
WidgetInspectorServiceExtensions
.
getProperties
.
name
,
callback:
_getProperties
,
);
_registerServiceExtensionWithArg
(
name:
'getChildren'
,
name:
WidgetInspectorServiceExtensions
.
getChildren
.
name
,
callback:
_getChildren
,
);
_registerServiceExtensionWithArg
(
name:
'getChildrenSummaryTree'
,
name:
WidgetInspectorServiceExtensions
.
getChildrenSummaryTree
.
name
,
callback:
_getChildrenSummaryTree
,
);
_registerServiceExtensionWithArg
(
name:
'getChildrenDetailsSubtree'
,
name:
WidgetInspectorServiceExtensions
.
getChildrenDetailsSubtree
.
name
,
callback:
_getChildrenDetailsSubtree
,
);
_registerObjectGroupServiceExtension
(
name:
'getRootWidget'
,
name:
WidgetInspectorServiceExtensions
.
getRootWidget
.
name
,
callback:
_getRootWidget
,
);
_registerObjectGroupServiceExtension
(
name:
'getRootRenderObject'
,
name:
WidgetInspectorServiceExtensions
.
getRootRenderObject
.
name
,
callback:
_getRootRenderObject
,
);
_registerObjectGroupServiceExtension
(
name:
'getRootWidgetSummaryTree'
,
name:
WidgetInspectorServiceExtensions
.
getRootWidgetSummaryTree
.
name
,
callback:
_getRootWidgetSummaryTree
,
);
registerServiceExtension
(
name:
'getDetailsSubtree'
,
name:
WidgetInspectorServiceExtensions
.
getDetailsSubtree
.
name
,
callback:
(
Map
<
String
,
String
>
parameters
)
async
{
assert
(
parameters
.
containsKey
(
'objectGroup'
));
final
String
?
subtreeDepth
=
parameters
[
'subtreeDepth'
];
...
...
@@ -1180,24 +1181,24 @@ mixin WidgetInspectorService {
},
);
_registerServiceExtensionWithArg
(
name:
'getSelectedRenderObject'
,
name:
WidgetInspectorServiceExtensions
.
getSelectedRenderObject
.
name
,
callback:
_getSelectedRenderObject
,
);
_registerServiceExtensionWithArg
(
name:
'getSelectedWidget'
,
name:
WidgetInspectorServiceExtensions
.
getSelectedWidget
.
name
,
callback:
_getSelectedWidget
,
);
_registerServiceExtensionWithArg
(
name:
'getSelectedSummaryWidget'
,
name:
WidgetInspectorServiceExtensions
.
getSelectedSummaryWidget
.
name
,
callback:
_getSelectedSummaryWidget
,
);
_registerSignalServiceExtension
(
name:
'isWidgetCreationTracked'
,
name:
WidgetInspectorServiceExtensions
.
isWidgetCreationTracked
.
name
,
callback:
isWidgetCreationTracked
,
);
registerServiceExtension
(
name:
'screenshot'
,
name:
WidgetInspectorServiceExtensions
.
screenshot
.
name
,
callback:
(
Map
<
String
,
String
>
parameters
)
async
{
assert
(
parameters
.
containsKey
(
'id'
));
assert
(
parameters
.
containsKey
(
'width'
));
...
...
packages/flutter/test/widgets/widget_inspector_test.dart
View file @
4356d3b6
This diff is collapsed.
Click to expand it.
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