The method 'AdListener' isn't defined for the type 'NavigationCounter'

Viewed 142

After updating google_mobile_ads 13.0 getting error. The method 'AdListener' isn't defined for the type 'NavigationCounter'.

    listener = AdListener(
  // Called when an ad is successfully received.
  onAdLoaded: (Ad ad) {
    //appLockService.disable();
    googleLoad = true;
  },
  // Called when an ad request failed.
  onAdFailedToLoad: (Ad ad, LoadAdError error) {
    print('Ad failed to load: $error');
    //googleLoad = false;
    myInterstitial.dispose();
    //appLockService.unlockScreen();
    //myInterstitial.load();
  },
  // Called when an ad opens an overlay that covers the screen.
  onAdOpened: (Ad ad) => print('Ad opened.'),
  // Called when an ad removes an overlay that covers the screen.
  onAdClosed: (Ad ad) async {
    await isPurchasedFunc();
    print('Ad closed.');
    _adCount++;
    googleLoad = false;
    myInterstitial.dispose();

    if (_adCount == 1) {
      print("isPurchased: $isPurchased & openCount:$openCount");
      if ((isPurchased == null || isPurchased == false) &&
          (openCount == 2 || openCount == 4)) {
        inAppDialog(context);
      }
    }
 
  },
  // Called when an ad is in the process of leaving the application.
  onApplicationExit: (Ad ad) => print('Left application.'),
);

stuck on listener = AdListener()

0 Answers
Related