loadAndShowRewardInter static method
dynamic
loadAndShowRewardInter(
- BuildContext context,
- RewardHolder rewardHolder, {
- required dynamic onEarned(),
- required dynamic onAdClosed(),
- required dynamic onAdFail(),
Implementation
static loadAndShowRewardInter(BuildContext context, RewardHolder rewardHolder,
{required Function() onEarned,
required Function() onAdClosed,
required Function() onAdFail}) {
if (isTestDevice) {
onAdClosed();
Fluttertoast.showToast(
msg: "Is Test Device",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0);
return;
}
AdmobUtils.loadAndShowRewardedInterstitial(rewardHolder, onEarned: () {
onEarned();
Fluttertoast.showToast(
msg: "on Rewarded",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0);
}, onAdClosed: () {
onAdClosed();
Fluttertoast.showToast(
msg: "on Ad close",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0);
}, onAdFail: () {
onAdFail();
Fluttertoast.showToast(
msg: "ad fail",
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: Colors.red,
textColor: Colors.white,
fontSize: 16.0);
}, enableLoadingDialog: true);
}