ge_validator 0.0.3
ge_validator: ^0.0.3 copied to clipboard
A Flutter plugin for validating form inputs, including email, phone numbers, passwords, and custom patterns.
Flutter Validation Package #
flutter_validation_package is a simple and lightweight Flutter package for form validation. It provides commonly used validation methods to ensure your forms are user-friendly and secure.
Features #
- Required Field Validation: Ensure a field is not empty.
- Email Validation: Validate email addresses against a standard format.
- Phone Number Validation: Validate international phone numbers.
- Password Strength Validation: Enforce password strength rules (length, uppercase, digits).
- Custom Pattern Validation: Validate input using custom regular expressions.
Validators Available #
Validator.validateEmail Validator.validatePassword Validator.validatePhone Validator.validateRequired Validator.validateCustom(r'^[a-zA-Z0-9]+$', 'Only alphanumeric characters are allowed.')
Example for Using Custom Validator #
TextFormField( decoration: InputDecoration( hintText: 'Enter Custom Data', border: OutlineInputBorder(), ), validator: Validator.validateCustom(r'^[a-zA-Z0-9]+$', 'Only alphanumeric characters are allowed.'), )
Installation #
Add the following to your pubspec.yaml:
dependencies:
ge_validator: ^0.0.3