isValid method

  1. @override
FutureOr<bool> isValid(
  1. BuildContext context
)
override

Called when the user presses the next button This method can have side effects, such as calling the markAllAsTouched method on a FormGroup

Implementation

@override
FutureOr<bool> isValid(BuildContext context) {
  final control = _getControl(context);
  if (!control.valid) {
    if (markAllAsTouchedIfInvalid) {
      control.markAllAsTouched();
    }
    return false;
  }
  return true;
}