showAd method
Future<void> ?
showAd({
- required BuildContext context,
- required Map<
String, dynamic> adData, - int? width,
- int? height,
- int? x,
- int? y,
- void onAdClicked(
- Map? ad
- void onAdAppeared()?,
override
Displays a slider ad with the specified configuration.
context - Required BuildContext for calculating dimensions
adData - Required ad metadata to display the slider ad
width - Optional width of the slider ad view in pixels
height - Optional height of the slider ad view in pixels
x - Optional X-axis coordinate for ad positioning
y - Optional Y-axis coordinate for ad positioning
onAdClicked - Optional callback triggered when the ad is clicked
onAdAppeared - Optional callback triggered when the ad appears
Returns a Future that completes when the ad is displayed
Implementation
@override
Future<void>? showAd({
required BuildContext context,
required Map<String, dynamic> adData,
int? width,
int? height,
int? x,
int? y,
void Function(Map? ad)? onAdClicked,
void Function(Map? ad, String? trackingId)? onAdAppeared,
}) {
return _sliderAdView.showSliderAdView(
context: context,
adData: adData,
width: width,
height: height,
x: x,
y: y,
onAdClicked: onAdClicked,
onAdAppeared: onAdAppeared,
config: _config,
);
}