LiveApp class

A running Nylo app that metro live:* can send commands to.

Constructors

LiveApp({required String device, required String package, required Uri uri, required JsonRpcClient client, required String isolateId, required Map<String, Object?> status, String? workspaceRoot, String? ideName})
Creates a LiveApp connected through client.

Properties

client → JsonRpcClient
The JSON-RPC connection to the app's VM service.
final
device → String
The device name reported by the Dart Tooling Daemon, e.g. iPhone 17e.
final
hashCode → int
The hash code for this object.
no setterinherited
ideName → String?
The IDE hosting the daemon that listed this app, if any.
final
isolateId ↔ String
The isolate that registered the ext.nylo.* extensions.
getter/setter pair
package → String
The app's pubspec package name.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status ↔ Map<String, Object?>
The latest ext.nylo.status payload.
getter/setter pair
uri → Uri
The VM service WebSocket URI.
final
workspaceRoot → String?
The workspace root of the daemon that listed this app, if any.
final

Methods

call(String command, [Map<String, Object?>? args, Duration? timeout]) → Future<Object?>
Sends the live command (e.g. route.push) with args to the app.
close() → Future<void>
Closes the connection to the app.
events() → Stream<LiveEvent>
Streams the events this app posts to the nylo VM service stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload({Duration timeout = const Duration(seconds: 60)}) → Future<Duration>
Hot reloads the app through the Flutter tool that launched it.
restart({Duration timeout = const Duration(seconds: 60)}) → Future<Duration>
Hot restarts the app through the Flutter tool that launched it, then finds the new Nylo isolate.
toolServiceMethod(String service, {Duration timeout = const Duration(seconds: 2)}) → Future<String?>
Finds the method the attached Flutter tool registered for service (reloadSources or hotRestart), e.g. s1.reloadSources.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

connect(Uri uri, {required String device, required String package, Duration timeout = const Duration(seconds: 3), String? workspaceRoot, String? ideName, String? projectRoot, bool trusted = false}) → Future<LiveApp>
Connects to the VM service at uri and finds the Nylo isolate.
findNyloIsolate(JsonRpcClient client, {Duration? timeout}) → Future<String?>
Returns the id of the isolate exposing ext.nylo.status, or null.
isInside(String path, String root) → bool
Whether path is root or inside it, after resolving symlinks such as macOS /tmp → /private/tmp.
parseStreamEvent(JsonRpcNotification notification, String streamId) → LiveEvent?
Parses a VM service streamNotify notification for streamId.
resolveEntrypoint(JsonRpcClient client, String isolateId, String? rootLib, {Duration? timeout}) → Future<String?>
Resolves the app's root library (e.g. package:shop/main.dart) to the file it was compiled from, or null when the VM service can't say.

Constants

statusExtension → const String
The extension every Nylo app registers; used to find the right isolate.