Installation
The Form Kit ships as four packages. Add the ones you need: a server or tool that only reads and checks definitions needs vyuh_form_types alone; an app that fills forms adds vyuh_form_kit; an app that designs them adds vyuh_form_kit_editor; and an app that scans barcodes or picks files and photos adds vyuh_form_kit_capture.
Requirements
- Dart SDK 3.13 or higher
- Flutter 3.47 or higher (for
vyuh_form_kit,vyuh_form_kit_editorandvyuh_form_kit_capture) - A token for pub.vyuh.tech
Add the dependencies
The Form Kit packages are hosted on pub.vyuh.tech, at the version of Blueprint:
dependencies:
vyuh_form_types:
hosted: https://pub.vyuh.tech
version: ^0.20.0
vyuh_form_kit:
hosted: https://pub.vyuh.tech
version: ^0.20.0
vyuh_form_kit_editor:
hosted: https://pub.vyuh.tech
version: ^0.20.0
vyuh_form_kit_capture:
hosted: https://pub.vyuh.tech
version: ^0.20.0Then run flutter pub get (or dart pub get for vyuh_form_types alone).
Packages
| Package | Purpose | Depends on |
|---|---|---|
vyuh_form_types | The model and engines, pure Dart | vyuh_expression |
vyuh_form_kit | FormView and field controls | vyuh_form_types, vyuh_cdx_ui |
vyuh_form_kit_editor | FormKitEditor and its controller | vyuh_form_kit, vyuh_form_types, vyuh_expression_ui, vyuh_cdx_ui |
vyuh_form_kit_capture | The camera barcode scanner and the file, gallery and camera attachment picker, behind FormView's hooks. See Host services | vyuh_form_kit, mobile_scanner, file_picker, image_picker, crypto |
No code generation and no feature registration are needed.
Formula fields
A FormulaFormField names its result type with ValueType (rational, boolean, text, date, time, instant), and a decimal number is a Rational. vyuh_form_types re-exports both, with LocalDate and LocalTime, so declaring formula fields in code needs no other package.
Imports
// Model only (pure Dart).
import 'package:vyuh_form_types/vyuh_form_types.dart';
// Fill time. Re-exports vyuh_form_types.
import 'package:vyuh_form_kit/vyuh_form_kit.dart';
// Design time.
import 'package:vyuh_form_kit_editor/vyuh_form_kit_editor.dart';Name clash with Flutter
vyuh_form_types defines TextFormField, which the Material library (material_ui) also defines. Hide Material's when you import both:
import 'package:material_ui/material_ui.dart' hide TextFormField;Theme
The controls draw with vyuh_cdx_ui. Build your theme with createCdxTheme so they pick up CDX tokens. See Styling for the classic and refined looks.
Next steps
- Quick Start: define, render and edit a small form
- The form definition