Skip to content

Instantly share code, notes, and snippets.

@Anirudhk07
Last active July 11, 2020 06:40
Show Gist options
  • Save Anirudhk07/e04d17884fd2ecbbb619bf8ed30d4f62 to your computer and use it in GitHub Desktop.
Save Anirudhk07/e04d17884fd2ecbbb619bf8ed30d4f62 to your computer and use it in GitHub Desktop.
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