biometricAuthAvailable method

Future<BiometricAvailability> biometricAuthAvailable({
  1. BiometricStrength? biometricStrength,
})

Checks if biometric authentication is available.

biometricStrength is the class of biometric to check for on Android (null means BiometricStrength.strong). Other platforms ignore it. BiometricStrength.weak only applies to simplePrompt; see its docs. It is a named parameter so that existing calls without it still compile.

Implementation

Future<BiometricAvailability> biometricAuthAvailable(
    {BiometricStrength? biometricStrength}) async {
  final String pigeonVar_channelName =
      'dev.flutter.pigeon.biometric_signature.BiometricSignatureApi.biometricAuthAvailable$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel =
      BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final Future<Object?> pigeonVar_sendFuture =
      pigeonVar_channel.send(<Object?>[biometricStrength]);
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_sendFuture as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else if (pigeonVar_replyList[0] == null) {
    throw PlatformException(
      code: 'null-error',
      message: 'Host platform returned null value for non-null return value.',
    );
  } else {
    return (pigeonVar_replyList[0] as BiometricAvailability?)!;
  }
}