Overview
Typed field controllers, composable validation, and form-level state for Flutter — without a framework on top.
Flutter form validation and state management without a framework on top. advanced_forms gives you typed field controllers, composable sync and async validation, and form-level state tracking, built on ChangeNotifier and ValueListenable.
- Typed field controllers — text fields, checkboxes and switches, dropdowns and radio groups, and multi-select fields, each with its own value type and its own error type.
- Validators that compose —
filled,notEmpty,notNull,atLeastLength,notLongerThan,exactlyand numeric checks, combined with&and|, or anyE? Function(T)you write yourself. - Async validation — debounced server-side checks ("is this email taken?") with a timeout, failure handling and cached answers.
- Cross-field validation — re-run a validator when the fields it depends on change, or derive one field's value from another.
- Validation modes — validate on submit, on every keystroke, or on unfocus. Set once, applied to the whole form.
- Subforms — attach and detach nested form controllers; their fields join the parent's validate, reset, read-only and error handling.
- Form-level state —
canSubmit,wasModified,validatingandvalidationErrors, ready to bind to a submit button. - Read-only fields and server-side errors — freeze a value, or push an error in from an API response.
- Granular rebuilds — one builder per field, so a keystroke rebuilds one subtree and nothing else.
Using an agent that supports Agent Skills?
This repo ships an Agent Skill that teaches your agent the full API. Copy skills/advanced_forms/ into your app's .claude/skills/, or into your global ~/.claude/skills/.
General overview
Where to next
Installation
Add the package, or migrate from 0.1.x.
Your first form
Register fields, bind widgets, submit.
Validation
Modes, ready-made validators, async and cross-field checks.
API reference
Generated dartdoc for every member.
Also see the example app — a runnable gallery where every pattern in these docs has a working screen.
Maintained by LeanCode.