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})
const

Properties

attribute → String
Concrete attribute path (items.2.id).
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 numeric or integer rule, 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 (null when absent).
final

Methods

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.qty from items.2.id when key is qty).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

dig(Object? source, String path) → Object?
Dot-path lookup supporting list indexes.
exists(Object? source, String path) → bool
Whether path exists in source (a null value still counts).