keyed_form_schema 0.1.0 copy "keyed_form_schema: ^0.1.0" to clipboard
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 raw Map (e.g. a decoded JSON body), yielding FieldKey-addressed FieldErrors.
  • validateValues / validateValuesAsync — validate from a positional list of field values in schema field order, allocating no map. This is what the keyed_form_gen validate() calls on every keystroke; KSObject caches its per-field FieldKeys and field list so a validation run does no per-field key/iterator allocation.
  • All four entry points take an optional scope (a FieldKey): only fields / rows on its path are checked, and a refinement runs only when its target key is at or under scope. Every returned key is then at or under scope — the contract KeyedFormController splices 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(...)).
1
likes
150
points
68
downloads

Documentation

API reference

Publisher

verified publisherv4g.space

Weekly Downloads

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.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

keyed_form_core, uuid

More

Packages that depend on keyed_form_schema