LiveRunner class

Finds the target apps for a live command and runs it on them.

Constructors

LiveRunner({LivePrinter? output, LiveProject? project, LiveDiscoveryFactory? discovery, LiveSession? session})
Creates a LiveRunner.

Properties

hashCode → int
The hash code for this object.
no setterinherited
output → LivePrinter
Where output is printed.
final
project → LiveProject
The project Metro is running in.
no setter
restartCommand → String
How the app gets hot restarted from where this runner is used: restart inside metro live, and the developer's own hot restart outside it, where flutter run and the IDE both offer one.
no setter
root → String
The project directory, or the current one outside a Flutter project.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
session ↔ LiveSession?
The metro live session whose open connections commands run on.
getter/setter pair

Methods

commandName(String name) → String
How to run the live command name from where this runner is used: name inside metro live, otherwise metro live:name.
discover(LiveOptions options) → Future<LiveDiscoveryResult>
Discovers this project's running apps.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printSkipped(List<LiveSkippedApp> skipped) → void
Prints the apps discovery had to skip.
registered(List<String> read({String projectRoot})) → List<String>
The names read finds in the project's registry (e.g. registeredLiveCommands), or none when Metro isn't running in a Flutter project.
resolveTargets(LiveOptions options) → Future<({int exitCode, List<LiveApp> targets})>
Resolves the apps a command runs on, printing why when there are none.
run(LiveOptions options, Future<Object?> action(LiveApp app, LiveBlock block)) → Future<int>
Runs action on every target app in parallel, then prints each app's output (or the --json document) and returns the exit code: 0 when every app succeeded, 1 when any failed.
runActionName(String name) → String
How to run the live:run action name from where this runner is used: name inside metro live, otherwise metro live:run name.
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

commandTimeout → const Duration
How long an app gets to run a command before Metro gives up.