EasyAutoForm class
A widget that generates a form based on a given entity.
The EasyAutoForm
widget is designed to work with any entity that is represented as a Map<String, dynamic>
.
This means that it can be used with a wide variety of data types, including but not limited to:
- User profiles
- Product listings
- Blog posts
- Contact information
- Survey responses
The EasyAutoForm
widget will generate input fields for each key in the entity map, and will automatically determine the appropriate input type based on the value type.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- EasyAutoForm
Constructors
-
EasyAutoForm({Key? key, required GlobalKey<
FormState> formKey, required Map<String, dynamic> entity, bool entityAsMock = false, List<String> ? fieldsToIgnore, required dynamic onSave(dynamic entityResult)?, InputDecoration? stringInputDecorationOverride, InputDecoration? intInputDecorationOverride, InputDecoration? doubleInputDecorationOverride, InputDecoration? dateTimeInputDecorationOverride, InputDecoration? selectInputDecorationOverride, InputDecoration? autocompleteInputDecorationOverride, dynamic onCancel()?, FieldsSettings? fieldsSettings, RunDirection? runDirection = RunDirection.vertical, AutovalidateMode? autovalidateMode = AutovalidateMode.disabled, void onFormChanged(Map<String, TextEditingController> controllers)?, Future<bool> onFormWillPop()?, bool showDialogOnWillPop = false, bool expanded = true}) -
const
Properties
- autocompleteInputDecorationOverride → InputDecoration?
-
A decoration to apply to all autocomplete input fields.
final
- autovalidateMode → AutovalidateMode?
-
The autovalidate mode to use for the form.
final
- dateTimeInputDecorationOverride → InputDecoration?
-
A decoration to apply to all DateTime input fields.
final
- doubleInputDecorationOverride → InputDecoration?
-
A decoration to apply to all double input fields.
final
-
entity
→ Map<
String, dynamic> -
The entity to generate the form for.
final
- entityAsMock → bool
-
Whether to use a copy of the entity as a mock or the original entity.
final
- expanded → bool
-
Whether to expand the form to fill the available space.
final
- fieldsSettings → FieldsSettings?
-
A list of settings to apply to each field.
final
-
fieldsToIgnore
→ List<
String> ? -
A list of field names to ignore when generating the form.
final
-
formKey
→ GlobalKey<
FormState> -
A key that uniquely identifies the form.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- intInputDecorationOverride → InputDecoration?
-
A decoration to apply to all int input fields.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onCancel → dynamic Function()?
-
A function to call when the form is cancelled.
final
-
onFormChanged
→ void Function(Map<
String, TextEditingController> controllers)? -
A function to call when the form is changed.
final
-
onFormWillPop
→ Future<
bool> Function()? -
A function to call when the form is about to be popped.
final
- onSave → dynamic Function(dynamic entityResult)?
-
A function to call when the form is saved.
final
- runDirection → RunDirection?
-
The direction to run the form fields in.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectInputDecorationOverride → InputDecoration?
-
A decoration to apply to all select input fields.
final
- showDialogOnWillPop → bool
-
Whether to show a dialog when the form is about to be popped.
final
- stringInputDecorationOverride → InputDecoration?
-
A decoration to apply to all string input fields.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< EasyAutoForm> -
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