kmcgill88 / admob_flutter

Admob Flutter plugin that shows banner ads using native platform views.
https://pub.dartlang.org/packages/admob_flutter
ISC License
433 stars 151 forks source link

SMART_BANNER loading with incorrect dimensions #91

Open d-apps opened 4 years ago

d-apps commented 4 years ago

When I set adSize: AdmobBannerSize.SMART_BANNER:

WhatsApp Image 2019-10-24 at 08 45 45

Other Banner types like BANNER is ok:

adSize: AdmobBannerSize.BANNER

Screenshot_1571926549

Looks like there's something wrong with SMART_BANNER and it's height and width. I'm using BANNER instead but could you take a look at this?

This is not something about Admob because when I use SMART_BANNER with the official plugin firebase_admob, the banner is showed correctly.

kmcgill88 commented 4 years ago

This is probably the issue. https://github.com/kmcgill88/admob_flutter/issues/46. The SMART_BANNER enum is misleading since you have to wrap it in a container and set the size. A PR would be great to document how the current use of this works! 😄

SaadArdati commented 4 years ago

@kmcgill88 I don't think that worked. image

  @override
  Widget build(BuildContext context) {
    Color backgroundColor = Theme.of(context).backgroundColor;

    return Padding(
      padding: const EdgeInsets.symmetric(vertical: 4),
      child: ClipRRect(
        borderRadius: BorderRadius.circular(10),
        child: Container(
          width: double.infinity,
          height: 75,
          decoration: BoxDecoration(color: backgroundColor),
          child: AdmobBanner(
            adUnitId: _bannerUnitId,
            adSize: AdmobBannerSize.SMART_BANNER,
          ),
        ),
      ),
    );
  }
SaadArdati commented 4 years ago

also tried solid numbers for width, same result or a blank container.

erperejildo commented 4 years ago

2 tests here with smartBanner (wrong) and mediumRectangle (correct): Screenshot_1582804587

Screenshot_1582804570

The container is responsive because it takes 100% of its parent width but the ad itself isn't

armandojimenez commented 3 years ago

Was this fixed? the smart banner is acting the same on android