CASRewarded class

Manages a rewarded ad, allowing for loading, showing, and destroying the ad content.

This class provides functionality to handle rewarded ads, which are ads where users can earn rewards for interacting with them.

Inheritance

Constructors

CASRewarded.create(String casId)
Create CASRewarded
CASRewarded.createAndLoad({String? casId, bool autoReload = false, bool extraFillByInterstitialAd = true, String? placement, OnScreenAdCallback? onAdLoaded, OnAdFailedCallback? onAdFailedToLoad, OnAdFailedCallback? onAdFailedToShow, OnScreenAdCallback? onAdShowed, OnAdContentCallback? onAdImpression, OnAdCallback? onAdClicked, OnScreenAdCallback? onAdDismissed, OnScreenAdCallback? onUserEarnedReward})
Create CASRewarded and load ad content.

Properties

contentCallback ScreenAdContentCallback?
Gets or sets the callback for handling ad content events.
getter/setter pairinherited
format AdFormat
The ad format of this instance.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
impressionListener OnAdImpressionListener?
Listener to be invoked when an ad is estimated to have earned money. Available for allowlisted accounts only.
getter/setter pairinherited
onAdClicked OnAdCallback?
Called when the ad content is clicked by the user.
getter/setter pairinherited
onAdDismissed OnScreenAdCallback?
Called when the ad content is dismissed.
getter/setter pairinherited
onAdFailedToLoad OnAdFailedCallback?
Called when the ad content fails to load.
getter/setter pairinherited
onAdFailedToShow OnAdFailedCallback?
Called when the ad content fails to show.
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 OnScreenAdCallback?
Called when the ad content has been successfully loaded.
getter/setter pairinherited
onAdShowed OnScreenAdCallback?
Called when the ad content is successfully shown.
getter/setter pairinherited
onUserEarnedReward OnScreenAdCallback?
Called when the user earns a reward.
getter/setter pair
placement String?
An optional placement name for the ad instance that helps categorize and track statistics across different ad placements.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
The dispose function should be called from onAdFailedToShow and onAdDismissed to free up resources if you do not expect automatic loading and will not load this instance again.
inherited
getContentInfo() Future<AdContentInfo?>
Contains information about the loaded request.
inherited
getServerSideVerificationData() Future<String?>
Get custom data for server side verification. See also setServerSideVerificationData
isAutoloadEnabled() Future<bool>
Indicates whether the auto reload ad is currently enabled.
inherited
isExtraFillInterstitialAdEnabled() Future<bool>
Deprecated
isLoaded() Future<bool>
Indicates whether the ad is currently loaded and ready to be shown.
inherited
load() Future<void>
Manual retry to load the ad.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setAutoloadEnabled(bool isEnabled) Future<void>
Gets or sets whether auto loading of ads is enabled.
inherited
setExtraFillInterstitialAdEnabled(bool isEnabled) Future<void>
Deprecated: Set parameters in CASRewarded.createAndLoad function
setServerSideVerificationData(String? data) Future<void>
Sets custom data to be included in server-side verification callbacks. Maximum 8192 characters allowed for the custom data.
show([OnRewardEarnedListener? listener]) Future<void>
Display this on top of the application.
override
toString() String
A string representation of this object.
inherited

Operators

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