A Flutter package that provides beautiful and customizable form validation widgets with built-in validation rules. This package simplifies form validation in Flutter applications by providing pre-built validators and a customizable text field widget.
✨ Beautiful Form Fields
- Pre-styled text fields with modern design
- Customizable appearance
- Floating labels
- Error message styling
🔍 Built-in Validators
- Required field validation
- Email validation
- Phone number validation
- Password complexity validation
- Minimum length validation
- Combinable validators
🎨 Customization
- Custom error messages
- Custom validation rules
- Flexible styling options
Add this to your package's pubspec.yaml file:
dependencies:
validation_package: ^0.0.1Then run:
flutter pub getimport 'package:validation_package/validation_package.dart';
// Simple required field
ValidatedTextField(
label: 'Username',
controller: _usernameController,
validator: Validators.required(),
);
// Email validation
ValidatedTextField(
label: 'Email',
controller: _emailController,
validator: Validators.email(),
);
// Password with multiple validations
ValidatedTextField(
label: 'Password',
controller: _passwordController,
obscureText: true,
validator: Validators.combine([
Validators.required(),
Validators.minLength(6),
Validators.passwordComplexity(),
]),
);Validators.required(message: 'Custom error message')Validators.email(message: 'Please enter a valid email')Validators.minLength(8, message: 'Must be at least 8 characters')Validators.phone(message: 'Enter a valid phone number')Validators.passwordComplexity(
message: 'Password must contain both letters and numbers'
)Validators.combine([
Validators.required(),
Validators.minLength(6),
Validators.passwordComplexity(),
])ValidatedTextField(
label: 'Custom Field',
controller: _controller,
validator: Validators.required(),
obscureText: false, // For password fields
);We welcome contributions! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.


