Local Auth

Updated 29 April 2023


What is Local Auth?

When a user’s fingerprints, facial patterns, or voice are used to authenticate their identification, this is known as biometric authentication. Almost every phone now includes biometric authentication or Face Id. Instead of inputting a password, we may simply press the fingerprint to authenticate.

For the best user experience, we recommend apps that have fingerprint authentication for Android phones and face ID for iPhones.

Read more about Flutter app development services from mobikul.

How can we achieve this with our flutter application?

local_auth‘ package will help us to implement these features in our flutter application.
Now, let’s move on to the implementation part of this package.

To Implement the lacal_auth in Flutter you have to follow the following steps:

Step-1 Add Local Auth dependency in your pubspec.yaml file

Step-2 Setup for Android

Add permission in your manifest file

Change your MainActivity.kt as below

Here, we have completed the setup for android.
Now, move to the iOS setup

Step-3 Setup for iOS

Note that this plugin works with both Touch ID and Face ID. However, to use the latter, you need to also add:

to your Info.plist file. Failure to do so results in a dialog that tells the user your app has not been updated to use Face ID.

We have completed the setup for Android and iOS, let’s move on to our dart side.

Step-4 Check is device have any authentication

Now, we will manage our application according to the result of the above-mentioned block.

Step-5 We will show the available options if device have any

canCheckBiometrics() ==> To check whether there is local authentication available on this device or not

From this step, you get the available options of authentication on your device.

Step-5 Finally, we are ready to authenticate

Here, we have done our work.

You can check the complete code below

As a result, you will get the demo working application of authentication.

Hopefully, this blog will be helpful to you to understand the Carousel Slider. If you have any queries, please write them in the comment section.

Happy Coding!!

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.

Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home