NativeAd class

Inheritance

Constructors

NativeAd({Key? key, required AdLayoutBuilder buildLayout, AdTextView? advertiser, AdTextView? attribution, AdTextView? body, AdButtonView? button, AdTextView? headline, AdImageView? icon, AdMediaView? media, AdTextView? price, AdRatingBarView? ratingBar, AdTextView? store, NativeAdController? controller, String? unitId, Widget? error, Widget? loading, double? height, double? width, NativeAdOptions? options, bool reloadWhenOptionsChange = true, AdBuilder? builder, Duration? delayToShow, Duration? loadTimeout, bool? useHybridComposition, bool? nonPersonalizedAds, List<String> keywords = const []})
Creates a NativeAd. Uses NativeAdView on android and GADNativeAd on iOS
const

Properties

advertiser AdTextView?
The ad advertiser. This isn't always inclued in the request
final
attribution AdTextView?
The ad attribution. This is always inclued in the request
final
body AdTextView?
The ad body. This isn't always inclued in the request
final
builder AdBuilder?
Build the ad background. Basic usage:
final
buildLayout AdLayoutBuilder
How the views should be presented to the user.
final
button AdButtonView?
The ad button. This isn't always inclued in the request
final
controller NativeAdController?
The ad controller. If not specified, uses a default controller.
final
delayToShow Duration?
The duration the platform view will wait to be shown.
final
error Widget?
The widget used in case of an error shows up
final
hashCode int
The hash code for this object.
no setterinherited
headline AdTextView?
The ad headline. This is always inclued in the request
final
height double?
The height of the ad. If this is null, the widget will expand
final
icon AdImageView?
The icon view. This isn't always inclued in the request
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keywords List<String>
{@template ads.keywords} The keywords used to load the ad.
final
loading Widget?
The widget used while the ad is loading.
final
loadTimeout Duration?
The ad will stop loading after a specified time.
final
media AdMediaView?
The full media view. This is always included in the request
final
nonPersonalizedAds bool?
Whether non-personalized ads (ads that are not based on a user’s past behavior) should be enabled
final
options NativeAdOptions?
Used to configure native ad requests.
final
price AdTextView?
The app price. This isn't always inclued in the request
final
ratingBar AdRatingBarView?
The rating bar. This isn't always inclued in the request
final
reloadWhenOptionsChange bool
If true, the ad will be reloaded whenever options changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store AdTextView?
The store. This isn't always inclued in the request
final
unitId String?
The unit id used by this NativeAd The ad won't be reloaded if this changes. If null, defaults to MobileAds.nativeAdUnitId
final
useHybridComposition bool?
Use hybrid composition in this ad. This has effect only on Android
final
width double?
The width of the ad. If this is null, the widget will expand
final

Methods

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