AdSize class

AdSize represents the size of a banner ad.

Constructors

AdSize.getAdaptiveBanner(double maxWidth)
Adaptive banner ads have a fixed aspect ratio for the maximum width. The adaptive size calculates the optimal height for that width with an aspect ratio similar to 320x50.
AdSize.getAdaptiveBannerInScreen()
Create Adaptive AdSize with screen width for current screen orientation.
AdSize.getInlineBanner(int width, int maxHeight)
Inline banner ads have a desired width and a maximum height, useful when you want to limit the banner's height. Inline banners are larger and taller compared to adaptive banners. They have variable height, including Medium Rectangle size, and can be as tall as the device screen.
AdSize.getSmartBanner(BuildContext context)
Smart ad size selects the optimal dimensions depending on the device type. For mobile devices, it returns 320x50, while for tablets, it returns 728x90. In the UI, these banners occupy the same amount of space regardless of device type.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
height int
The vertical span of an ad.
final
isAdaptive bool
Is true for AdSize created by AdSize.getAdaptiveBanner.
no setter
isInline bool
Is true for AdSize created by AdSize.getInlineBanner.
no setter
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.
override

Operators

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

Constants

Standard banner has a fixed size of 320x50 and is the minimum ad size.
leaderboard → const AdSize
Leaderboard has a fixed size of 728x90 and is allowed on tablets only.
mediumRectangle → const AdSize
Medium rectangle has a fixed size of 300x250.