finish static method
Finish this session, also end WebUSB session if explicitly asked by user.
Implementation
static Future<void> finish(bool closeWebUSB) async {
if (_deviceAvailable()) {
if (closeWebUSB) {
try {
await promiseToFuture(callMethod(_device, "close", List.empty()));
} on Exception catch (e) {
log.severe("Finish error: ", e);
throw PlatformException(
code: "500", message: "WebUSB API error", details: e);
}
_device = null;
}
}
}