Form Kit
A typed form model, a stateless fill-time renderer and a visual designer. One immutable FormDefinition feeds both the form your users fill in and the editor your authors design with.
Moved from the CDX documentation
These pages moved from the CDX documentation with the packages. Statements that name 0.1 or 0.2.0 describe the CDX-era releases of these packages, not Blueprint's 0.20.0.
Key capabilities
- Typed, portable definitions. A
FormDefinitionis plain immutable Dart: sealed field types, a layout tree, validations and rules. It is checked when constructed and round-trips through JSON with the kit. - Real layout. Groups, repeating groups, 6 or 12 column rows with spans, and free grids on square cells. Minimum sizes are enforced, and rows and grids stack on narrow screens.
- Rules and formulas. Rules show, hide, enable, require, compute values and apply validations, per repeating-group entry, through kinds apps extend. Formula fields compute from fields in the same scope.
- Visual designer.
FormKitEditor: palette, canvas, inspector, preview and Definition JSON over a controller with undo, redo and refusal reasons.
Packages
| Package | Owns |
|---|---|
vyuh_form_types | Pure Dart. FormDefinition, fields, layout, validations, rules, formulas, the kit's codec and the engines. See The form definition. |
vyuh_form_kit | Flutter. FormView and the field controls. Re-exports vyuh_form_types. See Quick Start. |
vyuh_form_kit_editor | Flutter. FormKitEditor, FormKitEditorController, palette, actions, inspector and preview. See The editor. |
vyuh_form_kit_capture | Flutter. The camera barcode scanner and the file, gallery and camera attachment picker, with the platform plugins the kit itself avoids. See Host services. |
vyuh_cdx_ui | Flutter. CdxConfig and CdxFieldStyle that theme the controls (classic and refined presets). See Styling. |
Core concepts
- Form definition: fields, the layout tree,
FieldSlot, construction-time checks and JSON - Field types: every built-in field type and its options
- Layout: groups, repeating groups, rows, grids, gaps and minimum sizes
- Validation: per-field validations, severity and the engine
- Rules and formulas: rules as expressions, operators, facts, effects, the rule engine and formula scopes
Three parts
| Part | Package | What it does |
|---|---|---|
| Model | vyuh_form_types | Describes a form as data: fields, a layout tree, validations and rules. Runs the rule, formula and validation engines. No Flutter dependency, so servers and tools can use it. |
| Fill-time renderer | vyuh_form_kit | FormView renders a FormKitForm, which holds the values and each field's state. The host builds the kit once, its extensions carrying the views of its own types, and gives it with its services in a KitScope<FormKit>. |
| Designer | vyuh_form_kit_editor | FormKitEditor edits a definition visually. Every command produces a new, valid definition, or is refused with a reason. |
Status
The packages are at 0.20.0, the Blueprint version. The pages mark work that was planned or in review when they were written:
- Coming in 0.2.0 (in review): the validator registry, which enforces every built-in validation, checks repeating-group entries, and lets apps register their own validators. See Custom validators.
- Planned: container validations, dependent options through providers, more field types and presentations, and one-registration custom types. See the Roadmap.
Next steps
- Installation
- Quick Start: define a form, render it, then open it in the designer
- The form definition