matchValidator function
Validates that the value matches another value (for password confirmation).
Implementation
String? Function(String?) matchValidator(String otherValue, String fieldName) {
return (value) {
if (value == null || value != otherValue) {
return '$fieldName does not match';
}
return null;
};
}