tryValidate method
Validates the form field value
Implementation
@override
String? tryValidate() {
RegExp exp = RegExp(
r"^(?!0)(?!.*\.$)((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){4}$",
caseSensitive: false,
multiLine: false);
if (!exp.hasMatch(value)) {
if (customMessage == null) {
return buildMessage(ValidatorStrings.ip, attribute);
}
return customMessage;
}
return null;
}