tryEnter method
Atomically checks isFullScreenAdVisible and claims the coordinator
in one synchronous step — no await between the check and the entry.
This is the ONLY safe way for two independently-gated controllers
(e.g. interstitial + app open) to race for the coordinator: an
await-separated check-then-enter lets both controllers observe
"nothing is showing" before either has entered, so both proceed to
show. A plain synchronous method has no such window — Dart's
single-threaded event loop guarantees nothing else runs between this
method's check and its own enter call.
Implementation
bool tryEnter() {
if (isFullScreenAdVisible) return false;
enter();
return true;
}