jar_form 1.2.0
jar_form: ^1.2.0 copied to clipboard
Reactive form management for Flutter with JAR validation schema support.
Changelog #
1.2.0 #
Features #
- Item-scoped validation for array leaves — a field inside a
JarFieldArrayitem now validates with its sibling values as context, so.when/.test/.customrules discriminate per item (e.g. aChefrow requirescuisine, aWaiterrow does not). The context merges form-level and item-level values, so a leaf can depend on either.
Bug Fixes #
getFieldValue<T>no longer throws fordynamic-registered fields (array leaves) — it casts the stored value, not the field state.
Requires #
jar^1.3.0— the per-item discrimination relies on JAR's.wheninstance-pollution fix.
1.1.0 #
Features #
- Added
JarFieldArray, a first-class widget for repeatable subforms (the Flutter equivalent of react-hook-form'suseFieldArray) - Each item exposes a stable
id(for widget keys) and anindex, withitem.path('field')resolving to the namespaced leaf name (e.g.professions.0.startTime) - Array operations on the builder handle:
append,insert,removeAt,move,clear, plusitems,length, and array-levelerror - Array-level rules (
min/max/unique) and per-element validation are delegated to JAR'sJarArrayschema getValues()now returns array data as a clean nested list (e.g.{'professions': [ {...}, {...} ]}) instead of flattened keys
Changes #
JarFormControllergainedregisterArray,getArray, andunregisterJarFormFieldnow re-subscribes when itsnamechanges, keeping bindings correct as array items are reordered or removed
1.0.3 #
Changes #
- Reverted cross-field validation changes from 1.0.2 due to issues
- Restored stable functionality from 1.0.1
1.0.2 #
DEPRECATED - Please use 1.0.3 instead
1.0.1 #
Bug Fixes #
- Fixed form state not updating properly when using trigger() method
- Ensured consistent notification of form state changes to listeners
1.0.0 #
Initial release.
Features #
- JarForm widget for form management with JAR validation schemas
- JarFormField component for connecting form fields to controller
- JarFormController for managing form state and validation
- Support for synchronous and asynchronous validation
- Form state tracking (dirty, touched, valid, submitting)
- Two-way data binding between form controller and UI
- Field-level validation with error messages