RefineRule<T> class
Rule made by .refine() and .refineAsync().
Constructors
-
RefineRule({CheckFunction<
T> ? check, AsyncCheckFunction<T> ? asyncCheck, String? message, String code = IssueCodes.custom, List<Object> extraPath = const <Object>[]})
Properties
- code → String
-
Issue code.
final
- defaultMessage → String
-
Message template used when no custom message is set.
no setteroverride
-
extraPath
→ List<
Object> -
Path added after the current path, like
['password_confirmation'].final - hashCode → int
-
The hash code for this object.
no setterinherited
- isAsync → bool
-
truewhen the rule needs checkAsync. Then useparseAsync.no setteroverride - message → String?
-
Custom message for this rule. It wins over every other message.
finalinherited
- name → String
-
Rule name. Also used as the issue code.
no setteroverride
-
params
→ Map<
String, Object?> -
Values for the message placeholders, like
{'min': 3}.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
apply(
T value, RuleContext context) → bool -
Run the rule and add an issue when it fails. Returns
trueon pass.override -
applyAsync(
T value, RuleContext context) → Future< bool> -
Async version of apply.
override
-
check(
T value, RuleContext context) → bool -
Return
truewhenvalueis valid.override -
checkAsync(
T value, RuleContext context) → Future< bool> -
Async version of check. The default calls check.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJsonSchema(
) → Map< String, dynamic> -
Extra JSON Schema keys, like
{'format': 'email'}.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited