form_ui_builder 0.1.0 copy "form_ui_builder: ^0.1.0" to clipboard
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 #

  • onSubmit now hands back a FormSubmission instead of Map<int, InputWrapper>. submission.values is keyed by database_param, excludes hidden fields, and carries no UI state; submission.fields still reports every element. The old payload type was not even exported, so a host app could not name what it received.
  • FormUiBuilderScreen.onSubmit fires only after the whole form validates. Previously any submit succeeded, including one on a form the user had never touched.
  • buildFormLogicBundle returns Left(Failure) when the service locator has not been set up, instead of throwing a raw Exception.
  • CustomTextField.focusNode is now nullable, so non-editable fields render read-only rather than not rendering at all.
  • Removed the dio and internet_connection_checker_plus dependencies along with the unused ConnectionChecker and DioErrorHandler. Removed the intl dependency, which was used for a single date format and conflicted with flutter_localizations pinning.
  • getIt is now final and can no longer be reassigned.

Added #

  • FormUiBuilderView — the form with no Scaffold, AppBar or submit button, for embedding in a host app's own layout. FormUiBuilderScreen is 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-index schema[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.
  • onValidationError on both widgets, so the host presents errors its own way instead of the package pushing a SnackBar over its UI.
  • title, submitLabel, maxContentWidth and autoOpenPickersOnFocus parameters — 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, FormValidationFailure and the entity types reachable from FormLogicBundle.
  • 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 ==/hashCodeprops was dead code and every entity compared by identity. All 20 now use extends.
  • FormUiBuilderBloc.close() disposed FocusNodes 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.parse on an empty dependent_operator / operator threw 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-empty validation array would have hit this.
  • ElementHidden was compared against lowercase 'elementhidden' and so never matched, leaving hidden elements visible. All element-type comparisons are now case-insensitive.
  • checkMobileNoValidation ran int.parse(mobileNo[0]) before the digit check, throwing on any non-numeric entry.
  • CustomDatePicker reassigned a late final FocusNode, throwing LateInitializationError whenever the node identity changed.
  • CustomCheckbox passed one FocusNode to every tile in the group; it is now attached once to the group.
  • hideAndShowValidation recursed with no cycle guard — a circular elementOptionDependent overflowed the stack.
  • Schema parse errors escaped the Either as raw TypeErrors; the repository caught only ParseException. They now return a Failure naming the offending element.
  • valueMap ignored element_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.
  • calculateRemainingValuesForValueChange called int.parse on 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_size from 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
0
likes
160
points
148
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package that helps you build dynamic and customizable user interfaces quickly and easily.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

equatable, flutter, flutter_bloc, fpdart, get_it, synchronized

More

Packages that depend on form_ui_builder