keyed_form_schema 0.1.0
keyed_form_schema: ^0.1.0 copied to clipboard
Declarative, schema-driven validation for immutable aggregates: compose field validators into object schemas that yield FieldKey-addressed FieldErrors. Re-exports keyed_form_core. Pure Dart.
0.1.0 #
Initial release.
- Fluent schema DSL:
ks.object,ks.string,ks.int,ks.double,ks.num,ks.boolean,ks.enums,ks.list,ks.map,ks.discriminatedUnion. validateMap/validateMapAsync— validate a rawMap(e.g. a decoded JSON body), yieldingFieldKey-addressedFieldErrors.validateValues/validateValuesAsync— validate from a positional list of field values in schema field order, allocating no map. This is what thekeyed_form_genvalidate()calls on every keystroke;KSObjectcaches its per-fieldFieldKeys and field list so a validation run does no per-field key/iterator allocation.- All four entry points take an optional
scope(aFieldKey): only fields / rows on its path are checked, and a refinement runs only when its target key is at or underscope. Every returned key is then at or underscope— the contractKeyedFormControllersplices scoped results with. - Cross-field
.refine(...)with sync / async predicates (the refinement callbacks still receive the whole map, rebuilt lazily only when one runs). - i18n-friendly lazy message resolution (
error: .text(...)/error: .builder(...)).