import 'package:flutter/services.dart'; import 'package:flutter_local_authentication/flutter_local_authentication.dart'; class BiometricAuth { final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication(); Future isAuthenticated() async { try { final authenticated = await _flutterLocalAuthenticationPlugin.authenticate(); return authenticated; } catch (e) { print(e); } return false; } Future canCheckBiometrics() async { bool canAuthenticate; try { canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate(); } catch (error) { print("Exception checking support. $error"); canAuthenticate = false; } return canAuthenticate; } }