static Future<void> halt(bool close) async { if (_isConnected() && close) { try { await (_activeDevice!.callMethod("close".toJS) as JSPromise).toDart; } catch (_) {} _activeDevice = null; } }