-
Banner
- Auto config and load for you
- Load safety with interval
-
Interstitial
- Load and show safety with interval
flutter pub add flutter_good_ads
and
import 'package:flutter_good_ads/flutter_good_ads.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
MobileAds.instance.initialize();
runApp(MyApp());
}
Put this block everywhere you want
GoodBanner(
adUnitId: 'ca-app-pub-3940256099942544/6300978111',
adRequest: AdRequest(),
interval: 60000,
adSize: AdSize.banner,
)
- Declare a GoodInterstitial
final interstitialAd = const GoodInterstitial(
adUnitId: 'ca-app-pub-3940256099942544/8691691433',
adRequest: AdRequest(),
interval: 60000,
);
- Call load() at somewhere (ex: initState)
@override
void initState() {
super.initState();
interstitialAd.load();
}
- Call show() when you want
if (_counter % 5 == 0) {
interstitialAd.show(reloadAfterShow: true);
}