match static method

String? match(
  1. String? value,
  2. String? otherValue, {
  3. String? message,
})

Validates that two values match

Example:

Validators.match(password, confirmPassword);

Implementation

static String? match(String? value, String? otherValue, {String? message}) {
  if (value == null || value.isEmpty) return null;
  if (value != otherValue) {
    return message ?? 'Values do not match';
  }
  return null;
}