digit_forms_engine 0.1.4
digit_forms_engine: ^0.1.4 copied to clipboard
A dynamic form rendering engine for Flutter, built on top of the `digit_ui_components` package. It supports multi-page, configurable forms based on a JSON schema with automatic validation, navigation, [...]
0.1.4 #
- New page-level
conditions.headerTag: shows a location-pin tag under the page description naming where the form applies (e.g. the boundary a missed place is added under).{{navigation.<key>}}placeholders are resolved and the value is translated; nothing is shown when it resolves to empty or stays unresolved - Location (
latLng) capture popup: description is "Location is required for this form, so please wait while we capture it. Your location is saved automatically once accuracy is 5 m or less." (new singleLOCATION_CAPTURE_SAVE_RULE, replacingLOCATION_CAPTURE_SAVE_RULE_GOOD/_TIMER; the threshold is no longer bold). When the popup timer runs out without good accuracy, the status chip shows "Timed out" (LOCATION_TIMED_OUT) and the info box showsLOCATION_CAPTURE_TIMED_OUT_INFO; Save stays enabled. The info box now uses an info icon with an info border. NewisLocationCaptureTimedOut
0.1.3 #
radiofields now renderhelpText.RadioListhas nohelpTextprop of its own, so the builder draws it under the options using the same styleDigitBaseFormInputapplies (bodyS, secondary text colour, truncated at 256 characters). An error suppresses it, matching how the components library replaces help text with the error rather than stacking both.- Added the
multiSelectDropdownfield format: rendersMultiSelectDropDownfrom the field'senumswithout the config also having to setisMultiSelect: true. Selections are stored dot-joined, and the summary page splits and localizes them like other multi-select fields. Composer fields declared as"type": "array"already fall back tostring, so they pick this up. - Location (
latLng) capture rebuilt in the style of ODK Collect on the sharedPopup: live accuracy, a Searching / Good / Fair / Low status chip, elapsed time, satellite count and a pulsing pin - A reading at or below
accuracyThreshold(default 5 m) is saved automatically with a "Location saved" toast; the 10 m fallback is gone.unacceptableAccuracyThresholdonly adds a "fair" colour band; neither rule becomes a form validator - New
popupTimerproperty (PopupTimer:enabled,minutes,seconds; numbers or text). Once it runs out Save accepts any reading. Defaults to 30 s;enabled: falseturns it off - After 30 s without good accuracy the popup shows a hint chosen from accuracy and satellite count. Satellite count comes from the host on the
digit_forms_engine/gnss_satellitesEventChannel; hosts without it just don't show the line - Closing the popup leaves the field empty, so a required field fails until captured. Recapture shows whenever there is no value or accuracy is above the threshold, and is hidden for read-only fields; a prefilled value is kept
- Fixed capture waiting forever on "Searching…" when a finished load returned the coordinates the bloc already held
- New
GpsWarmup: shared, reference-counted high-accuracy GPS session thatFormsRenderPagestarts when the form has alatLngfield, so the fix is already improving when the field is reached. It never requests permission.locationis now a direct dependency - New
notInvalidator: fails when the value matches a list ornavigation.*entry (case- and space-insensitive). The scoped form{from, scopeField}checks per option of another field and re-validates when it changes (unique site names per type) - Pages whose fields are all
hiddenare kept when a field setsincludeInFormorincludeInSummary; the form flow skips them, so a page can appear only on the summary - Summary page:
includeInSummary: trueoverrideshidden; empty fields are left out instead of showing--; booleancheckboxvalues show as read-only checkboxes; tighter card spacing - Back on the summary page clears the form (
FormsClearFormEvent) and returns to the opening screen, so the next entry starts empty - A hidden
customfield withincludeInForm: trueis built off screen (Offstage), so components that set their own value while building still send it dobpicker: label above the card with the required asterisk; newinnerLabelfor the date input (falls back tolabel, thenCORE_COMMON_DOB). A bare{{name}}inminAge/maxAgereads navigation params or a form control- Selection card: deselecting the only option clears the value so the required error shows, instead of throwing and restoring the option
- Tests:
test/lat_lng_accuracy_test.dart(accuracy levels, save rule, popup-timer parsing, hints,GpsWarmup.schemaHasLocationField) and a widget test for off-screen custom fields
0.1.2 #
- Fix multi-select summary rendering: gate the dot-split on the
isMultiSelectschema flag instead of a regex that only accepted purely alphabetic dot-joined tokens, so enum codes with underscores or digits (e.g.MOB_VAN,HEALTH_WORKER) now localize instead of being shown raw with dots. Remove the now-unusedisDotSeparatedKeyhelper.
0.1.1 #
- Introduced the forms-engine package with schema-driven forms, MDMS schema fetch, and
BaseReactiveFieldWrapperfor auto-localized validation - Added GS1 barcode scan support: edit, deserialization helpers, non-empty-field serializer, duplicate-scan check, viewer, and scan-limit fix
- Added multi-entity tab functionality mapping
_item_N_suffixfields to base names;ValueNotifier-driven fit-or-scroll tab index - Added dependent-field / features-config support, dynamic tab change on errors, validation toast naming invalid fields, hidden/readonly/isActive handling
- DOB validator with conditional values; min/max/length fallbacks;
DateFormatregex check; alert-popup form submission; emoji blocker - Fix checkbox fields sending
nullinstead offalse; scanner issues; dependency handling; prefix conflicts in multi-tab views; edit-flow beneficiary-ID restoration - Added
preventScreenCaptureflag andScreenProtectionManagerfor secure form pages; atomic localization cache swap; O(1)translate()lookups - Added
navigationParams, custom widgets (facility, productVariant), multi-select dropdown, referral custom component, forms-engine visibility support
0.1.0 #
- Added
navigationParamson form control and JSON form schemas for richer inter-page data handoff - Added conditional value support in DOB validator; corrected age validation
- Added hidden condition while building forms
- Added alert-popup support for form submission with customizable actions
- Added scanner spread and CDD identity QR payload handling in warehouse dispatch flow
- Guarded
form.control()inJsonSchemaScannerBuilderagainst missing schema control - Enhanced beneficiary ID handling in form control for edit mode; restore original ID number when switching identifierType back
- End-to-end boundary gate on both scanner sides
0.0.1 #
- Dynamic form rendering engine based on JSON schema
- Multi-page form support with automatic navigation
- Support for multiple field types: text, dropdown, date, latLng, locality, scanner, and more
- Validation support using reactive_forms
- Form state management using BLoC pattern
- Summary page generation
- Localization support
- Theming support via digit_ui_components
- Added mobile number format support for string type fields
- Fixed min and maxLength validation skipping for empty strings
- Added dependency field logic
- Integrated formula parser for conditional visibility and validation
- Fixed issue with multiple submit buttons
- Added support for multiple scanning
- Added validation for scanning
- Added dynamic validator resolver context
0.0.12-dev #
- Added dynamic validator resolver context
0.0.11-dev #
- Added support for multiple scanning
- Added validation for scanning
0.0.10-dev #
- Fixed issue with multiple submit buttons
0.0.8-dev #
- Added dependency field logic
- Integrated formula parser for conditional visibility and validation
0.0.4-dev #
- Fixed min and maxLength validation skipping for empty strings
0.0.3-dev #
- Added mobile number format support for string type fields
0.0.2-dev #
- Dynamic form rendering engine based on JSON schema
- Multi-page form support with automatic navigation
- Support for multiple field types: text, dropdown, date, latLng, locality, scanner, and more
- Validation support using reactive_forms
- Form state management using BLoC pattern
- Summary page generation
- Localization support
- Theming support via digit_ui_components
0.0.1-dev #
- Initial development release