- Create a beautiful passcode lock view simply.
PasscodeScreen(
title: title,
passwordEnteredCallback: _onPasscodeEntered,
cancelButton: Text('Cancel'),
deleteButton: Text('Delete'),
shouldTriggerVerification: _verificationNotifier.stream,
passwordDigits: 6,
);- Passcode input completed callback.
_onPasscodeEntered(String enteredPasscode) {
}- Notify passcode screen if passcode correct or not
final StreamController<bool> _verificationNotifier = StreamController<bool>.broadcast();
_onPasscodeEntered(String enteredPasscode) {
bool isValid = '123456' == enteredPassword;
_verificationNotifier.add(isValid);
}
Don't forget to close a stream
@override
void dispose() {
_verificationNotifier.close();
super.dispose();
}
- Customize UI.
Customize circles
class CircleUIConfig {
final Color borderColor;
final Color fillColor;
final double borderWidth;
final double circleSize;
double extraSize;
}Customize keyboard
class KeyboardUIConfig {
final double digitSize;
final TextStyle digitTextStyle;
final TextStyle deleteButtonTextStyle;
final Color primaryColor;
final Color digitFillColor;
final EdgeInsetsGeometry keyboardRowMargin;
final EdgeInsetsGeometry deleteButtonMargin;
}Basic implementation of a widget.
- You could show a widget, enter passcode and validate it.
- Added
isValidCallbackto help you handle success scenario.isValidCallbackwill be invoked after passcode screen will pop.
- Added configurable background and title color.
- Added
cancelCallbackto react when user cancelled widget
- Provide widget instead of string for title
- Fixed digits layout
- Added flexibility to configure 'Cancel' and 'Delete' buttons as widgets
- Added flexibility to provide digits as list of strings for better customisation
- Removed navigation as default action when cancel pressed
- Add landscape view for the passcode screen
- Add dynamic size for landscape view.
- Moved 'Cancel' button to the bottom of the screen to align with iOS Native Passcode Screen style.
- Example updated to target Android 11
- Fixed Issue#23
- Fixed an issue with example build
- Example updated to show how to implement 'Reset passcode' feature


