ext function
Discovers or invokes VM service extensions registered by the running app.
- ExtListInput — calls
getVM, unionsextensionRPCsacross all isolates, and returns a sorted, deduplicated list. - ExtCallInput — calls
callServiceExtensionon the first isolate that exposes the requested method, forwarding any--argparameters.
Never throws; all error conditions are represented as sealed result cases.
Implementation
Future<ExtResult> ext(ExtInput input) async {
try {
return switch (input) {
ExtListInput() => await _list(),
ExtCallInput(:final method, :final args) => await _call(method, args),
};
} on AppDiedException catch (e) {
return ExtAppDied(logLines: e.logLines, reason: e.reason);
} catch (e) {
return ExtError(e.toString());
}
}