flutter_smart_validator 0.1.1
flutter_smart_validator: ^0.1.1 copied to clipboard
A clean, chainable, and developer-friendly form validation package for Flutter. Build complex validation rules with minimal boilerplate using a fluent API.
0.1.1 - 2026-05-05 #
📝 Documentation #
- Updated
README.mdwith comprehensive examples and detailed rule descriptions. - Added author details and professional profile picture.
- Enhanced
SmartFormFielddocumentation.
0.1.0 - 2026-04-21 #
✨ New Features #
- New Validation Rules: Added
RegexRule,UrlRule,CreditCardRule(Luhn), andPhoneRule. - Fluent API: Added chainable methods for all new rules (
.regex(),.url(),.creditCard(),.phone()). - Standardized Placeholders: All length-based rules now use
{min}and{max}placeholders for flexible custom messages. - Enhanced
SmartFormField:- Added support for
prefixIconandsuffixIcon. - Added
AnimatedSwitcherfor smooth error and hint transitions.
- Added support for
🐞 Bug Fixes #
- Fixed a logical error in multi-rule validation tests.
- Fixed an inconsistency in
MatchFieldRuleplaceholder logic. - Resolved
prefer_const_constructorslinting issues inPasswordStrengthutility.
0.0.1 - 2026-01-28 #
🎉 Initial Release #
A clean, chainable, and developer-friendly form validation package for Flutter.
✨ Features Added
Core Validation
- Fluent, chainable API for building validators (
SmartValidator().required().email().build()) - Context-aware validation support for field matching
- Validate single error or all errors at once
- Works with
TextFormFieldand standalone controllers
Built-in Validation Rules
required()- Field cannot be empty or whitespaceemail()- Valid email format validationminLength(int)- Minimum character lengthmaxLength(int)- Maximum character lengthnumber(min, max, allowDecimals)- Numeric validation with range supportuppercase(minCount)- Requires uppercase letterslowercase(minCount)- Requires lowercase lettersmatchField(key, name)- Field matching (password confirmation)custom(validator)- Custom validation function support
Async Validation
AsyncValidatorclass for API-based validation- Built-in debouncing to prevent excessive API calls
- Synchronous pre-validation before async calls
- Username/email availability checking support
User Experience
- Live validation hints with
getLiveHints() - Progressive feedback as users type
- Password strength calculation and utilities
- Clear, customizable error messages
Optional UI Widgets
ValidationErrorText- Styled error message displayValidationHintsList- Live validation hints with iconsPasswordStrengthIndicator- Visual password strength meterSmartFormField- Complete form field with built-in validation UI
Developer Experience
- Zero external dependencies (Flutter SDK only)
- Comprehensive documentation and examples
- 5 complete example demos included
- Full unit test coverage
- Type-safe API with null safety
📚 Documentation
- Complete README with installation and usage guides
- API documentation for all public methods
- Code examples for every feature
- Example app demonstrating all capabilities
🎨 Example App Demos
- Basic login form with email and password validation
- Advanced registration with live hints and password strength
- Custom validation rules (username format, age range)
- Async validation (username availability check)
- Controller-based programmatic validation
🏗️ Package Structure
lib/
├── flutter_smart_validator.dart # Main export file
└── src/
├── smart_validator.dart # Core validator class
├── async/
│ └── async_validator.dart # Async validation support
├── models/
│ ├── validation_result.dart # Validation result model
│ └── validation_rule.dart # Base validation rule
├── rules/ # Built-in validation rules
├── utils/
│ └── password_strength.dart # Password utilities
└── widgets/ # Optional UI components
📱 Platform Support
- ✅ Android
- ✅ iOS
- ✅ Web
- ✅ Windows
- ✅ macOS
- ✅ Linux
🔧 Requirements
- Dart SDK: >=3.0.0 <4.0.0
- Flutter: >=3.0.0
Future Roadmap #
Planned features for upcoming releases:
- Phone number validation rules
- Credit card validation
- URL validation
- RegExp pattern validation helpers
- Conditional validation (validate if...)
- Multi-field validation groups
- Internationalization (i18n) support for error messages