createPlatformInstance function

LedgerUsbPlatform createPlatformInstance()

Prefers WebHID (reliable on Windows, where WebUSB often cannot claim the Ledger interface) and falls back to WebUSB when navigator.hid is missing.

Implementation

LedgerUsbPlatform createPlatformInstance() {
  final webHid = hid;
  return webHid != null ? WebHidLedgerUsb(webHid) : WebLedgerUsb();
}