Last updated:
0 purchases
functional admob flutter
functional_admob_flutter #
Functional Admob Flutter
Introduction #
This project is a functional version of the admob_flutter,
First of all, you have to follow admob_flutter setup. #
from here
One line functional Usage #
FunctionalAdmob.interstitial
import 'package:functional_admob_flutter/functional_admob.dart';
copied to clipboard
await FunctionalAdmob.interstitial(adUnitId: 'adUnitId');
copied to clipboard
FunctionalAdmob.reward
import 'package:functional_admob_flutter/functional_admob.dart';
copied to clipboard
await FunctionalAdmob.reward(adUnitId: 'adUnitId');
copied to clipboard
FunctionalAdmob.banner (for your convenience)
import 'package:functional_admob_flutter/functional_admob.dart';
copied to clipboard
Column(
children: [
FunctionalAdmob.banner(adUnitId: 'adUnitId', AdmobBannerSize.BANNER),
]
)
copied to clipboard
Detailed Functional Usage #
FunctionalAdmobInterstitial
import 'package:functional_admob_flutter/functional_admob_interstitial.dart';
copied to clipboard
Future _demoFunctionalInterstitial() async {
final interstitialAd = FunctionalAdmobInterstitial(
adUnitId: getInterstitialAdUnitId(),
);
if (!await interstitialAd.load()) throw 'Failed to load interstitial Ad';
await interstitialAd.show();
}
copied to clipboard
FunctionalAdmobReward
import 'package:functional_admob_flutter/functional_admob_reward.dart';
copied to clipboard
Future _demoFunctionalReward() async {
final rewardAd = FunctionalAdmobReward(
adUnitId: getRewardBasedVideoAdUnitId(),
);
if (!await rewardAd.load()) throw 'Failed to load reward Ad';
final result = await rewardAd.show();
if (result != null) {
_dialogRewarded(result);
print('Type: ${result['type']}');
print('Amount: ${result['amount']}');
} else {
print('failed to get reward!');
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.