EasyDataForm<T> class

A typed result form to be returned by the onSave callback and passed as a parameter to the onSaved callback.

The main difference between EasyDataForm<T> and EasyForm is as follows:

  • EasyForm passes the result from the onSave callback to the onSaved callback. If the onSave result is null (onSave returned null or onSave was not specified) — instead of the onSave result, a map with the values of the form fields will be passed.
  • EasyDataForm always passes only the result returned by the onSave callback to the onSaved callback, or null if onSave was not specified.

See also:

  • EasyForm, for a more detailed description and examples of using forms in the easy_form_kit package.
Inheritance

Constructors

EasyDataForm({Key? key, required Widget child, EasyFormAdaptivity adaptivity = EasyForm.defaultAdaptivity, @Deprecated('Use PopScope around EasyForm instead. Will be removed in the next major release.') WillPopCallback? onWillPop, EasyFormChangeCallback? onChanged, EasyFormFieldSaveCallback<T>? onSave, EasyFormFieldSavedCallback<T?>? onSaved, EasyAutovalidateMode autovalidateMode = EasyForm.defaultAutovalidateMode, Map<String, String?>? errors, Duration scrollToFieldDuration = EasyForm.defaultScrollToFieldDuration, Curve scrollToFieldCurve = EasyForm.defaultScrollToFieldCurve})
Creates a container for form fields.

Properties

adaptivity EasyFormAdaptivity
The mode of adaptability of form elements, in which design system the form elements will be displayed: Material, Apple, or will be automatically determined based on the platform.
finalinherited
autovalidateMode EasyAutovalidateMode
Used to enable/disable form fields auto validation and update their error text.
finalinherited
child Widget
The widget below this widget in the tree.
finalinherited
errors Map<String, String?>?
Sets errors in fields as a Map, where key is the name of the field and value is the text of the error message.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged EasyFormChangeCallback?
Called when one of the form fields changes.
finalinherited
onSave EasyFormFieldSaveCallback?
Called when the form is being saved using the save method or the EasyFormSaveButton button.
finalinherited
onSaved EasyFormFieldSavedCallback?
Called after the onSave callback completes, the result from onSave is passed to onSaved as a parameter.
finalinherited
onWillPop WillPopCallback?
Enables the form to veto attempts by the user to dismiss the ModalRoute that contains the form.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollToFieldCurve Curve
Scroll curve to field with error.
finalinherited
scrollToFieldDuration Duration
Duration of scrolling to the error field.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() EasyDataFormState<T>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited