validate method

  1. @override
String? validate(
  1. covariant String value
)
override

Validates the provided value.

Returns null if the value is valid; otherwise, returns a validation error message.

Implementation

@override
String? validate(covariant String value) {
  if (RegExp(pattern).hasMatch(value)) return null;

  return message;
}