call method
Sends the live command (e.g. route.push) with args to the app.
Returns the command's result payload. When the isolate has changed since connecting (a hot restart), it's found again and the call retried once.
Implementation
Future<Object?> call(
String command, [
Map<String, Object?>? args,
Duration? timeout,
]) async {
try {
return await _callOnce(command, args, timeout);
} on JsonRpcException catch (e) {
if (!_mayBeStaleIsolate(e)) rethrow;
final String? fresh = await findNyloIsolate(
client,
timeout: client.timeout,
).catchError((Object _) => null);
if (fresh == null || fresh == isolateId) rethrow;
isolateId = fresh;
return await _callOnce(command, args, timeout);
}
}