0 purchases
device unlock
device_unlock #
A Flutter plugin to request the device unlock screen on Android and iOS.
How does it work #
The following attempts and fallbacks are made:
Is face unlock available? Request and return true if user passed validation or false otherwise.
Is touch unlock available? Request and return true if user passed validation or false otherwise.
Is pin unlock available? Request and return true if user passed validation or false otherwise.
If the device does not have face, touch or pin security, throw an exception and let the dev decide what to do.
Sample code #
import 'package:device_unlock/device_unlock.dart';
try {
if (await DeviceUnlock.request(localizedReason: "We need to check your identity.")) {
// Unlocked successfully.
} else {
// Did not pass face, touch or pin validation.
}
} on RequestInProgress {
// A new request was sent before the first one finishes
} on DeviceUnlockUnavailable {
// Device does not have face, touch or pin security available.
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.