authenticate method Null safety

Future<bool> authenticate()

Authenticates the user.

Returns a Future<bool>.

Implementation

static Future<bool> authenticate() async {
  try {
    if (!await _canAuthenticate()) return false;
    return await _auth.authenticate(
      localizedReason: "Use Face Id to authenticate",
      options: const AuthenticationOptions(
        useErrorDialogs: true,
        stickyAuth: true,
      )
    );
  } catch (e){
    return false;
  }
}