customRule<T> function

Rule<T> customRule<T>(
  1. bool mapper(
    1. T? object
    ),
  2. String field,
  3. String message
)

Implementation

Rule<T> customRule<T>(
  bool Function(T? object) mapper,
  String field,
  String message,
) {
  return Rule<T>(
    Reason(field, message),
    (object) => mapper(object),
  );
}