VmClient class

Watches vmServiceOutFile for the websocket address flutter run --vmservice-out-file=PATH writes there, connects, and forwards every beacon.* extension event to onSelectedbeacon.selected for a single tap, beacon.selectedMany for a broadcast selection stack (PLAN.md §6). The event kind itself is passed through so the caller decides what to do with each; new kinds don't need a change here.

The file's content is the raw ws://... address as a plain string, not JSON (confirmed against flutter_tools' writeVmServiceFile) — no parsing needed beyond reading and trimming it.

Reconnects automatically: the file changes on every flutter run (a new port each time), and the URI stops working across a hot restart or an app relaunch even when the file doesn't change (PLAN.md §4.4).

Constructors

VmClient({required File vmServiceOutFile, required BeaconEventHandler onSelected, StatusHandler? onStatus})

Properties

hashCode int
The hash code for this object.
no setterinherited
onSelected BeaconEventHandler
final
onStatus StatusHandler?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vmServiceOutFile File
final

Methods

debugTryConnectFromFile() Future<void>
Exercises the same path a FileSystemEvent triggers. Exposed only so tests can fire off several overlapping attempts without needing the platform to actually deliver duplicate filesystem events for one write (it does, in practice, which is what this guards against).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Future<void>
stop() Future<void>
toString() String
A string representation of this object.
inherited

Operators

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

Constants

hintAfter → const Duration
How long to wait before assuming the app is never going to write the file, and explaining why that usually happens.