MaxNativeAdView class
Displays a native ad with its associated asset views:
- MaxNativeAdIconView
- MaxNativeAdTitleView
- MaxNativeAdAdvertiserView
- MaxNativeAdStarRatingView
- MaxNativeAdBodyView
- MaxNativeAdMediaView
- MaxNativeAdCallToActionView
Each asset view must be manually positioned and styled.
Ad content is populated automatically once the ad is loaded.
Use the widget’s controller (loadAd()
) to reload the ad as needed.
Note: The AppLovin SDK must be initialized before using this widget.
Example:
For a complete implementation example, see: https://github.com/AppLovin/AppLovin-MAX-Flutter/blob/master/applovin_max/example/lib/native_ad.dart
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MaxNativeAdView
Constructors
-
MaxNativeAdView.new({Key? key, required String adUnitId, String? placement, String? customData, Map<
String, String?> ? extraParameters, Map<String, dynamic> ? localExtraParameters, NativeAdListener? listener, double? width = double.infinity, double? height = double.infinity, MaxNativeAdViewController? controller, required Widget child}) -
Creates a native ad view with the provided asset views.
const
Properties
- adUnitId → String
-
The ad unit ID to load ads for.
final
- child → Widget
-
The child widget that contains the asset views of the native ad.
final
- controller → MaxNativeAdViewController?
-
The controller that reloads a native ad.
final
- customData → String?
-
Custom data string for granular ad reporting.
final
-
extraParameters
→ Map<
String, String?> ? -
Additional key-value parameters for ad customization, passed to the SDK.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
The height of the native ad. Defaults to double.infinity.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listener → NativeAdListener?
-
Listener for native ad event callbacks.
final
-
localExtraParameters
→ Map<
String, dynamic> ? -
Local extra parameters provided to mediation adapters for further customization.
final
- placement → String?
-
Placement name assigned for granular ad reporting.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
The width of the native ad. Defaults to double.infinity.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
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, int wrapWidth = 65}) → 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