match static method

String? Function(String?) match(
  1. String valueToMatch, [
  2. String? message
])

Returns a validator that checks whether a field matches another field's value.

Implementation

static String? Function(String?) match(String valueToMatch,
    [String? message]) {
  return (value) {
    if (value != valueToMatch) return message ?? 'Values do not match';
    return null;
  };
}