CASBanner class
A banner ad.
To display this ad, instantiate an CASWidget with this as a parameter.
While the ad is loading, the widget will have a size of (1x1). When the ad loads, the widget will automatically adopt the selected size.
- Inheritance
-
- Object
- AdInstance
- AdViewInstance
- CASBanner
Constructors
- CASBanner.createAndLoad({required AdSize size, String? casId, bool autoReload = true, int? refreshInterval, OnAdViewCallback? onAdLoaded, OnAdFailedCallback? onAdFailedToLoad, OnAdContentCallback? onAdImpression, OnAdCallback? onAdClicked})
- Create CASBanner and load ad content.
Properties
- format → AdFormat
-
The ad format of this instance.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMounted → bool
-
Returns true if the ad Id is already mounted in a WidgetAd managed
by the instanceManager.
no setterinherited
- onAdClicked ↔ OnAdCallback?
-
Called when the ad content is clicked by the user.
getter/setter pairinherited
- onAdFailedToLoad ↔ OnAdFailedCallback?
-
Called when the ad content fails to load.
getter/setter pairinherited
- onAdImpression ↔ OnAdContentCallback?
-
Callback to be invoked when an ad is estimated to have earned money.
Available for allowlisted accounts only.
getter/setter pairinherited
- onAdLoaded ↔ OnAdViewCallback?
-
Called when the ad content has been successfully loaded.
getter/setter pairinherited
- platformViewSize ↔ Size?
-
Returns the View Size of the associated platform ad object.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → AdSize
-
Represents the size of a banner ad.
final
Methods
-
dispose(
) → void -
Frees the plugin resources associated with this ad.
inherited
-
getContentInfo(
) → Future< AdContentInfo?> -
Contains information about the loaded request.
inherited
-
getRefreshInterval(
) → Future< int> - Gets the refresh interval in seconds for displaying ads.
-
isAutoReloadEnabled(
) → Future< bool> - Indicates whether the auto reload ad is currently enabled.
-
isLoaded(
) → bool - Indicates whether the ad is currently loaded and ready to be shown.
-
load(
) → Future< void> - Manual refresh ad or retry to load the ad.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAutoReloadEnabled(
bool isEnabled) → Future< void> - If enabled, the ad will automatically retry loading the ad if an error occurs during the loading process.
-
setRefreshInterval(
int interval) → Future< void> -
Sets the refresh interval in seconds for displaying ads.
The interval countdown runs only while the ad is visible on screen.
Once the interval elapses, a new ad will automatically load and display.
Set
intervalto0to disable automatic refreshing. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited