A simple and easy to use flutter package to add a passwordfield to your Flutter project.
- Add the dependency
flutter pub add passwordfield
- Import the package
- Voila! use the Widget
Now Supports adding constraints on the Password
bool autoFocus: if autofocus is true keyboard pops up as soon as the widget is rendered on screen defaults to false
Color backgroundColor Background Color for the textfield (defaults to white), By default the backgroundColor is based on the current Theme.
PasswordBorder border: Border class for the passwordfield which provides borders for different states of the passwordfield e.g
TextEditingController controller: A controller for an editable passwordfield.
int errorMaxLines: Defaults to null, which means that the
errorText will be limited to a single line with TextOverflow.ellipsis
String errorMessage: custom message to show if the input password does not match the pattern.
String floatingText: floatingText to show when floatingPlaceholder is true
hasFloatingPlaceholder: whether the placeholder can float to left top on focus, defaults to false
final String hintText: default text to show on the passwordfield when it is empty
PasswordDecoration inputDecoration: Decoration class for the PasswordField to customize the input styling
int maxLength: the max number of characters the password field can support
Function onSubmit: function triggerred when the submit button on keyboard is pressed
Function onChanged: function triggerred when the password is changed in the passwordfield
String passwordConstraint: supports adding constraints to the Passwordfield by adding a regex pattern
You are welcome to contribute to this package, to contribute please read the contributing guidelines.