ValidationContext class final
Everything a Rule needs to evaluate one attribute (BLUEPRINT_V2 §7.4.1).
Constructors
-
ValidationContext({required String attribute, required String pattern, required Object? value, required bool present, required Map<
String, Object?> data, Container? container, String locale = 'en', bool numeric = false, Set<String> booleans = const <String>{}, Map<String, String> attributeNames = const <String, String>{}}) -
The context of
attribute(the concrete path, such asitems.2.id), matched by the rule keypattern, whosevaluewaspresentindata.const
Properties
- attribute → String
-
Concrete attribute path (
items.2.id).final -
attributeNames
→ Map<
String, String> -
The custom attribute names of this validation.
final
-
booleans
→ Set<
String> -
The attributes with a
booleanrule (Laravel'sshouldConvertToBoolean).final - container → Container?
-
Container for rules that need services (
unique,exists).final -
data
→ Map<
String, Object?> -
The complete input.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale → String
-
Locale used for messages.
final
- numeric → bool
-
Whether the attribute also carries a
numericorintegerrule, so size rules (min,max,between,size) measure a string by its numeric value, as Laravel does.final - pattern → String
-
Rule key as written (
items.*.id).final - present → bool
-
Whether the attribute key exists in the input.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → Object?
-
Current value (
nullwhen absent).final
Methods
-
displayName(
String attribute) → String -
attributeas a message shows it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
root(
String path) → Object? - Looks up another attribute by dot path from the root.
-
sibling(
String key) → Object? -
Looks up a sibling of the current attribute (
items.2.qtyfromitems.2.idwhenkeyisqty). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited