LiveSession class

The running apps metro live is connected to, kept open between commands.

The session remembers which app commands run on, follows each app's current page for the prompt, notices hot restarts and disconnects, and reconnects when an app starts again.

Constructors

LiveSession(LiveRunner runner, {Duration timeout = LiveOptions.defaultTimeout, Duration pollInterval = const Duration(seconds: 2), Uri? uri})
Creates a session that finds apps with runner.

Properties

all → bool
Whether commands run on every connected app.
no setter
apps → List<LiveApp>
The connected apps, in discovery order.
no setter
busy ↔ bool
Set while a command runs, so restarts it causes aren't announced.
getter/setter pair
current → LiveApp?
The app commands run on: the one picked with use, or the only connected app. Null when commands run on every app or none is picked.
no setter
hashCode → int
The hash code for this object.
no setterinherited
missingDevice → String?
The device picked with use that isn't connected, if any.
no setter
onChange ↔ void Function()?
Called when what the prompt shows has changed.
getter/setter pair
onNotice ↔ void Function(String message)?
Receives a line to show when something happens in the background.
getter/setter pair
pollInterval → Duration
How often the session looks for apps while none is connected.
final
runner → LiveRunner
Finds the project's apps.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration
How long discovery waits for each app.
final
uri → Uri?
A VM service address to connect to instead of finding apps.
final

Methods

close() → Future<void>
Stops watching and closes every connection.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() → Future<List<LiveSkippedApp>>
Finds running apps and connects to new ones, keeping the connections to apps that are still running. Returns the apps discovery had to skip.
resolve(LiveOptions options, LivePrinter output) → Future<({int exitCode, List<LiveApp> targets})>
The apps a command runs on, printing to output why when there are none. Per-command -d and --all in options win over use.
toString() → String
A string representation of this object.
inherited
use(String query) → Future<({List<LiveApp> candidates, String error})?>
Picks the app commands run on: a number from devices, a device name, all for every app, or auto to use the only running app.

Operators

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