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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BannerAd
Constructors
-
BannerAd({Key? key, AdBuilder? builder, BannerAdController? controller, BannerSize size = BannerSize.ADAPTIVE, 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, anAssertionError
is thrownconst
Properties
- builder → AdBuilder?
-
The builder of the ad. The ad won't be reloaded if this changes
final
- controller → BannerAdController?
-
The controller of the ad.
This controller must be unique and can be used on only one
BannerAd
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
-
Whether non-personalized ads (ads that are not based on a user’s past behavior)
should be enabled.
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
-
The size of the Ad.
BannerSize.ADAPTIVE
is the default. This can NOT be null. If so, throws anAssertionError
final - unitId → String?
-
The unitId used by this
BannerAd
. If changed after loaded the ad will NOT be reloaded with the new ad unit id.\final - useHybridComposition → bool?
-
Use hybrid composition in this ad. This has effect only on Android
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