show method
Show the ad. It must be loaded in order to be showed.
You can use the load()
method to load it
Make sure to check if the ad is avaiable using the getter isAvaiable
void showIfAvaiable() {
if (isAvaiable) appOpenAd.show();
else {
await appOpenAd.load();
showIfAvaiable();
}
}
For more info, read the documentation
Implementation
Future<bool> show() async {
ensureAdNotDisposed();
assertMobileAdsIsInitialized();
ensureAdAvailable();
return (await channel.invokeMethod<bool>('showAd'))!;
}