The Auto Validate package streamlines input validation by leveraging customizable regular expressions, allowing for efficient verification of various data formats.
Package selection guidance compiled from public package information, community data, and project usage.
Auto Validate is a Flutter package that simplifies input validation using customizable regular expressions. It enables developers to efficiently verify data formats such as emails, phone numbers, and custom patterns with minimal code. The package integrates seamlessly into forms, providing real-time feedback and reducing boilerplate validation logic. Designed for cross-platform use, it supports Android, iOS, Web, macOS, Windows, and Linux, making it ideal for consistent validation across diverse environments.
Use cases
Form input validation
Real-time user feedback
Email and phone number validation
Custom pattern matching
Cross-platform apps
Reducing validation boilerplate
Key features
Customizable regex patterns
Real-time validation
Cross-platform support
Minimal setup
Integration with TextFormField
Flexible error handling
Suitable for
Developers building forms
Apps requiring strict input validation
Teams prioritizing code simplicity
Projects targeting multiple platforms
Frontend-focused Flutter applications
Considerations
Requires understanding of regex syntax
May need additional styling for error messages
Not suitable for complex business logic validation
Limited built-in validators beyond regex
Depends on proper regex design for accuracy
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Auto Validate
The Auto Validate Package is a unique and easy-to-use solution for automatic validation of various data types using regular expressions.
Importance
This package streamlines the validation process, allowing you to easily implement validation without needing to write the code yourself. By using this package, you can save valuable time and ensure that your input data meets the required criteria.
Usage
Here's a simple example of how to use the Auto Validate package:
String Validation Extension [New Feature]
This package provides an extension on String? that offers convenient methods for validating various input formats using the AutoValidate class. It allows for a more readable and fluent validation process in your Dart applications.
Features
Validate usernames, passwords, email addresses, phone numbers, credit card numbers, and more.
Check for valid formats like ISBN, MAC addresses, hexadecimal codes, and JSON Web Tokens (JWT).
Simplify validation checks by using fluent methods directly on String? instances.
Improve code readability and maintainability by using the extension methods for validation.
import'package:auto_validate/auto_validate.dart';
voidvalidation() {
var email = 'Dev.M.ElShenawy@Icloud.com';
var name = 'Mahmud El Shenawy';
var password = '@MahmoudElShenawy2021';
var phone = '+201098415860';
// You can validate the input using the AutoValidate classAutoValidate.email(email.toString())
? print('Email is Valid')
: print('Email is Invalid');
AutoValidate.userName(name.toString())
? print('User Name is Valid')
: print('User Name is Invalid');
AutoValidate.password(password.toString())
? print('Password is Valid')
: print('Password is Invalid');
AutoValidate.phone(phone.toString())
? print('Phone is Valid')
: print('Phone is Invalid');
// You can also use the extension methods to validate the input
email.isValidEmail
? print('Email is Valid')
: print('Email is Invalid');
name.isValidUsername
? print('User Name is Valid')
: print('User Name is Invalid');
password.isValidPassword
? print('Password is Valid')
: print('Password is Invalid');
phone.isValidPhone
? print('Phone is Valid')
: print('Phone is Invalid');
}