FlutterRuntime class abstract

Implementers

Constructors

FlutterRuntime()

Properties

attachedUri → Uri?
The URI we're attached to, when known.
no setter
flutterIsolateId → String
Raw selected Flutter isolate id. Same caveat as rawService.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isAttached → bool
Currently attached to a VM service.
no setter
loggingEvents → Stream<Event>
Broadcast stream of LoggingEvents from developer.log and package:logging consumers.
no setter
onDisconnect → Stream<void>
Fires once when the VM service WebSocket closes (hot restart, app kill, etc.). Use this to trigger auto-reconnect. Implementors broadcast one event then close the stream.
no setter
rawService → VmService
Raw VM service handle. Try not to use this from glint code — the whole point of FlutterRuntime is to keep this surface contained to one adapter. Exposed for verify scripts and adapter authors.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stderrEvents → Stream<Event>
Broadcast stream of WriteEvents from the Flutter app's stderr.
no setter
stdoutEvents → Stream<Event>
Broadcast stream of WriteEvents from the Flutter app's stdout. FlutterError dumps land here (not stderr — debugPrint → print → stdout), so error-capture pipelines must subscribe.
no setter

Methods

appRootDirectory() → Future<String?>
The app's package root (…/app, no /lib), from the resolved main library; null when it cannot be resolved.
attach(Uri vmServiceUri) → Future<void>
Attach to a VM service over its WebSocket URI. Selects the first isolate exposing ext.flutter.* extensions and listens to the stderr / stdout / logging event streams. Subsequent calls re-attach.
disconnect() → Future<void>
Best-effort disconnect; safe to call multiple times.
disposeInspectorGroup(String groupName) → Future<void>
Best-effort cleanup of the inspector's object-group id table. Never throws — callers don't need to wrap this.
evaluate(String expression) → Future<InstanceRef>
Evaluates expression in a library with the Flutter widgets API in scope (framework first, then the app's own). Returns the raw InstanceRef for the caller to crack open by type. Throws RuntimeEvalError on compilation error or ErrorRef return.
evaluateIn(String expression, {String? librarySuffix, Map<String, String>? scope}) → Future<InstanceRef>
Evaluates expression in the loaded library whose uri ends with librarySuffix (the usual eval library when null), with scope naming live object ids.
evaluateString(String expression, {bool rethrowErrors = false}) → Future<String?>
Evaluates expression and returns its valueAsString, transparently refetching via getObject when the value is truncated past the 128-char preview. Returns null for a non-string result, and for an eval error unless rethrowErrors, which rethrows the RuntimeEvalError.
evaluateWithSelection({required String expression, required String inspectorId, required String groupName}) → Future<String?>
Sets the inspector selection to inspectorId in groupName, then evaluates expression against the root library. Returns null on any eval failure. Shorthand for the enricher pattern setInspectorSelection → evaluateString.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readDetailsSubtree({required String inspectorId, required String groupName, int subtreeDepth = 5}) → Future<InspectorJson>
Returns the subtree rooted at inspectorId including each node's DiagnosticsProperty values. Used for selective per-node detail reads (input field values, icon codepoints, etc.).
readWidgetTree({required String groupName, bool isSummaryTree = true, bool withPreviews = true, bool fullDetails = false}) → Future<InspectorJson>
Returns the inspector's widget tree as raw DiagnosticsNode JSON. isSummaryTree: true (the default) filters out framework internals; false returns the full element tree.
setInspectorSelection({required String inspectorId, required String groupName}) → Future<void>
Sets WidgetInspectorService.instance.selection to inspectorId so a subsequent evaluate has selection.currentElement available.
setPubRootDirectories(List<String> dirs) → Future<void>
Registers dirs as pub roots so the inspector marks the app's own widgets as local-project and keeps them in the summary tree.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited