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
27cceff2
Commit
27cceff2
authored
Nov 28, 2016
by
Ian Hickson
Committed by
GitHub
Nov 28, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow debugPaintSizeEnabled to be toggled from the runner (#7028)
parent
744e89f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
10 deletions
+30
-10
hot.dart
packages/flutter_tools/lib/src/hot.dart
+1
-2
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+20
-4
run.dart
packages/flutter_tools/lib/src/run.dart
+2
-4
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+7
-0
No files found.
packages/flutter_tools/lib/src/hot.dart
View file @
27cceff2
...
...
@@ -535,8 +535,7 @@ class HotRunner extends ResidentRunner {
);
printStatus
(
'The Observatory debugger and profiler is available at: http://127.0.0.1:
$_observatoryPort
/'
);
if
(
details
)
{
printStatus
(
'To dump the widget hierarchy of the app (debugDumpApp), press "w".'
);
printStatus
(
'To dump the rendering tree of the app (debugDumpRenderTree), press "t".'
);
printHelpDetails
();
printStatus
(
'To repeat this help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'
);
}
else
{
printStatus
(
'For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'
);
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
27cceff2
...
...
@@ -61,17 +61,21 @@ abstract class ResidentRunner {
Future
<
Null
>
_debugDumpApp
()
async
{
if
(
vmService
!=
null
)
await
vmService
.
vm
.
refreshViews
();
await
currentView
.
uiIsolate
.
flutterDebugDumpApp
();
}
Future
<
Null
>
_debugDumpRenderTree
()
async
{
if
(
vmService
!=
null
)
await
vmService
.
vm
.
refreshViews
();
await
currentView
.
uiIsolate
.
flutterDebugDumpRenderTree
();
}
Future
<
Null
>
_debugToggleDebugPaintSizeEnabled
()
async
{
if
(
vmService
!=
null
)
await
vmService
.
vm
.
refreshViews
();
await
currentView
.
uiIsolate
.
flutterToggleDebugPaintSizeEnabled
();
}
void
registerSignalHandlers
()
{
ProcessSignal
.
SIGINT
.
watch
().
listen
((
ProcessSignal
signal
)
async
{
_resetTerminal
();
...
...
@@ -154,6 +158,11 @@ abstract class ResidentRunner {
return
true
;
await
_debugDumpRenderTree
();
return
true
;
}
else
if
(
lower
==
'p'
)
{
if
(!
supportsServiceProtocol
)
return
true
;
await
_debugToggleDebugPaintSizeEnabled
();
return
true
;
}
else
if
(
lower
==
'q'
||
character
==
AnsiTerminal
.
KEY_F10
)
{
// F10, exit
await
stop
();
...
...
@@ -225,12 +234,19 @@ abstract class ResidentRunner {
appFinished
();
}
/// Called to print help to the terminal.
void
printHelp
({
@required
bool
details
});
void
printHelpDetails
()
{
printStatus
(
'To dump the widget hierarchy of the app (debugDumpApp), press "w".'
);
printStatus
(
'To dump the rendering tree of the app (debugDumpRenderTree), press "t".'
);
printStatus
(
'To toggle the display of construction lines (debugPaintSizeEnabled), press "p".'
);
}
/// Called when a signal has requested we exit.
Future
<
Null
>
cleanupAfterSignal
();
/// Called right before we exit.
Future
<
Null
>
cleanupAtFinish
();
/// Called to print help to the terminal.
void
printHelp
({
@required
bool
details
});
/// Called when the runner should handle a terminal command.
Future
<
Null
>
handleTerminalCommand
(
String
code
);
}
...
...
packages/flutter_tools/lib/src/run.dart
View file @
27cceff2
...
...
@@ -179,10 +179,8 @@ class RunAndStayResident extends ResidentRunner {
printStatus
(
'The Observatory debugger and profiler is available at: http://127.0.0.1:
${_result.observatoryPort}
/'
);
if
(
supportsServiceProtocol
)
{
haveDetails
=
true
;
if
(
details
)
{
printStatus
(
'To dump the widget hierarchy of the app (debugDumpApp), press "w".'
);
printStatus
(
'To dump the rendering tree of the app (debugDumpRenderTree), press "t".'
);
}
if
(
details
)
printHelpDetails
();
}
if
(
haveDetails
&&
!
details
)
{
printStatus
(
'For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.'
);
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
27cceff2
...
...
@@ -810,6 +810,13 @@ class Isolate extends ServiceObjectOwner {
return
invokeFlutterExtensionRpcRaw
(
'ext.flutter.debugDumpRenderTree'
);
}
Future
<
Map
<
String
,
dynamic
>>
flutterToggleDebugPaintSizeEnabled
()
async
{
Map
<
String
,
dynamic
>
state
=
await
invokeFlutterExtensionRpcRaw
(
'ext.flutter.debugPaint'
);
if
(
state
!=
null
&&
state
.
containsKey
(
'enabled'
)
&&
state
[
'enabled'
]
is
bool
)
state
=
await
invokeFlutterExtensionRpcRaw
(
'ext.flutter.debugPaint'
,
<
String
,
dynamic
>{
'enabled'
:
!
state
[
'enabled'
]
});
return
state
;
}
static
bool
_isMethodNotFoundException
(
dynamic
e
)
{
return
(
e
is
rpc
.
RpcException
)
&&
(
e
.
code
==
rpc_error_code
.
METHOD_NOT_FOUND
);
...
...
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