getAvailability method
- AuthenticationMethod method = AuthenticationMethod.biometricsOnly,
override
Tells whether the user can authenticate with the given method, and the
reason why when they can not.
A value that is not known is reported as AuthenticationAvailability.notAvailable.
Implementation
@override
Future<AuthenticationAvailability> getAvailability({
AuthenticationMethod method = AuthenticationMethod.biometricsOnly,
}) async {
final name = await methodChannel.invokeMethod<String>('getAvailability', {
'method': method.name,
});
return AuthenticationAvailability.values.firstWhere(
(availability) => availability.name == name,
orElse: () => AuthenticationAvailability.notAvailable,
);
}