GateResult class final
A single resolved ability check outcome, cached by GateManager.
GateResult is the snapshot that GateManager.lastResult returns. It
records what was asked (ability), what was answered (allowed), the
runtime type of the argument that was passed to the check (or null
when no argument was supplied), and when the check ran. The class is
intentionally a thin value-bag with no behaviour — the cache layer
owns retention and eviction.
The dusk integration's magicGateResultEnricher reads this through
Gate.manager.lastResult(...) to surface the most recent gate decision
in the snapshot YAML.
Usage
final result = Gate.manager.lastResult('monitors.update');
if (result != null && result.allowed) {
// The most recent check for this ability passed.
}
Constructors
- GateResult({required String ability, required bool allowed, Type? argumentType, required DateTime checkedAt})
-
Create a result snapshot.
const
Properties
- ability → String
-
The ability name that was checked (e.g.
'monitors.update').final - allowed → bool
-
Whether the check resolved as allowed.
final
- argumentType → Type?
-
The runtime Type of the argument passed to the check, or
nullwhen the check ran without an argument.final - checkedAt → DateTime
-
The wall-clock instant at which the check was recorded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited