AdSize class

AdSize represents the size of a banner ad.

There are six sizes available, which are the same for both iOS and Android. See the guides for banners on Android and iOS for additional details.

Implementers

Constructors

AdSize({required int width, required int height})
Constructs an AdSize with the given width and height.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
height int
The vertical span of an ad.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
The horizontal span of an ad.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

smartBanner AdSize
Ad units that render screen-width banner ads on any screen size across different devices in either orientation on Android.
no setter
smartBannerLandscape AdSize
Ad units that render screen-width banner ads on any screen size across different devices in landscape on iOS.
no setter
smartBannerPortrait AdSize
Ad units that render screen-width banner ads on any screen size across different devices in portrait on iOS.
no setter

Static Methods

getAnchoredAdaptiveBannerAdSize(Orientation orientation, int width) Future<AnchoredAdaptiveBannerAdSize?>
Ad units that render screen-width banner ads on any screen size across different devices in either Orientation.
getCurrentOrientationAnchoredAdaptiveBannerAdSize(int width) Future<AnchoredAdaptiveBannerAdSize?>
Returns an AdSize with the given width and a Google-optimized height to create a banner ad.
getCurrentOrientationInlineAdaptiveBannerAdSize(int width) InlineAdaptiveSize
Gets an AdSize with the given width and height that is always 0.
getInlineAdaptiveBannerAdSize(int width, int maxHeight) InlineAdaptiveSize
Gets an AdSize with the given width and height that is always 0.
getLandscapeInlineAdaptiveBannerAdSize(int width) InlineAdaptiveSize
Gets an AdSize in landscape orientation with the given width and 0 height.
getPortraitInlineAdaptiveBannerAdSize(int width) InlineAdaptiveSize
Gets an AdSize in portrait orientation with the given width and 0 height.
getSmartBanner(Orientation orientation) SmartBannerAdSize
Ad units that render screen-width banner ads on any screen size across different devices in either Orientation.

Constants

The standard banner (320x50) size.
fluid → const AdSize
A dynamically sized banner that matches its parent's width and expands/contracts its height to match the ad's content after loading completes.
fullBanner → const AdSize
The full banner (468x60) size.
largeBanner → const AdSize
The large banner (320x100) size.
leaderboard → const AdSize
The leaderboard (728x90) size.
mediumRectangle → const AdSize
The medium rectangle (300x250) size.