Show popup message after ad helper ads show in flutter android studio

15 views Asked by At
AdHelper.showRewardedAd(onComplete: () async {
   await VpnEngine.startVpn(vpnConfig);
});
}

AdHelper.showInterstitialAd(onComplete: () async {
   await VpnEngine.stopVpn();
});

}

showDialog(
      context: context,
      builder: (context) {
         return AlertDialog(
               title: Text('Need a hint?'),
               content: Text('Watch an Ad to get a hint!'),
               actions: [
                  TextButton(
                     child: Text('cancel'.toUpperCase()),
                     onPressed: () {
                        Navigator.pop(context);
                     },
                  ),
                  TextButton(
                     child: Text('ok'.toUpperCase()),
                     onPressed: () {
                        AdHelper.showRewardedAd(onComplete: () async {
                           await VpnEngine.startVpn(vpnConfig);
                        });
                     }

                     AdHelper.showInterstitialAd(onComplete: () async {
                        await VpnEngine.stopVpn();
                     });

                  }
0

There are 0 answers