checkStatus static method

Future<NfcSupport> checkStatus()

Implementation

static Future<NfcSupport> checkStatus() async {
  if (_bridge != null) return NfcSupport.available;
  try {
    final s = await NfcNativeDriver.getSystemStatus();
    if (s == 'available') return NfcSupport.available;
    if (s == 'disabled') return NfcSupport.disabled;
    return NfcSupport.unsupported;
  } catch (_) {
    return NfcSupport.unsupported;
  }
}