feat(form): add shorthands to access validator status
This commit is contained in:
parent
3a8a604a48
commit
141f15b444
@ -144,6 +144,15 @@ class WyattFormImpl extends WyattForm {
|
|||||||
WyattForm operationWith(FormOperation operation, WyattForm other) =>
|
WyattForm operationWith(FormOperation operation, WyattForm other) =>
|
||||||
operation.call(this, other);
|
operation.call(this, other);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool isPureInput(String key) => inputOf(key).validator.pure;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool isValidInput(String key) => inputOf(key).validator.valid;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool isInvalidInput(String key) => inputOf(key).validator.invalid;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [_inputs, _name, _validator];
|
List<Object?> get props => [_inputs, _name, _validator];
|
||||||
|
|
||||||
|
@ -58,4 +58,8 @@ abstract class WyattForm extends Equatable {
|
|||||||
WyattForm clone();
|
WyattForm clone();
|
||||||
WyattForm operationWith(FormOperation operation, WyattForm other);
|
WyattForm operationWith(FormOperation operation, WyattForm other);
|
||||||
WyattForm reset();
|
WyattForm reset();
|
||||||
|
|
||||||
|
bool isPureInput(String key);
|
||||||
|
bool isValidInput(String key);
|
||||||
|
bool isInvalidInput(String key);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user