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
67169043
Commit
67169043
authored
Apr 28, 2017
by
Devon Carew
Committed by
GitHub
Apr 28, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return the result from calling a service extension (#9636)
parent
f2e89681
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+14
-5
No files found.
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
67169043
...
...
@@ -441,7 +441,16 @@ class AppDomain extends Domain {
});
}
Future
<
OperationResult
>
callServiceExtension
(
Map
<
String
,
dynamic
>
args
)
async
{
/// Returns an error, or the service extension result (a map with two fixed
/// keys, `type` and `method`). The result may have one or more additional keys,
/// depending on the specific service extension end-point. For example:
///
/// {
/// "value":"android",
/// "type":"_extensionType",
/// "method":"ext.flutter.platformOverride"
/// }
Future
<
Map
<
String
,
dynamic
>>
callServiceExtension
(
Map
<
String
,
dynamic
>
args
)
async
{
final
String
appId
=
_getStringArg
(
args
,
'appId'
,
required:
true
);
final
String
methodName
=
_getStringArg
(
args
,
'methodName'
);
final
Map
<
String
,
String
>
params
=
args
[
'params'
]
??
<
String
,
String
>{};
...
...
@@ -453,12 +462,12 @@ class AppDomain extends Domain {
final
Isolate
isolate
=
app
.
runner
.
flutterDevices
.
first
.
views
.
first
.
uiIsolate
;
final
Map
<
String
,
dynamic
>
result
=
await
isolate
.
invokeFlutterExtensionRpcRaw
(
methodName
,
params:
params
);
if
(
result
==
null
)
return
new
OperationResult
(
1
,
'method not available:
$methodName
'
)
;
throw
'method not available:
$methodName
'
;
if
(
result
.
containsKey
(
'error'
))
return
new
OperationResult
(
1
,
result
[
'error'
])
;
else
return
OperationResult
.
ok
;
throw
result
[
'error'
]
;
return
result
;
}
Future
<
bool
>
stop
(
Map
<
String
,
dynamic
>
args
)
async
{
...
...
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