FakeFullScreenAdHandle class

A drivable fake full-screen ad handle.

Implements every full-screen handle interface so one fake serves all four formats.

Implemented types

Constructors

FakeFullScreenAdHandle(String adUnitId)
Creates a fake handle for adUnitId.

Properties

adUnitId String
The ad unit this ad was loaded for.
final
autoEmitShowed bool
Whether show automatically emits AdShowedEvent (default true). Turn off to drive the showed event manually.
getter/setter pair
contentEvents Stream<FullScreenAdEvent>
Show/dismiss/impression/click events for this ad.
no setteroverride
disposed bool
Whether dispose has been called.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
lastOnUserEarnedReward OnUserEarnedReward?
The reward callback passed to the most recent show.
getter/setter pair
paidEvents Stream<AdPaidEvent>
Impression-level revenue events (allowlisted accounts only).
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCalls int
Number of show calls (an SDK-faithful controller never exceeds 1).
getter/setter pair
showError AdFlowError?
If set, show emits AdFailedToShowEvent with this error instead of AdShowedEvent.
getter/setter pair
showRejectsWith Object?
If set, show throws this instead of completing normally — simulates the real plugin's Ad.show() Future rejecting (ad already released, channel error, mediation failure), which the documented AdSdk.show contract says should never happen (failures are meant to arrive via AdFailedToShowEvent on contentEvents instead) but a real implementation can still violate. Controllers must be robust to this regardless of what the contract promises.
getter/setter pair

Methods

dispose() Future<void>
Releases the underlying platform ad.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
show({OnUserEarnedReward? onUserEarnedReward}) Future<void>
Shows the ad. Show failures are reported via contentEvents as AdFailedToShowEvent, mirroring the underlying SDK.
override
simulateClicked() → void
Emits AdClickedEvent.
simulateDismissed() → void
Emits AdDismissedEvent. Throws StateError if show was never called — the real SDK never dismisses an ad that was never shown.
simulateImpression() → void
Emits AdImpressionEvent.
simulatePaid(AdPaidEvent event) → void
Emits a paid event.
simulateReward(RewardEarned reward) → void
Invokes the reward callback captured by show. Throws StateError if the ad has already been dismissed — a reward can't arrive after the ad's lifecycle has ended.
simulateShowed() → void
Emits AdShowedEvent (for tests with autoEmitShowed off).
toString() String
A string representation of this object.
inherited

Operators

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