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:
restartinsidemetro live, and the developer's own hot restart outside it, whereflutter runand 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 livesession whose open connections commands run on.getter/setter pair
Methods
-
commandName(
String name) → String -
How to run the live command
namefrom where this runner is used:nameinsidemetro live, otherwisemetro 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
readfinds 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
actionon every target app in parallel, then prints each app's output (or the--jsondocument) and returns the exit code:0when every app succeeded,1when any failed. -
runActionName(
String name) → String -
How to run the
live:runactionnamefrom where this runner is used:nameinsidemetro live, otherwisemetro 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.