Hi here is the validator for textfield, but I assumed my user is non english speaker, so is there a way to include other language:
validateFolderName(value) {
if (value == null || value.isEmpty) {
return 'sorry, name could not be empty';
} else if (!InputValidators.nameValidate(value)) {
return 'only alphabets and numbers only';
} else if (value.length >= 20) {
return 'sorry, name could not be too long';
}
return null;
}
class InputValidators {
static bool nameValidate(String value) {
return RegExp(r'^[a-zA-Z0-9]+$').hasMatch(value);
}
}
thank you for any clues!