fieldValidator method
Builds a single-field validator for Flutter TextFormField.validator.
readValues should return the current full form snapshot so cross-field
rules (e.g. password confirmation) can run correctly.
Implementation
String? Function(String?) fieldValidator(
String fieldPath,
Map<String, dynamic> Function() readValues,
) {
return (_) => errorFor(fieldPath, readValues());
}