Last active
July 11, 2020 06:40
-
-
Save Anirudhk07/e04d17884fd2ecbbb619bf8ed30d4f62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _GameRouteState extends State<GameRoute> implements QuizEventListener { | |
... | |
// TODO: Add _interstitialAd | |
InterstitialAd _interstitialAd; | |
// TODO: Add _isInterstitialAdReady | |
bool _isInterstitialAdReady; | |
... | |
// TODO: Implement _loadInterstitialAd() | |
void _loadInterstitialAd() { | |
_interstitialAd.load(); | |
} | |
// TODO: Implement _onInterstitialAdEvent() | |
void _onInterstitialAdEvent(MobileAdEvent event) { | |
switch (event) { | |
case MobileAdEvent.loaded: | |
_isInterstitialAdReady = true; | |
break; | |
case MobileAdEvent.failedToLoad: | |
_isInterstitialAdReady = false; | |
print('Failed to load an interstitial ad'); | |
break; | |
case MobileAdEvent.closed: | |
_moveToHome(); | |
break; | |
default: | |
// do nothing | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment