runtime library
Module — runtime. Transport abstraction over the running Flutter
app's VM service. Every glint primitive that talks to the live app
goes through FlutterRuntime; no other code reaches the raw
ext.flutter.inspector.* RPCs or evaluate calls directly.
Classes
- AppAgent
- glint's helper inside the app, installed once per isolate by one eval: input, settle and lifecycle each become one service-extension call with nothing to compile.
- FlutterRuntime
- PendingWork
-
Work the app has queued as the action landed that may still change the screen: one-shot timers (
Future.delayedincluded) and HTTP requests in flight. - VmServiceRuntime
-
The default FlutterRuntime backed by
package:vm_service. Owns one VmClient and centralises everyext.flutter.inspector.*andevaluatecall site.
Enums
- InspectorGroupKind
- Inspector object-group identity used by glint. Read groups are disposed when the scene is freed; resolve groups outlive the read that produced them.
Constants
- kAgentErrorEvent → const String
-
Errors the agent's chained
FlutterError.onErrorandPlatformDispatcher.onErrorpost on the Extension stream. - kAgentExtension → const String
- The service extension the agent registers; the version suffix makes a newer glint install its own beside an older one.
- kAgentLifecycleEvent → const String
- Lifecycle changes the agent posts on the Extension stream.
Functions
-
evalLibraryCandidates(
{required List< LibraryRef> libraries, required LibraryRef? rootLib}) → List<String> - Eval library ids in preference order: Flutter framework libraries, then the root library, then the rest of the app's package.
Typedefs
-
InspectorJson
= Map<
String, Object?> -
One opaque inspector subtree (the JSON returned by Flutter's
getRootWidgetTree/getDetailsSubtree). Glint's perception layer parses this into SceneNodes; the runtime stops at the JSON.
Exceptions / Errors
- RuntimeConnectionLostError
- Thrown when the VM service WebSocket connection drops — typically because the app performed a hot restart or was terminated. Tools catch this and return GlintErrorKind.connectionLost so the agent knows to re-attach.
- RuntimeEvalError
- Thrown when FlutterRuntime.evaluate either fails to compile or returns an ErrorRef. Carries the original error detail.
- RuntimeStaleInspectorIdError
- Thrown when the inspector no longer knows an object id it was given: the group was disposed or the widget rebuilt since the id was handed out.
- RuntimeUnresponsiveError
- Thrown when a VM service call gets no answer within the runtime's deadline: the isolate is not running Dart code (device locked, app suspended, or paused at a breakpoint).