NativeAd class

A NativeAd for the FirebaseAdMobPlugin.

Native ads are ad assets that are presented to users via UI components that are native to the platform. (e.g. A View on Android or a UIView on iOS). Using Flutter widgets to create native ads is NOT supported by this.

Using platform specific UI components, these ads can be formatted to match the visual design of the user experience in which they live. In coding terms, this means that when a native ad loads, your app receives a NativeAd object that contains its assets, and the app (rather than the Google Mobile Ads SDK) is then responsible for displaying them.

See the README for more details on using Native Ads.



NativeAd({@required String adUnitId, @required String factoryId, MobileAdTargetingInfo targetingInfo, MobileAdListener listener, Map<String, dynamic> customOptions})


adUnitId String
Identifies the source of ads for your application. [...]
final, inherited
customOptions Map<String, dynamic>
Optional options used to create the NativeAd. [...]
factoryId String
An identifier for the factory that creates the Platform view.
hashCode int
The hash code for this object. [...]
read-only, inherited
id int
An internal id that identifies this mobile ad to the native AdMob plugin. [...]
read-only, inherited
listener MobileAdListener
Called when the status of the ad changes.
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
targetingInfo MobileAdTargetingInfo
Optional targeting info per the native AdMob API.
read-only, inherited


dispose() Future<bool>
Free the plugin resources associated with this ad. [...]
isLoaded() Future<bool>
load() Future<bool>
Start loading this ad.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
show({double anchorOffset: 0.0, double horizontalCenterOffset: 0.0, AnchorType anchorType: AnchorType.bottom}) Future<bool>
Show this ad. [...]
toString() String
Returns a string representation of this object.


operator ==(Object other) bool
The equality operator. [...]

Static Properties

testAdUnitId String
A platform-specific AdMob test ad unit ID. This ad unit has been specially configured to always return test ads, and developers are encouraged to use it while building and testing their apps.