setFullScreenAd method
Set the Full Screen Ad options.
Implementation
Future<bool> setFullScreenAd({
String? adUnitId,
AdRequest? targetInfo,
List<String>? keywords,
String? contentUrl,
bool? childDirected,
List<String>? testDevices,
bool? nonPersonalizedAds,
bool? testing,
m.MobileAdListener? listener,
double? anchorOffset,
double? horizontalCenterOffset,
// AnchorType anchorType,
m.AdErrorListener? errorListener,
}) async {
// Can only have one instantiated Ads object.
if (!_firstObject) {
return Future.value(false);
}
if (listener != null) {
screen.eventListeners.add(listener);
}
// Add this listener to the Error Listeners.
if (errorListener != null) {
m.eventErrorListeners.add(errorListener);
}
_fullScreenAd ??= m.FullScreenAd(listener: screen);
// If an unit id is not provided, it may be available from the constructor.
if (adUnitId == null || adUnitId.isEmpty || adUnitId.length < 30) {
adUnitId = _screenUnitId;
}
return _fullScreenAd!.set(
adUnitId: adUnitId,
targetInfo: targetInfo,
keywords: keywords ?? _keywords,
contentUrl: contentUrl ?? _contentUrl,
childDirected: childDirected ?? _childDirected,
testDevices: testDevices ?? _testDevices,
nonPersonalizedAds: nonPersonalizedAds ?? _nonPersonalizedAds,
testing: testing ?? _testing,
anchorOffset: anchorOffset ?? _anchorOffset,
horizontalCenterOffset: horizontalCenterOffset ?? _horizontalCenterOffset,
// anchorType: anchorType ?? _anchorType,
errorListener: errorListener ?? _errorListener,
);
}