size property
The size of the Ad. BannerSize.ADAPTIVE
is the default.
This can NOT be null. If so, throws an AssertionError
Sizes
Name | Width xHeight |
Availability |
---|---|---|
BANNER | 320x50 | Phones and Tablets |
LARGE_BANNER | 320x100 | Phones and Tablets |
MEDIUM_RECTANGLE | 320x250 | Phones and Tablets |
FULL_BANNER | 468x60 | Tablets |
LEADERBOARD | 728x90 | Tablets |
SMART_BANNER | ? x(32, 50, 90) |
Phones and Tablets |
ADAPTIVE_BANNER | Screen width x? |
Phones and Tablets |
Usage
BannerAd(
...
size: BannerSize.`Name` /* (`BANNER`, `FULL_BANNER`, etc) */,
...
)
Custom size
To define a custom banner size, set your desired BannerSize
, as shown here:
BannerAd(
...
// width, height
size: BannerSize.fromWH(300, 50),
size: BannerSize(Size(300, 50)),
...
)
For more info, visit the documentation
Implementation
final BannerSize size;