riverpod_form_binder
A reactive form binding, state management, and debounced validation engine for Riverpod 2.0 in Flutter applications.
๐ Key Features
- โก Riverpod 2.0 Integration: Built natively for
StateNotifier/Notifierproviders. - ๐ฏ Declarative Chainable Validation: Fluent API for
required,email,minLength, regex patterns, and custom sync rules. - โณ Debounced Async Validation: Auto-debounces asynchronous server validation (e.g. username availability check).
- ๐ Field Lifecycle Tracking: Tracks
isDirty,isTouched,isValidating,error, andvalueper field. - ๐งช Testable: Pure Dart state logic cleanly decoupled from Flutter UI code.
๐ฆ Installation
Add riverpod_form_binder to your pubspec.yaml:
dependencies:
riverpod_form_binder: ^1.0.0
flutter_riverpod: ^2.5.0
๐ Quick Start
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:riverpod_form_binder/riverpod_form_binder.dart';
class SignupFormNotifier extends FormBinderNotifier {
SignupFormNotifier() {
registerField<String>(
'email',
initialValue: '',
validator: FieldValidator<String>()
.required('Email is required')
.email('Enter a valid email'),
);
}
}
๐ License
MIT License - Developed with โค๏ธ by Olamilekan Adeyemi (@lekthedeveloper).