FormzMixin mixin

Mixin that automatically handles validation of all FormzInputs present in the inputs.

When mixing this in, you are required to override the inputs getter and provide all FormzInputs you want to automatically validate.

class LoginFormState with FormzMixin {
 LoginFormState({
   this.username = const Username.pure(),
   this.password = const Password.pure(),
 });

 final Username username;
 final Password password;

 @override
 List<FormzInput> get inputs => [username, password];
}

Properties

isValid bool
Whether the FormzInput values are all valid.
no setter
isNotValid bool
Whether the FormzInput values are not all valid.
no setter
isPure bool
Whether all of the FormzInput are pure.
no setter
isDirty bool
Whether at least one of the FormzInputs is dirty.
no setter
inputs List<FormzInput>
Returns all FormzInput instances.
no setter
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

Operators

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