custom static method

Rule custom(
  1. FutureOr<String?> check(
    1. ValidationContext context
    ), {
  2. String name = 'custom',
})

A rule of your own: check returns an error message, or null when the value passes; name keys its translations.

Implementation

static Rule custom(
  FutureOr<String?> Function(ValidationContext context) check, {
  String name = 'custom',
}) => ClosureRule(check, name: name);