digit_flow_builder 0.2.2
digit_flow_builder: ^0.2.2 copied to clipboard
A JSON-driven dynamic UI rendering framework for Flutter. Registers flows and pages from configuration, dispatches actions, and composes forms and templates without app-side code changes.
0.2.2 #
- New
appliedFilterChipswidget: shows a list's applied filters as removable chips;onRemoveruns on delete - New
WidgetReadinessRegistryand screen-levelwaitForWidget(name or{name, timeoutMs}, default 3000 ms):initActionscan wait for a sibling widget's init signal so the first search carries both sets of filters ScreenBuilder: pages withinitActionsstart inisLoading, so the empty-state card no longer flashes before the first searchsearchBar: headlessproximityblock (radius,searchName,filterKey,root) takes one GPS fix, sends onewithinsearch and signals the readiness registryproximitySearch: an explicitfalsesticks while an unset value usesdefaultValue; a default-on switch applies once GPS resolves. AddshideSwitch, passesrootthrough and supportsoperation: withinOrUnlocatedlistView: opt-inshowLoader(spinner while loading with no items) and configurableemptyChild.layout_renderershows its load-more and refresh loaders only when content is already on screenmenu_card: optionalstylingblock (alignment,iconPosition: top,descriptionAlignment,iconSize,elevated)button: optionalshadow: true.card:properties.paddingaccepts a number, spacer token or per-side maptext: renders the translatedlabelwhen there is novalue; addstextStyle(color,fontSize,fontWeight,fontFamily,lineHeight) andtextAlign;maxLines: 0is unboundedicon:properties.sizeand themecolor, plus fallback icons for keysDigitIconMappinglacks.no_result_card:imageoverrides the default illustrationaction_popup:onCloseActionruns on cross-tap; the dialog only skips its own pop when that list closes the popup itself- Bare numeric values (counts, ids) are no longer localized, so a stale catalog row keyed on a digit can't blank a cell
interpolateWithCrudStates: list path segments support.length,.first,.lastand numeric indexes- Entity type names are obfuscation-safe (
getEntityTypeNameinstead ofruntimeType.toString()), fixingrootEntitylookups in release builds - Wrapper
entity_filter: addscontains(case-insensitive, optionalminChars),notEquals,notIn, and{{key}}equalsvalues from widget data computed_evaluator: barefrom/fieldpaths are treated as templates andEntityModelitems are converted to maps for reducesearch_executor: a searchName's filter bucket is replaced instead of merged, so unrelated searches (e.g. name then QR scan) no longer AND together.clear_state_executorre-runs the search with the bucket's remaining filters, keepinginitActionsfilters such astenantIdcrud_executor:awaitCreate: truewrites throughCrudServiceand waits, for flows that leave the page and read the record backtoast_executor: falls back to static localization and the pre-captured navigator when the context is gone, or skips the toast instead of breaking the action chainDigitCrudService: optionalrepositoryOverride;FacilityModelis routed to the facility repositoryFlowBuilderSingleton:setActiveDeliveryMethodnarrows cycle deliveries to the active delivery method (raw copies kept); addshasDeliveryMethod,setParentBoundary/parentBoundaryandsetProjectId.activeDeliveryMethodandboundaryAndParentCodesare exposed to the state context- New
parentBoundaryCodeOfhelper; header andadministrativeAreauseBoundaryModel.displayName, so a new settlement shows its own name - Transformer context adds
parentBoundaryCode,parentBoundaryName,selectedBoundaryNameandselectedBoundaryHierarchyCode - Function registry: dose and eligibility helpers count only deliveries of the active delivery method; a
VACCINATED_ELSEWHEREtask in the current cycle means nothing left to deliver. AddscountLocatedSites,siteNamesByType,getBoundaryAndParentOptions,wasAbsentOrRefusedForCurrentCycleandhasVaccinatedElsewhereForCurrentCycle. Locality dropdown labels use the last segment ofaddress.locality.code transformJsonpasses throughlabelPlaceHoldersanddescriptionPlaceHolderstransformer_config.dart:- New
transitSite/clfSite(aFacilityModelwith usageTRANSIT_POST/OUTSIDE_HOUSEHOLD_PLACESplus aProjectFacilityModel),newSettlement(NEW_SETTLEMENTuser action) andgroupVacChild/groupVacReferral(action: OTHER, tagged to the session viaresourceTag) memberCountuses__default:2:householdDetails.memberCount; task and address lat/lng come from__context:householdLatLng; ineligible and unable-to-deliver read location from their own pages (also fixes thelocationAccuracymapping)- Vaccinated elsewhere: task status
VACCINATED_ELSEWHERE, addsrevisit,vaccinationLocation/vaccinationLocationOther, dropssiteName/region; redose tasks getrevisit: true - PGR
locality.codeandboundaryCodeuseselectedBoundaryHierarchyCode - Polio vials configs gain
totalMixingSyringes,totalDiluentsIssued,unusedDiluentsReturned,spoiledDiluentsReturned; explicitfallbackModelon 9 existing configs
- New
0.2.1 #
- Popup action chains survive an ancestor rebuild between build and tap:
ButtonWidgetsnapshotsNavigator,CrudBloc, andDigitScannerBlocinbuildResolvedand threads them throughresolved.executeActionsintocontextData['_preCaptured'];close_popup_executor,crud_executor, andnavigation_executorprefer the captured handles over the button's possibly-deactivatedBuildContext, falling back tocontext.read/Navigator.ofwhen absent so non-button action triggers behave unchanged label_pair_list: hide pairs with an empty or null value at the widget level; drop the JSONhideIfNullknob. Applies to static entries anditerate-generated items aliketag: auto-hide the tag when any{{path}}placeholder in the raw label resolves to null — configs no longer need per-taghiddenfilters for grouped-list items with missing keysentity_grouper: emit realnullfor thegroupKeyof field-less entities instead of a synthesisednull_Nstring so display configs and the newtagauto-hide can filter cleanly; unique buckets preserved so unrelated null-keyed rows aren't mergedtable: passwithColumnDividers: truetoDigitTable— works around a header text-width miscalculation indigit_ui_componentstable_header.dartwhere the inner container adds an unaccounted 8 px right padding when column dividers are off, causing long headers to spill into the neighbouring column and read as visual overlapgetScreenKeyFromArgs/getInstanceIdFromArgs: guard against a deactivated context;ModalRoute.ofasserts on inactive elements, and callers already tolerate a null screenKey
0.2.0 #
- Search bar: clear sibling-branch filters when switching between conditional search modes (e.g. name vs ID); generic across any set of
searchNames declared in the config, with a stale-value guard in_dispatchSearchand Map type-guards on sub-actions - Rename the search-widget property
nametosearchModefor clarity when multiple modes coexist in one field - Transformer executor: add
hierarchyTypeto the context map (DigitDataModelSingleton.hierarchyType, falling back toselectedProject.additionalDetails.hierarchyType); wirehierarchyTypeinto thecomplaintRegistrationmapping so PGR create requests carry it - Persist the proximity-search toggle across searches so it survives filter/state resets
0.1.1 #
- Introduced the flow-builder package: dynamic layout rendering,
FlowRegistry,FlowCrudBloc,state_wrapper_builder, widget registry, navigation registry, singleton, and JSON-driven screen composition - Attendance flow suite: mark-attendance card, QR scanner flow, signature capture/compare, session entry/exit time, missed-days popup,
AttendanceLogModel, group-by-teams,CustomDataExecutor - Stock less/excess and unable-to-deliver flows with recon calculations, indirect-delivery config, accept/reject flows, project-facility mapping, and duplicate-scanner checks
- Polio/SMC registration & delivery flows: redose, eligibility checks (age/height/weight/dose criteria), unique beneficiary ID pool loader, caregiver consent, computed field/dose/cycle resolution
- New widgets/executors: QR scanner, proximity search, multi-select dropdown, selection card, expandable widget, labeled toggle, panel/tag/table widgets with
@conditioncells, action popup, no-result card - Core engine: multi-entity tabs,
contains/notContains, nested-path field access,notExistswrapper filter,matchesJSON substring operator,groupByTypewrapper filters, function registry, navigation params, dependent-page logic,preventScreenCaptureflag - Numerous fixes across state clearing, filter application, transformer config, visibility conditions, edit-flow additional fields, scroll/pagination refresh, cache invalidation, and boundary-scoped searches
0.1.0 #
- Flow builder: apply
wrapperConfigfilters ingroupByTypemode; support nested-path field access andnotExistswrapper filter - OPEN_SCANNER: added
parseJsonoption to spread structured QR payloads intoformData; routeparseJsonfailures toonError - Stock scan: thread
batchNumber,expiryDate,comments, andwaybillNumberinto RECEIVED; produce RECEIVED on Accept and dedup receive list - Function/transformer registry expansions and config-driven eligibility/dose-criteria improvements
- Memoize
FlowRegistry.setConfigon same list reference - Tokenize
{{fn:..}}arg list respecting quoted strings; make missing{{fn:xxx}}calls loud in debug builds - Separate localization keys from dynamic interpolation args via
labelArgs/descriptionArgs - Pass
compositeKeyto header and footerLayoutMapper.map()calls - Bulk PB creation on search OPEN; proximity-toggle and search-card config fixes
- Short-circuit
listViewon nullCrudStateDatainstead of crashing; guard layout bodyremoveLastagainst empty list - Debounce config-driven buttons against async
onActionre-entry (later reverted) - End-to-end boundary gate on both scanner sides
- Fix eligibility check for height/weight; fix dose criteria evaluator on chained comparisons
- Remove debug logs from computed field/list evaluators and eligibility check
0.0.1 #
- Initial release
- JSON-driven dynamic UI rendering framework
- Two screen types: FORM (via digit_forms_engine) and TEMPLATE (via WidgetRegistry)
- 12 built-in action types: CREATE_EVENT, UPDATE_EVENT, SEARCH_EVENT, REFRESH_SEARCH, FETCH_TRANSFORMER_CONFIG, REVERSE_TRANSFORM, NAVIGATION, BACK_NAVIGATION, OPEN_SCANNER, SHOW_TOAST, CLEAR_STATE, CLOSE_POPUP
- 26+ built-in widgets for TEMPLATE screens
- FlowRegistry for registering and retrieving flow configs
- Conditional action execution using digit_formula_parser
- Template interpolation with
{{key}}syntax - Bidirectional pagination with scroll listeners
- Multi-instance state management via FlowCrudStateRegistry
- Custom widget registration support
- Screen capture protection