admob on flutter difference between iOS and Android

Viewed 20

admob on iOS

admob on Android

The ad code is below

  final BannerAd myBanner = BannerAd(
    adUnitId: bannerAdUnitID,
    size: AdSize.banner,
    request: const AdRequest(),
    listener: BannerAdListener(
      onAdFailedToLoad: (ad, _) {
        // Dispose the ad here to free resources.
        ad.dispose();
      },
    ),
  );


StaggeredGridTile.count(
  crossAxisCellCount: 2,
  mainAxisCellCount: 2,
  child: Material(
    color: Colors.grey[100],
    elevation: 2,
    borderRadius: BorderRadius.circular(12),
    shadowColor: Colors.blueGrey.shade50,
    child: InkWell(
      onTap: () {},
      child: Container(
        padding: const EdgeInsets.all(25),
        alignment: Alignment.center,
        child: AdWidget(ad: myBanner),
      ),
    ),
  ),
)

In iOS it can autosize to a square by its parent Container. But in Android the shape is still keeping banner.

How do I let the Ad in Android behave like iOS?

0 Answers
Related