BannerHeightMemory class final

Remembers how tall anchored adaptive banners actually rendered, per requested width.

An anchored adaptive banner's height is only known once the platform has built it (ADR-073), so a banner that has never loaded reserves the 50dp floor and then grows into its real size — about 100–150dp for Google's large anchored format (ADR-078). Without a memory that jump repeats on every screen that mounts a new banner. With one, the first banner to load at a width records its height, and every later banner at that width reserves it before its own ad arrives: no layout shift, which is also what AdMob's accidental-click guidance asks for (ADR-079).

AdFlow.banner() shares one per AdFlow; a BannerAdController built without one remembers only its own loads. In memory only (a new process starts empty) and keyed by width alone: the height also depends on the screen height, so a slot resized vertically at the same width can be a few dp off until its own ad loads and the box takes the exact size.

Constructors

BannerHeightMemory()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

heightFor(int width, {AnchoredBannerSize size = AnchoredBannerSize.large}) → double?
The height an anchored adaptive banner of size last rendered at when requested at width, or null if none has loaded at that width yet. The large and classic sizes are remembered apart.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remember(int width, double height, {AnchoredBannerSize size = AnchoredBannerSize.large}) → void
Records that a banner of size requested at width rendered height tall. A non-positive height is ignored.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited