FormBody<E extends FormErrors> class
abstract
A container for a collection of form fields.
Used in conjunction with the shape_generator
package to generate a form
from a set of FormFields.
The generic type E
represents the type of the error container when
calling validate.
@GenerateFormBody()
abstract class RegistrationFormBody
extends FormBody<RegistrationFormErrors>
with _$RegistrationFormBodyFields {
factory RegistrationFormBody({
required String username,
required String age,
}) {
return _$RegistrationFormBody(
username: GenericFormField(
value: username,
isRequired: true,
),
age: AgeFormField(
value: age,
),
);
}
const RegistrationFormBody._();
}
Constructors
- FormBody()
-
A container for a collection of form fields.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
) → E - Validates all the fields in this form.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited