FormMapper class

A FormMapper is used to bind field values to form elements

Available extensions

Constructors

FormMapper({required dynamic instance, bool twoWay = false})
Create a new FormMapper instance the source instance whose fields will be bound twoWay if true, modifications will immediately modify the instance

Properties

changes int
getter/setter pair
dirtyWidgets int
getter/setter pair
emitOnChange bool
getter/setter pair
emitOnDirty bool
getter/setter pair
eventStream StreamController<FormEvent>
final
hashCode int
The hash code for this object.
no setterinherited
instance ↔ dynamic
getter/setter pair
isDirty bool
no setter
isTouched bool
no setter
isValid bool
no setter
operations List<Operation<ValuedWidgetContext>>
final
path2Operation Map<String, Operation<ValuedWidgetContext>>
final
properties Map<String, TypeProperty>
final
rootProperty RootProperty?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transformer ↔ Transformer
getter/setter pair
twoWay bool
final
type ↔ TypeDescriptor
getter/setter pair

Methods

addDirty(int delta) → void
addListener(void onData(FormEvent event), {dynamic emitOnDirty = false, dynamic emitOnChange = false}) → void
bind(String name, {required String path, required BuildContext context, Keywords? args}) Widget
bind a field to a form element name the element name path a field path context the BuildContext args any parameters that will be passed to the newly created element
checkbox({required String path, required BuildContext context, required int min, required int max}) Widget

Available on FormMapper, provided by the CheckboxSlider extension

checkbox({required String path, required BuildContext context, required int min, required int max}) Widget

Available on FormMapper, provided by the CheckboxSlider extension

checkbox({required String path, required BuildContext context}) Widget

Available on FormMapper, provided by the CheckboxSlider extension

commit<T>() → T
commit all pending changes to the instance and return it
computeProperty(TypeDescriptor typeDescriptor, String path) TypeProperty
date({required String path, required BuildContext context, DateTime? firstDate, DateTime? lastDate, String? label, DateFormat? dateFormat}) Widget

Available on FormMapper, provided by the DatePickerFormFieldExtension extension

date({required String path, required BuildContext context, DateTime? firstDate, DateTime? lastDate, String? label, DateFormat? dateFormat}) Widget

Available on FormMapper, provided by the DatePickerFormFieldExtension extension

date({required String path, required BuildContext context, DateTime? firstDate, DateTime? lastDate, String? label, DateFormat? dateFormat}) Widget

Available on FormMapper, provided by the DatePickerFormFieldExtension extension

dispose() → void
findOperation(String path) → Operation<ValuedWidgetContext>?
findProperty(String path) TypeProperty
findWidget(String path) WidgetProperty?
getKey() GlobalKey<FormState>
return the GlobalKey of the form.
getValue<T>(TypeProperty property) → T
map({required TypeProperty property, required Widget widget, required ValuedWidgetAdapter adapter, DisplayValue displayValue = identity, ParseValue parseValue = identity}) → void
markDirty(bool dirty) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyChange({required TypeProperty property, required dynamic value}) → void
rollback() → void
rollback all changes
setValue(dynamic object) → void
set the instance that will provide values value an instance
slider({required String path, required BuildContext context, required int min, required int max}) Widget

Available on FormMapper, provided by the BindSlider extension

slider({required String path, required BuildContext context, required int min, required int max}) Widget

Available on FormMapper, provided by the BindSlider extension

slider({required String path, required BuildContext context, required int min, required int max}) Widget

Available on FormMapper, provided by the BindSlider extension

Switch({required String path, required BuildContext context}) Widget

Available on FormMapper, provided by the BindSwitch extension

Switch({required String path, required BuildContext context}) Widget

Available on FormMapper, provided by the BindSwitch extension

Switch({required String path, required BuildContext context}) Widget

Available on FormMapper, provided by the BindSwitch extension

text({required String path, required BuildContext context, String? prefix, String? placeholder, TextStyle? style, EdgeInsetsGeometry? padding}) Widget

Available on FormMapper, provided by the BindText extension

toString() String
A string representation of this object.
inherited
validate() bool
return True if the form is valid.

Operators

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