biometricAuthenticate method

Future<bool> biometricAuthenticate({
  1. required String reason,
  2. required bool allowDeviceCredential,
  3. String? cancelLabel,
})

Returns true on success and false when the user cancelled. Throws a PlatformException for every other failure.

Implementation

Future<bool> biometricAuthenticate({
  required String reason,
  required bool allowDeviceCredential,
  String? cancelLabel,
}) async {
  final result = await _channel.invokeMethod<bool>('biometric#authenticate', {
    'reason': reason,
    'allowDeviceCredential': allowDeviceCredential,
    if (cancelLabel != null) 'cancelLabel': cancelLabel,
  });
  return result ?? false;
}