Skip to content

Form Kit ​

Forms, layout and designer

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.

Key Capabilities

Typed, portable definitions

A FormDefinition is plain immutable Dart: sealed field types, a layout tree, validations and rules. It is checked when constructed and round-trips through JSON with FormCodec.

Real layout

Groups, repeating groups, 6 or 12 column rows with spans, and free grids with fixed cells. Minimum sizes are enforced, and rows and grids stack on narrow screens.

Rules and formulas

Conditions show, hide, enable and activate validations. Formula fields compute from fields in the same scope, once per repeating-group entry.

Visual designer

FormKitEditor: palette, canvas, inspector, preview and Definition JSON over a controller with undo, redo and refusal reasons.

Core Concepts

Packages

PackageOwns
vyuh_form_typesPure Dart. FormDefinition, fields, layout, validations, rules, formulas, FormCodec and the engines.
vyuh_form_kitFlutter. FormView and the field controls. Re-exports vyuh_form_types.
vyuh_form_kit_editorFlutter. FormKitEditor, FormKitEditorController, palette, actions, inspector and preview.
vyuh_cdx_uiFlutter. CdxConfig and CdxFieldStyle that theme the controls (classic and refined presets).

Three parts ​

PartPackageWhat it does
Modelvyuh_form_typesDescribes 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 renderervyuh_form_kitFormView renders a definition. It holds no state: the host owns the value map and receives every change through onChanged.
Designervyuh_form_kit_editorFormKitEditor edits a definition visually. Every command produces a new, valid definition, or is refused with a reason.

Form Kit or Form Editor? ​

The CDX docs also cover the older Form Editor (vyuh_feature_forms and vyuh_form_editor). The two are separate systems with separate models.

Form KitForm Editor
ModelImmutable FormDefinition, checked when constructedForm with FormGroup, built with a fluent DSL
LayoutGroups, repeating groups, 6/12-column rows, free gridsRows, sections, repeating sections, step forms
RuntimeStateless FormView; the host owns valuesreactive_forms controls owned by the form
FrameworkPlain Dart and Flutter; no vyuh_core feature registrationA Vyuh feature (forms.feature)
Use it forNew forms, and forms that need precise layout or JSON portabilityExisting apps built on vyuh_feature_forms

Pick the Form Kit for new work. Keep the Form Editor where an app already depends on it.

Status ​

The packages are at 0.1.x. Pages mark anything that is not on main yet:

  • 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, extensible rules, more field types and presentations, and one-registration custom types. See the Roadmap.

Next steps ​