FormErrors<E extends FormBody> class
abstract
A container for a collection of form field validation errors.
Used in conjunction with the shape_generator
package to generate the
errors for a FormBody.
The generic type E
represents the type of the FormBody container that
this error represents.
Any classes extending FormErrors must override the errors getter and provide it all the errors that occurred during validation.
Use hasErrors
to determine if there are any errors in this container.
@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
- FormErrors()
-
A container for a collection of form field validation errors.
const
Properties
-
errors
→ List<
Object?> -
All validation errors in this container.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Indicates whether this container has no validation errors.
no setter
- isNotEmpty → bool
-
Indicates whether this container has any validation errors.
no setter
- 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited