0 purchases
dktech admob
Example #
https://github.com/Namdh1212/flutter-admob/tree/devlopment
configuration Admoblib #
void initState() {
AdmodUtils.configurationAdmob(isDebug: true, isShowAds: true);
}
copied to clipboard
AppOpenAd #
void initState() {
AdmodUtils.loadAppOpenAd();
}
copied to clipboard
Interstitial #
AdmodUtils.loadAndShowAdInterstitialWithCallback(
Androidid:
"ca-app-pub-3940256099942544/1033173712",
IOSid: "ca-app-pub-3940256099942544/4411468910",
enableLoadingDialog: true,
onAdClosed: () {
Fluttertoast.showToast(msg: "onAdClose");
},
onAdFail: () {
Fluttertoast.showToast(msg: "onAdFail");
});
copied to clipboard
Reward #
AdmodUtils.loadAndShowAdRewardWithCallback(
Androidid:
"ca-app-pub-3940256099942544/1033173712",
IOSid: "ca-app-pub-3940256099942544/4411468910",
enableLoadingDialog: true,
onAdClosed: () {
Fluttertoast.showToast(msg: "onAdClose");
// if(onUserEarned) ... else ...
},
onUserEarned: () {
Fluttertoast.showToast(msg: "onUserEarned");
// onUserEarned = true
},
onAdFail: () {
Fluttertoast.showToast(msg: "onAdFail");
// if(onUserEarned) ... else ...
});
copied to clipboard
Banner #
void initState() {
AdmodUtils.loadAdBanner(
Androidid: 'ca-app-pub-3940256099942544/6300978111',
IOSid: 'ca-app-pub-3940256099942544/2934735716',
onAdLoaded: () {
setState(() {
Fluttertoast.showToast(msg: "onAdLoaded "
"Banner");
});
},
onAdFailed: () {
setState(() {
Fluttertoast.showToast(msg: "onAdFailed Banner");
//gone view
});
},
context: context);
}
copied to clipboard
add to view
AdmodUtils().getAdWidget()
copied to clipboard
Native #
AdmodUtils.loadNativeAd(
Androidid: "ca-app-pub-3940256099942544/2247696110",
IOSid: "ca-app-pub-3940256099942544/2247696110",
onAdLoaded: () {
setState(() {
Fluttertoast.showToast(msg: "onAdLoaded native");
AdmodUtils.isNativeAdLoaded = true;
});
},
onAdFailed: () {
setState(() {
Fluttertoast.showToast(msg: "onAdFailed native");
});
});
copied to clipboard
add to view
AdmodUtils.isNativeAdLoaded ? Container(
alignment: Alignment.center,
child: AdWidget(ad: AdmodUtils.adNative),
width: MediaQuery.of(context).size.width,
height: 500,
) : Container()
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.