I am using firebase_admob package. I use the following code and manage to make the Admob banner show on top of keyboard.
@override
Widget build(BuildContext context) {
myBanner.show(
anchorOffset: MediaQuery.of(context).viewInsets.bottom, anchorType: AnchorType.bottom)
);
return Scaffold(
//Other codes
);
}
However, when the keyboard is closed, the banner won't move to bottom. How to solve this?
Problem solved by using [admob_flutter]
package which can simply add the banner as a widget and we can position it anywhere we want.
AdmobBanner(
adUnitId: getBannerAdUnitId(),
adSize: AdmobBannerSize.BANNER,
)