BannerAd class

Creates a BannerAd and add it to the widget tree. Uses a PlatformView to connect to the AdView in the platform side. Uses:

Inheritance

Constructors

BannerAd({Key? key, AdBuilder? builder, BannerAdController? controller, BannerSize size = BannerSize.BANNER, Widget? error, Widget? loading, String? unitId, BannerAdOptions options = const BannerAdOptions(), Duration? delayToShow, Duration loadTimeout = kDefaultLoadTimeout, bool nonPersonalizedAds = kDefaultNonPersonalizedAds, bool? useHybridComposition, List<String> keywords = const []})
Creates a new Banner Ad. size can NOT be null. If so, an AssertionError is thrown
const

Properties

builder AdBuilder?
For more info, visit the documentation
final
controller BannerAdController?
For more info, visit the documentation
final
delayToShow Duration?
The duration the platform view will wait to be shown.
final
error Widget?
The error placeholder. If an error happens, this widget will be shown
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keywords List<String>
final
loading Widget?
The loading placeholder. This widget will be shown while the ad is loading
final
loadTimeout Duration
The ad will stop loading after a specified time.
final
nonPersonalizedAds bool
final
options BannerAdOptions
The options this ad will follow.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size BannerSize
final
unitId String?
The unitId used by this BannerAd.
final
useHybridComposition bool?
If null, defaults to MobileAds.useHybridComposition
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _BannerAdState
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