Example app

A runnable gallery where every pattern in these docs has a working screen — and the reusable widgets it is built from.

The example/ folder of the repository is a gallery app: one screen per documented pattern, reachable from the home page. Where the docs and the app ever disagree, the app wins and the docs get fixed — it is the ground truth.

Run it

git clone https://github.com/leancodepl/advanced_forms.git
cd advanced_forms/example
flutter pub get
flutter run

Any Flutter target works; the app uses no platform plugins. It owns its controllers with provider's ChangeNotifierProvider, which is a choice of the example, not a requirement of the package.

Screen guide

ScreenDemonstratesExplained in
Simple FormSubmit-time validation, an async email check with timeout and failureToError, the hasFailedValidation banner, canSubmit on the button. Try john@email.com (taken) and boom@email.com (the check throws)Async validation
Password FormCross-field validation via subscribeToFields, one field opting into ValidationMode.onUnfocus, a custom controller whose error is a List of rule violationsCross-field logic, Validators
Optimized RenderingGranular rebuilds and the child: optimisation across three layouts of increasing weightRendering fields
Quiz FormApplying a server response with setError / setError(null) after the answers are checkedRead-only fields and server errors
Complex FormSingle-select dropdowns and swapping the active subform with addSubform / removeSubformField controllers, Subforms
Delivery List FormA dynamic list of subforms, validated and disposed by the parentSubforms
Step FormA multi-page wizard in a PageView: one subform per page, await step.validate() on Next, the parent's validate() on Submit, and a conditional invoice page that setValidationEnabled(false) drops from both the flow and the validationSubforms
Scroll FormScrolling to the first invalid field through field.focusNode, plus a plain Stream for one-off UI eventsFocus

Reusable pieces

And the examples on this site

Every dart listing framed as a live example in these docs is compiled into a Flutter web bundle when the site is built and rendered right above its source. They are smaller than the example app's screens on purpose — one lesson each — and they share nothing with it except the package. Multi-select fields and read-only fields, which the example app does not cover, have their running examples on Field controllers and Read-only fields and server errors.

On this page