matches static method

String? Function(String) matches(
  1. String getValue(), {
  2. String message = 'Values do not match.',
})

Validates that the input matches a confirmation value.

Implementation

static String? Function(String) matches(
  String Function() getValue, {
  String message = 'Values do not match.',
}) {
  return (value) {
    if (value != getValue()) return message;
    return null;
  };
}