flutter – passcode lock screen
a flutter package for ios and android for showing passcode input screen, similar to native ios.
installation
first add passcode_screen
as a dependency in your pubspec.yaml file.
then use import
import 'package:passcode_screen/passcode_screen.dart';
what can it do for you?
- create a beautiful passcode lock view simply.
passcodescreen(
title: title,
passwordenteredcallback: _onpasscodeentered,
cancellocalizedtext: 'cancel',
deletelocalizedtext: 'delete',
shouldtriggerverification: _verificationnotifier.stream,
);
- 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;
}
ios & android
plugin is totally platform agnostic. no configuration required – the plugin should work out of the box.
Comments are closed.