juice_forms 0.1.0
juice_forms: ^0.1.0 copied to clipboard
Form state — fields, sync/async validation, and per-field selective rebuilds — as a Juice bloc.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2026-05-28 #
Added #
- Initial release.
FormsBloc— form state for a set of fields, with per-field selective rebuilds: a widget bound toFormsGroups.field('email')rebuilds only when that field changes.- Dynamic fields — register/unregister fields at runtime.
- Sync + async validation —
ValidatorandAsyncValidator; async runs after sync passes, debounced, with stale results dropped (latest change wins). Validators—required,minLength,maxLength,email,matches(cross-field),all.- Submit lifecycle —
submit()does its own awaited validation pass, then runs the injectedSubmitHandler; surfacessubmitError, markssubmitted. A submit with no handler fails loudly. - State — data-only
FormsState/FieldState(value/error/touched/ validating/enabled) with derivedisValid/isDirty/values. Validators live on the bloc config, never in state. - Rebuild groups —
form:field:<name>,form:any,form:valid,form:status,form:fields.