form_ui_builder 0.1.0
form_ui_builder: ^0.1.0 copied to clipboard
A Flutter package that helps you build dynamic and customizable user interfaces quickly and easily.
0.1.0 #
Reworks the boundary between the package and the host app. This release has breaking changes.
Breaking #
onSubmitnow hands back aFormSubmissioninstead ofMap<int, InputWrapper>.submission.valuesis keyed bydatabase_param, excludes hidden fields, and carries no UI state;submission.fieldsstill reports every element. The old payload type was not even exported, so a host app could not name what it received.FormUiBuilderScreen.onSubmitfires only after the whole form validates. Previously any submit succeeded, including one on a form the user had never touched.buildFormLogicBundlereturnsLeft(Failure)when the service locator has not been set up, instead of throwing a rawException.CustomTextField.focusNodeis now nullable, so non-editable fields render read-only rather than not rendering at all.- Removed the
dioandinternet_connection_checker_plusdependencies along with the unusedConnectionCheckerandDioErrorHandler. Removed theintldependency, which was used for a single date format and conflicted withflutter_localizationspinning. getItis nowfinaland can no longer be reassigned.
Added #
FormUiBuilderView— the form with noScaffold,AppBaror submit button, for embedding in a host app's own layout.FormUiBuilderScreenis now a thin wrapper over it.buildFormLogicBundleFromSchema— flattens a whole schema (all pages, all sections) down to its leaf elements, so hosts no longer hand-indexschema[0]['childrens'][0]['childrens']and silently drop every section but the first.- Whole-form validation before submit, reporting one message per offending field and moving focus to the first.
onValidationErroron both widgets, so the host presents errors its own way instead of the package pushing aSnackBarover its UI.title,submitLabel,maxContentWidthandautoOpenPickersOnFocusparameters — the app bar title and submit label were hardcoded English.TimePickerValueChanged— picked times were silently discarded; there was no event at all.resetServiceLocator(), for test isolation.- The whole public surface is now exported:
FormSubmission,FormFieldResult,InputWrapper,ChildrenX,Failure,FormValidationFailureand the entity types reachable fromFormLogicBundle. - Test suite covering the validation helpers,
BuildParameterMap,ValidateForm, the bloc and the public API. The package previously had no tests.
Fixed #
- Entities used
implements Equatable, which does not inherit==/hashCode—propswas dead code and every entity compared by identity. All 20 now useextends. FormUiBuilderBloc.close()disposedFocusNodes supplied by the host, so opening the same form a second time threw "A FocusNode was used after being disposed". It now disposes only nodes it built, and disposes the previous generation when a bundle is rebuilt.int.parseon an emptydependent_operator/operatorthrew and failed the entire bundle. Blank and unparseable ids are now skipped. Real schemas carry""in these fields on every element, so the first payload with a non-emptyvalidationarray would have hit this.ElementHiddenwas compared against lowercase'elementhidden'and so never matched, leaving hidden elements visible. All element-type comparisons are now case-insensitive.checkMobileNoValidationranint.parse(mobileNo[0])before the digit check, throwing on any non-numeric entry.CustomDatePickerreassigned alate final FocusNode, throwingLateInitializationErrorwhenever the node identity changed.CustomCheckboxpassed oneFocusNodeto every tile in the group; it is now attached once to the group.hideAndShowValidationrecursed with no cycle guard — a circularelementOptionDependentoverflowed the stack.- Schema parse errors escaped the
Eitheras rawTypeErrors; the repository caught onlyParseException. They now return aFailurenaming the offending element. valueMapignoredelement_value, so configured defaults never reached the first render.- Cross-field maps were built in the same pass that filled
parameterMap, so a reference to a later element silently read as empty. - Unguarded
!on map lookups in the dropdown and date handlers. calculateRemainingValuesForValueChangecalledint.parseon raw text-field input.
Changed #
- Fields are width-capped and fonts come from the host's
textTheme, so the form no longer stretches edge to edge on a desktop window.style.font_sizefrom the schema is now honored — it was parsed but never applied. - Tab traversal is grouped; the time picker opens in keyboard-entry mode.
- Rewrote the README, which named the wrong package, was truncated mid-code-block, and documented none of the API or the JSON schema.
0.0.6 #
- version update