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:

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 displaying and 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