flutter_google_ad_manager
flutter_google_ad_manager copied to clipboard
BottomNaviagation onTap conflict
I have a big issue that my app has BottomNaviagation and once i tapped on any item and the current Widget has DFPAdBanner partially appear on screen and the other under the BottomNaviagation onTap open DFPAdBanner click url of ads opened. this issue happened on iOS devices only. please check screenshot.
@besho I see it is the same as the https://github.com/ko2ic/flutter_google_ad_manager/issues/15 issue.
No, it isn't the same. i attached a screenshot. in case i clicked on any navigationBotton tab, the ad's click url opened in browser
@besho It seems the same to me. Can I try the Visibility widget?
@besho Today i'm facing the same problem. If the banner is behind the bottombar and you click on a bottombar item the link opens.
I dont know how to fix this with visibility. I haven't tried with the Stack class yet.
Hi @cschellhas
I fixed this issue by workaround solution for iOS Platforms only .I used VisibilityDetector to detect if the Ad-banner is fully visible or not and in case fully visible i show the ad-banner and in case not fully visible i hide the ad-banner. I will share with you the code below:-
double visibleFraction = 0; Container buildAdBanner() { return Platform.isAndroid ? Container(child:AddDFPBanner()) : Container(child: VisibilityDetector( key: Key("banner"), onVisibilityChanged: (VisibilityInfo info) { setState(() { visibleFraction = info.visibleFraction; }); }, child: Stack( children: <Widget>[ Center( child: Visibility(child: AddDFPBanner(),visible: visibleFraction ==1 ? true:false,), ), visibleFraction < 1.0 ? Center ( child: Container( height: 250, width: 300, ), ):Container() ], ))); }
Hope you try it and let me know your feedback
Hi @cschellhas
I fixed this issue by workaround solution for iOS Platforms only .I used VisibilityDetector to detect if the Ad-banner is fully visible or not and in case fully visible i show the ad-banner and in case not fully visible i hide the ad-banner. I will share with you the code below:-
double visibleFraction = 0; Container buildAdBanner() { return Platform.isAndroid ? Container(child:AddDFPBanner()) : Container(child: VisibilityDetector( key: Key("banner"), onVisibilityChanged: (VisibilityInfo info) { setState(() { visibleFraction = info.visibleFraction; }); }, child: Stack( children: [ Center( child: Visibility(child: AddDFPBanner(),visible: visibleFraction ==1 ? true:false,), ), visibleFraction < 1.0 ? Center ( child: Container( height: 250, width: 300, ), ):Container() ], ))); }
Hope you try it and let me know your feedback
Thank you very much. That solved it.
Great
@BeshoyAdelHemaya
Hi just want to say, it seems to be fixed in Flutter 1.20.1. Bottomnavigation works normal in my iOS App now.
Can you confirm?
I will check it and feedback you. Is it working with you ?