AdBanner class
A widget that displays an banner advertisement.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- AdBanner
Constructors
-
AdBanner({required List<
AdSize> adSizes, required XandrController controller, String? placementID, String? inventoryCode, Key? key, CustomKeywords? customKeywords, Duration autoRefreshInterval = const Duration(seconds: 30), bool resizeWhenLoaded = false, bool allowNativeDemand = false, Widget nativeAdBuilder(NativeAdData nativeAd)?, ClickThroughAction? clickThroughAction, bool resizeAdToFitContainer = false, bool? loadsInBackground, bool? shouldServePSAs, bool? enableLazyLoad, MultiAdRequestController? multiAdRequestController, LoadMode? loadMode, double? width, double? height, DoneLoadingCallback? onBannerFinishLoading, AdClickedCallback? onAdClicked}) - Represents an ad banner widget.
Properties
-
adSizes
→ List<
AdSize> -
Represents a banner ad with multiple sizes.
final
- allowNativeDemand → bool
-
Whether to allow native ads to be served
final
- autoRefreshInterval → Duration
-
The interval at which the ad banner should automatically refresh.
final
- clickThroughAction → ClickThroughAction?
-
The action to perform when the ad banner is clicked.
final
- controller → XandrController
-
The Xandr ad banner controller.
Use this controller to interact with the Xandr ad banner.
final
- customKeywords → CustomKeywords?
-
The custom keywords for the ad banner.
final
-
doneLoading
→ Completer<
bool> -
A completer that indicates when loading is done.
final
- enableLazyLoad → bool?
-
The flag indicating whether lazy loading is enabled for the ad banner.
lazy loading banner ads is a performance optimization that defers the
creation of the internal ad view until the ad is actually loaded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
The height of the ad banner.
final
- inventoryCode → String?
-
The inventory code for the ad banner.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadMode → LoadMode
-
The load mode for the ad banner, determines when the ad is loaded.
final
- loadsInBackground → bool?
-
The flag indicating whether the ad banner loads in the background.
final
- multiAdRequestController → MultiAdRequestController?
-
The controller for managing multi ad requests.
final
- nativeAdBuilder → Widget Function(NativeAdData nativeAd)?
-
If you want allow native ads - provide Widget builder for them
final
- onAdClicked → AdClickedCallback?
-
A callback that is called when the banner is clicked
final
- onBannerFinishLoading → DoneLoadingCallback?
-
Callback called when the ad finishes loading
whether it's success or failure
This also provides, if success, width and height of the ad
final
- placementID → String?
-
The placement ID for the ad banner.
final
- resizeAdToFitContainer → bool
-
Whether the ad should be resized to fit its container.
final
- resizeWhenLoaded → bool
-
Whether the banner should be resized when it is loaded.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldServePSAs → bool?
-
Determines whether PSAs (Public Service Announcements) should be served.
PSAs (Public Service Announcements) are ads that can be served as a
last resort, if there are no other ads to show.
final
- width → double
-
The width of the ad banner.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< AdBanner> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited