matchValidator function

String? matchValidator(
  1. String value,
  2. String matchValue
)

Validates if the input value matches another value.

Implementation

String? matchValidator(String value, String matchValue) {
  if (value.trim() != matchValue.trim()) {
    return 'The values do not match.';
  }
  return null;
}