match static method

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

Match another field

Implementation

static String? Function(String?) match(String Function() getValue, [String? message]) {
  return (value) {
    if (value == null || value.isEmpty) return null;
    if (value != getValue()) {
      return message ?? 'Fields do not match';
    }
    return null;
  };
}