firstName static method
FormFieldValidator that requires the field's value to be a valid first name.
Parameters:
regex
The regex pattern to match.firstNameWhitelist
The list of allowed first names.firstNameBlacklist
The list of disallowed first names.errorText
The error message when the first name is invalid.checkNullOrEmpty
Whether to check for null or empty values.
Implementation
static FormFieldValidator<String> firstName({
RegExp? regex,
List<String> firstNameWhitelist = const <String>[],
List<String> firstNameBlacklist = const <String>[],
String? errorText,
bool checkNullOrEmpty = true,
}) => FirstNameValidator(
regex: regex,
firstNameWhitelist: firstNameWhitelist,
firstNameBlacklist: firstNameBlacklist,
errorText: errorText,
checkNullOrEmpty: checkNullOrEmpty,
).validate;