onValidation method

void onValidation(
  1. dynamic onValid(
    1. F form
    )
)

Validate form and if is valid, call method and emit new state from parent

Implementation

void onValidation(Function(F form) onValid) {
  if (this case FormuxValidEvent event) {
    bool valid = form.valid();

    if (valid) {
      onValid.call(form);
    }

    event.updater();
  }
}