required static method
Implementation
static Validator required([bool strict = false]) {
return (String? value) {
if ((value?.isEmpty ?? true)) {
return "Field cannot be empty.";
} else if (strict && !(value?.containNameChars() ?? true)) {
return "Invalid character(s) found.";
}
return null;
};
}