import 'package:local_auth/local_auth.dart';

class BiometricHelper {
  static final LocalAuthentication auth = LocalAuthentication();

  static Future<bool> checkBiometrics() async {
    try {
      return await auth.canCheckBiometrics;
    } catch (e) {
      // Log or handle the error
      return false;
    }
  }

  static Future<bool> authenticateBiometric() async {
    try {
      return await auth.authenticate(
        localizedReason: 'Scan your fingerprint to authenticate',
        options: const AuthenticationOptions(
          biometricOnly: true,
          stickyAuth: true,
          useErrorDialogs: true,
          sensitiveTransaction: true,
        ),
      );
    } catch (e) {
      // Log or handle the error
      return false;
    }
  }
}
