A new Flutter package which helps developers to get input of password in best UI.
The source code is 100% Dart, and everything resides in the /lib folder.
Without Input | With Input |
---|---|
In the dependencies:
section of your pubspec.yaml
, add the following line:
password_input: <latest_version>
import 'package:password_input/password_input.dart';
class MyWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Center(
//Use this child anywhere in your app
child: PasswordInputTextField(
passwordLength: 6,
keyboardType: TextInputType.text,
autoFocus: true,
inputFormatter: [
FilteringTextInputFormatter.allow(RegExp(r'[a-zA-Z0-9_@.]'
r''))
],
textInputAction: TextInputAction.done,
onSubmit: (password) {
if (password == null || password.isEmpty || password.length > 6)
setState(() {
_errorMessage = "Enter Password";
});
},
),
);
}
}
Shekhar Aggarwal
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Code and documentation Copyright 2021 Shekhar Aggarwal. Code released under the Apache License.
For help getting started with Flutter, view our online documentation.
For help on editing package code, view the documentation.