SmartFormController class final

Imperative access to a mounted smart form.

Constructors

SmartFormController()

Properties

hashCode int
The hash code for this object.
no setterinherited
isAttached bool
Whether this controller is attached to a mounted form.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values Map<String, Object?>
Returns an immutable snapshot of current registered field values.
no setter

Methods

attach(SmartFormControllerDelegate delegate) → void
Attaches this controller to a mounted form delegate.
clearErrors() → void
Clears all validation and server errors.
detach(SmartFormControllerDelegate delegate) → void
Detaches delegate when it is the currently attached form.
dispose() → void
Releases this controller.
focusField(String name) Future<void>
Scrolls to and focuses field name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patchValue(Map<String, Object?> values) → void
Changes multiple field values after validating every supplied name.
reset() → void
Restores every field to its initial value and clears its state.
scrollToField(String name) Future<void>
Scrolls field name into view without changing focus.
setErrors(Map<String, String> errors, {bool scrollToFirstError = false}) Future<void>
Applies backend errors and optionally scrolls to the first one.
setFieldError(String name, String error) → void
Applies error to field name.
setValue<T>(String name, T? value) → void
Changes the value of field name.
toString() String
A string representation of this object.
inherited
validate({bool? scrollToError, bool? focusFirstError}) Future<SmartFormResult>
Validates every enabled field and optionally navigates to the first error.
valueOf<T>(String name) → T?
Returns field name as T, or null when its value is null.

Operators

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