match static method

String? match(
  1. String? value,
  2. String? otherValue, {
  3. String fieldName = 'Fields',
})

Validates that two fields are equal (e.g., password and confirm password).

Implementation

static String? match(
  String? value,
  String? otherValue, {
  String fieldName = 'Fields',
}) {
  if (value == null || otherValue == null) return '$fieldName are required';
  if (value != otherValue) return '$fieldName do not match';
  return null;
}