BUG: MIH Ad Display Strategy
This commit is contained in:
parent
52f9eb7ba6
commit
1329c8aba4
9 changed files with 47 additions and 52 deletions
|
|
@ -12,10 +12,28 @@ class MihBannerAd extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MihBannerAdState extends State<MihBannerAd> {
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
MihBannerAdProvider adProvider = context.read<MihBannerAdProvider>();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
adProvider.reset();
|
||||
adProvider.loadBannerAd();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<MihBannerAdProvider>(
|
||||
builder: (context, bannerAdProvider, child) {
|
||||
if (!bannerAdProvider.isBannerAdLoaded) {
|
||||
return SizedBox();
|
||||
}
|
||||
return Column(
|
||||
children: [
|
||||
bannerAdProvider.bannerAd != null &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue