FrequencyEvaluator class

Frequency-capping core — pure, platform-free logic. Dart port of Android's FrequencyEvaluator, sharing the identical golden matrix across platforms. now and sessionId are injected so the logic is fully deterministic and unit-testable.

Properties

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

Static Methods

evaluate(FrequencyPolicy policy, FrequencyState? state, int now, String? sessionId) → FrequencyEvalResult
Pure eligibility check. Blocks if ANY active constraint is exceeded: permanent stop, lifetime total, or the current window. A campaign with no stored state has never been shown and is allowed.
recordShow(FrequencyPolicy policy, FrequencyState? state, int now, String? sessionId) → FrequencyState
Record one show on "Digia Experience Viewed". Bumps the lifetime total and the window count, re-anchoring the window when it has rolled over.
recordStop(FrequencyState? state, int now) → FrequencyState
Permanently stop the campaign on "Digia Experience Completed" when the policy opted into stopOn. Idempotent: the first stop timestamp wins.