PresentationController class
The write face of a presentation: the half only the hosting core holds.
One object, two types — exactly as Completer/Future does. Core creates,
emits and settles here; the plugin gets presentation and can only read,
subscribe and cancel. Without the split a plugin could settle its own
presentation, and the exactly-once guarantee would be a convention rather
than a fact.
The guarantees are enforced here, not by whoever calls in, so a fake host in a test inherits them for free:
- G1 settle takes effect exactly once; later calls are no-ops.
- G3 markDisplaying emits DisplayedSignal at most once, and never after settlement.
- G4 no signal is delivered after settlement. A ClickedSignal between releaseHold and settle is delivered — that window is the non-blocking case.
- G5 CampaignPresentation.cancel is idempotent and safe in any state.
- G8 CampaignPresentation.holdReleased settles exactly once and never after the outcome: settle releases the hold first if nothing already did, so a plugin can bind CEP unblock to it unconditionally.
Constructors
- PresentationController({required String id, required CEPTriggerPayload trigger, void onCancel(PresentationController controller)?})
- Creates a controller for one delivered trigger.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The core-minted presentation id. See CampaignPresentation.id.
final
- isHoldReleased → bool
-
Whether the CEP has already been told it may release its hold.
no setter
- isSettled → bool
-
Whether the terminal result has already been decided.
no setter
- presentation → CampaignPresentation
-
The read face, handed to the owning plugin.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → PresentationState
-
The current lifecycle phase.
no setter
- trigger → CEPTriggerPayload
-
The trigger as delivered.
final
Methods
-
emitClicked(
{String? elementId}) → void - Emits a ClickedSignal. A no-op once settled.
-
markDisplaying(
) → void -
Moves the presentation to
displayingand emits DisplayedSignal. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
releaseHold(
) → void - Frees the CEP's hold while the experience keeps running.
-
releaseHoldAtAcceptance(
) → void - Frees the CEP's hold at acceptance, before any impression.
-
settle(
PresentationOutcome outcome) → void -
Settles the presentation with its terminal
outcome. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited