canShow property

  1. @override
bool get canShow
override

Whether show would show an ad right now: one is warm and unexpired, ads are enabled, no other full-screen ad is on screen, and the frequency caps and pacing allow it (6.0).

A synchronous HINT for UI — enable a "Watch ad" button, or decide whether to pause at a natural break for an interstitial. It replaces mirroring the caps in app code. show re-checks everything (including live consent) and remains the only authority.

A warm ad found expired here is replaced (in a microtask): the expiry timer runs on a clock that stops while the device sleeps, and an app that only calls show when this is true would otherwise never trigger the replacement show performs.

Implementation

@override
bool get canShow {
  if (_disposed || !isReady) return false;
  if (isExpired) {
    scheduleMicrotask(_replaceIfExpired);
    return false;
  }
  return _gate.isEnabled &&
      !_coordinator.isFullScreenAdVisible &&
      _caps.allowsNow(slot) &&
      canShowExtra();
}