required method

FormValidator required({
  1. String? nullError,
  2. String? emptyError,
})

Below are base case validatior functions, they are provided to cover most basic use cases that might be encountered.

They use the validation functions from StraingValidationFunctions to complete the actual validation

Adds StraingValidationFunctions.required to the function validation chain

Implementation

/// Adds [StraingValidationFunctions.required] to the function validation chain
FormValidator required({String? nullError, String? emptyError}) {
  return _chain((String? s) => StraingValidationFunctions.required(s,
      nullErrorMessage: nullError, emptyErrorMessage: emptyError));
}