FullScreenAdCoordinator class

Single source of truth for "is a full-screen ad on screen right now?".

Injected (never static — v1 trap #6) into every full-screen controller and the app-open manager, so an app-open ad can never fire over an interstitial and vice versa.

Constructors

FullScreenAdCoordinator({DateTime now()?})
Creates a coordinator. now is an injectable clock (tests only) for lastExitAt.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isFullScreenAdVisible → bool
Whether a full-screen ad is currently showing.
no setter
lastExitAt → DateTime?
When the last full-screen ad (of any format) exited, or null if none has yet this session. Consulted by AppOpenAdManager to avoid showing an app-open ad immediately behind another format's dismiss (review finding #7) — purely informational otherwise, and does not affect tryEnter/isFullScreenAdVisible at all.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
visible → ValueListenable<bool>
Reactive view of isFullScreenAdVisible.
no setter

Methods

consumeViewAdOpened() → bool
Reads and clears the noteViewAdOpened latch.
dispose() → void
Releases the notifier.
enter() → void
Marks a full-screen ad as visible. Must be balanced by exit.
exit() → void
Marks the full-screen ad as gone. Call from dismiss AND fail-to-show handlers. Unbalanced calls are clamped at zero (defensive: a missed enter must never wedge suppression on).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
noteViewAdClosed() → void
Records the ad's onAdClosed — the user left the ad's overlay/landing page (2026-07 audit).
noteViewAdOpened() → void
Records that a banner/native ad was opened or clicked, so the foreground event that follows is understood as a return FROM THAT AD (ADR-042).
toString() → String
A string representation of this object.
inherited
tryEnter() → bool
Atomically checks isFullScreenAdVisible and claims the coordinator in one synchronous step — no await between the check and the entry.

Operators

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

Constants

viewAdCloseGrace → const Duration
How long the noteViewAdOpened latch survives after noteViewAdClosed. See noteViewAdClosed for why this exists and why it is short.