biometric_auth_package 0.0.4 copy "biometric_auth_package: ^0.0.4" to clipboard
biometric_auth_package: ^0.0.4 copied to clipboard

Biometric authentication for flutter application.

biometric_auth_package

Features

User can able to authenticate with biometric on android and ios application

Getting started

Local Auth wall redirect user to a widget when authenticated and another if not.

Usage

class _MyHomePageState extends State

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Biometric Authentication Demo'), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children:

            print("authenticated");
            print(authenticated);
            if (authenticated) {
              // User successfully authenticated
            } else {
              // Authentication failed
            }
          },
          child: Text('Authenticate with Biometrics'),
        ),
        SizedBox(height: 20),
        // FutureBuilder<List<BiometricType>>(
        //   future: biometricAuth.getAvailableBiometrics(),
        //   builder: (context, snapshot) {
        //     if (snapshot.connectionState == ConnectionState.waiting) {
        //       return CircularProgressIndicator();
        //     } else if (snapshot.hasData) {
        //       // Display available biometric types
        //       List<BiometricType> availableBiometrics = snapshot.data!;
        //       return Text('Available biometrics: $availableBiometrics');
        //     } else {
        //       return Text('Unable to fetch available biometrics');
        //     }
        //   },
        // ),
      ],
    ),
  ),
);
copied to clipboard

} }

Additional information

In this example we use MaterialApp.builder to encapsulate all app routes bellow our ChangeNotifierProvider, so anytime its possible to call context.read

However, you can use LocalAuthWall in any place, with the limitation that only widgets bellow will be able to call context.read

1
likes
130
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

Biometric authentication for flutter application.

Homepage
Repository (GitHub)

Documentation

API reference

License

BSL-1.0 (license)

Dependencies

flutter, local_auth

More

Packages that depend on biometric_auth_package