InterstitialAd class
An InterstitialAd model to communicate with the model in the platform side. It gives you methods to help in the implementation and event tracking.
For more info, see:
- Inheritance
-
- Object
- LoadShowAd<
FullScreenAdEvent> - InterstitialAd
Constructors
- InterstitialAd({String? unitId, Duration loadTimeout = kDefaultLoadTimeout, Duration timeout = kDefaultAdTimeout, bool nonPersonalizedAds = kDefaultNonPersonalizedAds})
- Creates a new interstitial ad controller
Properties
- channel ↔ MethodChannel
-
Channel to communicate with controller
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The unique key of
this
classno setterinherited - isAvailable → bool
-
Check if the time is available. If ad is not loaded, returns false
If it has been the time of timeout since the last load, returns false
no setterinherited
- isDisposed → bool
-
Check if the ad is disposed. You can dispose the ad by calling
ad.dispose()
no setterinherited - isLoaded ↔ bool
-
Check if the ad is loaded
getter/setter pairinherited
- lastLoadedTime ↔ DateTime?
-
getter/setter pairinherited
- loadTimeout → Duration
-
The ad will stop loading after a specified time.
finalinherited
- nonPersonalizedAds → bool
-
Whether non-personalized ads (ads that are not based on a user’s past behavior)
should be enabled.
finalinherited
-
onEvent
→ Stream<
Map< FullScreenAdEvent, dynamic> > -
Listen to the events the ad throws
no setteroverride
-
onEventController
→ StreamController<
Map< FullScreenAdEvent, dynamic> > -
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverSideVerificationOptions → ServerSideVerificationOptions?
-
Server Side Verification - Info such as
userId
andcustomData
finalinherited - timeout → Duration
-
The time the ad can be kept loaded.
finalinherited
- unitId → String?
-
The unit id used on this ad. Can be null
finalinherited
Methods
-
dispose(
) → void -
Dispose the ad to free up resources.
Once disposed, the ad can not be used anymore
override
-
ensureAdAvailable(
) → void -
inherited
-
ensureAdNotDisposed(
) → void -
inherited
-
init(
) → void -
Initialize the controller. This can be called only by the controller
override
-
load(
{String? unitId, bool force = false, Duration? timeout, bool? nonPersonalizedAds, List< String> keywords = const []}) → Future<bool> -
In order to show an ad, it needs to be loaded first. Use
load()
to load.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
show(
) → Future< bool> -
Show the interstitial ad. This returns a
Future
that will complete when the ad gets closedoverride -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- testUnitId → String
-
The test id for this ad.
no setter
- videoTestUnitId → String
-
The video test id for this ad.
no setter