validator_kit 0.0.1 copy "validator_kit: ^0.0.1" to clipboard
validator_kit: ^0.0.1 copied to clipboard

A lightweight, reusable, and extensible Flutter form validation package.

[Validator Kit Banner]

Validator Kit

A lightweight, reusable, customizable and null-safe Flutter form validation package.

pub package License: MIT Flutter


[assets/logo.png]

✨ Features #

  • ✅ Required Validator
  • ✅ Email Validator
  • ✅ Phone Validator
  • ✅ URL Validator
  • ✅ Username Validator
  • ✅ Password Validator
  • ✅ Confirm Password Validator
  • ✅ Number Validator
  • ✅ Pattern Validator
  • ✅ Minimum Length Validator
  • ✅ Maximum Length Validator
  • ✅ Combine Multiple Validators
  • ✅ Custom Error Messages
  • ✅ Fully Null-safe
  • ✅ Lightweight & Fast
  • ✅ Easy to Use
  • ✅ Reusable Across Projects

📱 Preview #

[assets/preview.png]


🎬 Demo #

[Validator Kit Demo]

---

📦 Installation #

Add the package to your pubspec.yaml

dependencies:
  validator_kit: ^0.0.1

Then run

flutter pub get

🚀 Import #

import 'package:validator_kit/validator_kit.dart';

⚡ Quick Start #

TextFormField(
  validator: ValidatorKit.combine([
    ValidatorKit.required(),
    ValidatorKit.email(),
  ]),
)

📚 Available Validators #

Required #

ValidatorKit.required()

Email #

ValidatorKit.email()

Phone #

ValidatorKit.phone()

URL #

ValidatorKit.url()

Username #

ValidatorKit.username()

Password #

ValidatorKit.password()

Confirm Password #

ValidatorKit.confirmPassword(
  () => passwordController.text,
)

Number #

ValidatorKit.number()

Pattern #

ValidatorKit.pattern(
  RegExp(r'^[A-Z]{3}[0-9]{4}$'),
  message: 'Invalid Employee ID',
)

Minimum Length #

ValidatorKit.minLength(8)

Maximum Length #

ValidatorKit.maxLength(30)

Combine Validators #

validator: ValidatorKit.combine([
  ValidatorKit.required(),
  ValidatorKit.email(),
  ValidatorKit.minLength(8),
])

Disable Validation #

If you want to disable validation conditionally:

ValidatorKit.none()

Example

validator: isGuest
    ? ValidatorKit.none()
    : ValidatorKit.required(),

Custom Error Message #

ValidatorKit.email(
  message: 'Please enter a valid email.',
)

💻 Complete Example #

TextFormField(
  decoration: const InputDecoration(
    labelText: 'Email',
  ),
  validator: ValidatorKit.combine([
    ValidatorKit.required(),
    ValidatorKit.email(),
    ValidatorKit.minLength(8),
  ]),
)

❤️ Why Validator Kit? #

  • Clean API
  • Highly reusable
  • Easy to combine validators
  • Supports custom error messages
  • Null-safe
  • Lightweight
  • Production ready
  • Perfect for Flutter Forms

🛣️ Roadmap #

Upcoming features

  • 🌍 Localization Support
  • 📅 Date Validator
  • 💳 Credit Card Validator
  • 🌐 IPv4 & IPv6 Validator
  • 🆔 IBAN Validator
  • 🏳 Country-specific Phone Validation
  • ⏳ Async Validators
  • 🔥 Custom Validator Builder
  • 📝 File Validator
  • 📦 OTP Validator

🤝 Contributing #

Contributions are welcome!

If you'd like to improve Validator Kit, feel free to open an issue or submit a pull request.


⭐ Support #

If you like this package, please give it a ⭐ on GitHub.

It helps the project grow and motivates future improvements.


🤝 Connect with Me #

If this package helps you, feel free to connect.


📄 License #

This project is licensed under the MIT License.

4
likes
0
points
197
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight, reusable, and extensible Flutter form validation package.

Repository (GitHub)
View/report issues

Topics

#validation #flutter #form #validator

License

unknown (license)

Dependencies

flutter

More

Packages that depend on validator_kit