๐Ÿ“ฆ Zeba Academy Form Validator

A powerful, lightweight, and reusable form validation package for Flutter with clean architecture and Zeba Academy branding.

Built to simplify validation logic while keeping your codebase clean, scalable, and production-ready.


โœจ Features

โœ” Email, Password, Phone, and Name validators โœ” Clean and reusable validation functions โœ” Custom error messages with Zeba Academy branding โœ” Combine multiple validators easily โœ” Seamless integration with TextFormField โœ” Auto focus on first invalid field โœ” Developer-friendly API โœ” Zero bloat, high performance


๐Ÿš€ Installation

Add this to your pubspec.yaml:

dependencies:
  zeba_academy_form_validator: ^1.0.0

Then run:

flutter pub get

๐Ÿ“– Usage

1๏ธโƒฃ Import Package

import 'package:zeba_academy_form_validator/zeba_academy_form_validator.dart';

2๏ธโƒฃ Basic Validators

TextFormField(
  decoration: InputDecoration(labelText: "Email"),
  validator: ZebaValidators.email,
)

TextFormField(
  decoration: InputDecoration(labelText: "Password"),
  validator: ZebaValidators.password,
)

3๏ธโƒฃ Combine Multiple Validators

validator: ZebaValidatorBuilder.combine([
  ZebaValidators.password,
  (value) =>
      value != null && value.contains("123")
          ? "Zeba Academy: Weak password"
          : null,
])

4๏ธโƒฃ Form Validation with Auto Focus

final _formKey = GlobalKey<FormState>();

final emailFocus = FocusNode();
final passwordFocus = FocusNode();

ElevatedButton(
  onPressed: () {
    final isValid = ZebaFormHelper.validateAndFocus(
      formKey: _formKey,
      focusNodes: [emailFocus, passwordFocus],
    );

    if (isValid) {
      print("Form is valid ๐Ÿš€");
    }
  },
  child: Text("Submit"),
)

๐Ÿง  Available Validators

Validator Description
email Validates email format
password Checks minimum length
phone Validates 10-digit phone number
name Ensures non-empty name

๐ŸŽจ Custom Messages

All validation messages are pre-branded:

Zeba Academy: Enter a valid email
Zeba Academy: Password is required

You can extend or override them easily.


๐Ÿงช Testing

Run tests using:

flutter test

๐Ÿ“‚ Project Structure

lib/
 โ”œโ”€โ”€ zeba_academy_form_validator.dart
 โ””โ”€โ”€ src/
      โ”œโ”€โ”€ validators.dart
      โ”œโ”€โ”€ messages.dart
      โ”œโ”€โ”€ validator_builder.dart
      โ””โ”€โ”€ form_helper.dart

๐Ÿ”ฅ Future Enhancements

  • Confirm password validator
  • Async validation (API-based)
  • Localization support
  • Prebuilt UI components
  • Advanced validation rules

๐Ÿค Contributing

Contributions are welcome!

  1. Fork the repo
  2. Create your feature branch
  3. Commit your changes
  4. Open a Pull Request

๐Ÿ“œ License

This project is licensed under the GPL License.


๐Ÿ‘จโ€๐Ÿ’ป About Me

โœจ Iโ€™m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin


๐ŸŒ Your all-in-one no-bloat hub!

๐Ÿš€ Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! ๐Ÿ’ปโœจ

Zeba Academy is a learning platform dedicated to coding, technology, and development.

โžก Visit our main site: https://zeba.academy โžก Explore courses: https://code.zeba.academy โžก YouTube: https://www.youtube.com/@zeba.academy โžก Instagram: https://www.instagram.com/zeba.academy/


โค๏ธ Support

If you like this package, give it a โญ on GitHub and share it with others!


Thank you for visiting!