requiredValidator static method

String? Function(String?)? requiredValidator(
  1. String? requiredError
)

Implementation

static String? Function(String?)? requiredValidator(String? requiredError) => (value) {
  if (value != null && value.trim() != '') {
      return null;
    }
    return requiredError ?? 'Required field.';
};