https://github.com/rubone/password_field_validator
Password Field Validator help you to validate a passwords with your rules.
https://github.com/rubone/password_field_validator
dart flutter flutter-example flutter-packge flutter-widget
Last synced: 22 days ago
JSON representation
Password Field Validator help you to validate a passwords with your rules.
- Host: GitHub
- URL: https://github.com/rubone/password_field_validator
- Owner: rubone
- License: mit
- Created: 2022-08-15T04:02:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-19T22:05:11.000Z (10 months ago)
- Last Synced: 2025-05-19T23:23:37.706Z (10 months ago)
- Topics: dart, flutter, flutter-example, flutter-packge, flutter-widget
- Language: Dart
- Homepage: http://rubensaavedra.net
- Size: 140 KB
- Stars: 19
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Password Field Validator
[](https://github.com/rubone/password_field_validator/blob/master/LICENSE)



Password Field Validator help you to validate a passwords with your rules.
## Validations
- `Minimum length`
- `Uppercase count`
- `Lowercase count`
- `Numeric characters`
- `Special characters`


## Getting started
### 1. Add it to your package's pubspec.yaml file
```yml
dependencies:
password_field_validator: 0.0.1
```
### 2. Install packages
```sh
flutter pub get
```
### 3. Import package
```dart
import 'package:password_field_validator/password_field_validator.dart';
```
## Usage
Now just add it after your TextField and pass the controller
```dart
class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
final TextEditingController passwordTextController = TextEditingController();
@override
State createState() => _MyHomePageState();
}
class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Container(
padding: const EdgeInsets.all(25),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Enter your password',
),
TextField(
controller: widget.passwordTextController,
obscureText: true,
),
Padding(
padding: const EdgeInsets.all(15),
child: PasswordFieldValidator(
minLength: 8,
uppercaseCharCount: 2,
lowercaseCharCount: 1,
numericCharCount: 3,
specialCharCount: 2,
defaultColor: Colors.black,
successColor: Colors.green,
failureColor: Colors.red,
controller: widget.passwordTextController,
),
),
],
),
),
),
);
}
}
```
## Example
You can find a simple example [here](https://github.com/rubone/password_field_validator/tree/main/example)