Search code examples
flutterdartauthenticationhybrid-mobile-appappsettings

Is it possible to check if user enable or disable biometric for each flutter app


List<BiometricType> availableBiometrics = await localAuthen.getAvailableBiometrics();
if (availableBiometrics.contains(BiometricType.face)) {
} else if (availableBiometrics.contains(BiometricType.fingerprint)) {
} else if (availableBiometrics.contains("weak") ||
availableBiometrics.contains("strong")) {
} else {
AppSettings.openAppSettings();
}

I want to know if it is possible to check user's turn-on biometrics or off


Solution

  • You can check enable or disable biometric for each flutter app using this below function:

    final auth = LocalAuthentication();
        checkBioMetricAuth() async {
          bool canCheckBiometrics = await auth.canCheckBiometrics;
          print(canCheckBiometrics);
        }
    

    I hope it's help you.. Happy Coding :}