Ads class

The Ads class

Constructors

Ads({String? trackingId, bool analyticsEnabled = false, String? bannerUnitId, String? screenUnitId, String? nativeUnitId, String? videoUnitId, String? factoryId, AdRequest? adRequest, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? nonPersonalizedAds, RequestConfiguration? requestConfiguration, bool? testing, MobileAdListener? listener, RewardListener? rewardListener, AdSize? size, double? anchorOffset, double? horizontalCenterOffset, AdErrorListener? errorListener})
factory

Properties

anchorOffset double?
no setter
The Banner Ad
final
bannerAd BannerAd?
The Type of Ads
no setter
bannerCompleter Completer<BannerAd>
final
bannerError bool
no setter
bannerListener MobileAdListener?
Set a Banner Ad Event Listener.
no getter
childDirected bool?
no setter
contentUrl String?
Get the url providing ad content
no setter
eventError bool
no setter
eventListener MobileAdListener
Event Listeners.
no getter
factoryId String?
Get factory Id for platform-specific ad
no setter
fullScreenAd FullScreenAd?
no setter
hashCode int
The hash code for this object.
no setterinherited
horizontalCenterOffset double?
no setter
inError bool
no setter
initialized bool
no setter
keywords List<String>?
Get ad keywords
no setter
native AdMobListener
Native Ad
final
nativeCompleter Completer<NativeAd>
final
nativeError bool
no setter
nativeListener MobileAdListener?
Set a Native Ad Event Listener.
no getter
nonPersonalizedAds bool?
no setter
publisherCompleter Completer<PublisherBannerAd>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screen AdMobListener
Full Screen Ad
final
screenError bool
no setter
screenListener MobileAdListener?
Set a Full Screen Ad Event Listener.
no getter
size AdSize?
no setter
testDevices List<String>?
Get list of test devices.
no setter
testing bool?
Determine if testing or not
no setter
video AdMobListener
Video Ad
final
videoAd VideoAd?
no setter
videoError bool
no setter
videoListener MobileAdListener?
Set a Video Ad Event Listener
no getter

Methods

bannerAdWidget({Key? key}) Widget
Return a Widget containing a Banner Ad.
closeBannerAd({bool load = true}) → void
Hide a Banner Ad.
closeFullScreenAd() → void
Hide the Full Screen Ad.
closeNativeAd({bool load = true}) → void
Hide a Native Ad.
createInterstitialAd({String? adUnitId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? nonPersonalizedAds, bool? testing, MobileAdListener? listener, double? anchorOffset, double? horizontalCenterOffset, AdErrorListener? errorListener}) Future<bool>
Set the Full Screen Ad options.
dispose() → void
Close any Ads Clean up memory and clear resources.
getBannerError() Exception?
getError() Exception?
getNativeError() Exception?
getScreenError() Exception?
getVideoError() Exception?
nativeAd({Key? key}) Widget
Return a Widget containing the ad.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publisherAdWidget({Key? key}) Widget
Return a Widget containing an Publisher Ad.
removeBanner(MobileAdListener listener) bool
Remove a specific Banner Ad Event Listener.
removeBannerAd({bool load = false}) → void
Remove the Banner Ad from memory
removeEvent(MobileAdListener listener) bool
Remove a specific Add Event Listener.
removeNative(MobileAdListener listener) bool
Remove a Native Ad Event Listener.
removeNativeAd({bool load = false}) → void
Remove the Native Ad from memory
removeScreen(MobileAdListener listener) bool
Remove a Full Screen Ad Event Listener.
removeVideo(MobileAdListener listener) bool
Remove a specific Video Ad Event Listener.
setBannerAd({String? adUnitId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? nonPersonalizedAds, bool? testing, MobileAdListener? listener, AdSize? size, double? anchorOffset, double? horizontalCenterOffset, AdErrorListener? errorListener}) Future<bool>
Set the Banner Ad options.
setFullScreenAd({String? adUnitId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? nonPersonalizedAds, bool? testing, MobileAdListener? listener, double? anchorOffset, double? horizontalCenterOffset, AdErrorListener? errorListener}) Future<bool>
Set the Full Screen Ad options.
setNativeAd({String? adUnitId, String? factoryId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? nonPersonalizedAds, bool? testing, MobileAdListener? listener, AdSize? size, double? anchorOffset, double? horizontalCenterOffset, AdErrorListener? errorListener}) Future<bool>
Set the Native Ad options.
setVideoAd({bool show = false, String? adUnitId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? nonPersonalizedAds, bool? testing, MobileAdListener? listener, RewardListener? rewardListener, AdErrorListener? errorListener}) Future<bool>
Video Ad
showFullScreenAd({String? adUnitId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? testing, MobileAdListener? listener, double? anchorOffset, double? horizontalCenterOffset, AdErrorListener? errorListener, State<StatefulWidget>? state}) Future<bool>
Show a Full Screen Ad.
showVideoAd({String? adUnitId, AdRequest? targetInfo, List<String>? keywords, String? contentUrl, bool? childDirected, List<String>? testDevices, bool? testing, MobileAdListener? listener, RewardListener? rewardListener, AdErrorListener? errorListener, State<StatefulWidget>? state}) Future<bool>
Show a Video Ad. hideFullScreenAd parameters: state is passed to determine if the app is not terminating. No need to show ad.
toString() String
A string representation of this object.
inherited

Operators

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