NativeAd constructor
NativeAd({
- required String adUnitId,
- String? factoryId,
- required NativeAdListener listener,
- required AdRequest? request,
- NativeAdOptions? nativeAdOptions,
- Map<
String, Object> ? customOptions, - NativeTemplateStyle? nativeTemplateStyle,
Creates a NativeAd.
A valid adUnitId
, nonnull listener
, nonnull request
, and either
factoryId
or nativeTemplateStyle
is required.
Use nativeAdOptions
to customize the native ad request.
Use customOptions
to pass data to your native ad factory.
Implementation
NativeAd({
required String adUnitId,
this.factoryId,
required this.listener,
required this.request,
this.nativeAdOptions,
this.customOptions,
this.nativeTemplateStyle,
}) : adManagerRequest = null,
assert(request != null),
assert(nativeTemplateStyle != null || factoryId != null),
super(adUnitId: adUnitId, listener: listener);