showAd abstract method

Future<void>? showAd({
  1. required BuildContext context,
  2. required Map<String, dynamic> adData,
  3. int? width,
  4. int? height,
  5. String? alignment,
  6. String? adLabelText,
  7. Alignment? adLabelAlignment,
  8. int? x,
  9. int? y,
  10. void onAdClicked(
    1. Map? ad
    )?,
  11. void onAdAppeared(
    1. Map? ad,
    2. String? trackingId
    )?,
})

Displays an interstitial ad with the specified configuration.

context - Required BuildContext for calculating dimensions adData - Required ad metadata to display the interstitial ad width - Optional width of the interstitial ad view in pixels height - Optional height of the interstitial ad view in pixels alignment - Optional alignment of the ad on screen (default is "CENTER") adLabelText - Optional text for the ad label adLabelAlignment - Optional alignment for the ad label (default is "topLeading") x - Optional X-axis offset for custom ad positioning (default is 0) y - Optional Y-axis offset for custom ad positioning (default is 0) 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

Future<void>? showAd({
  required BuildContext context,
  required Map<String, dynamic> adData,
  int? width,
  int? height,
  String? alignment,
  String? adLabelText,
  Alignment? adLabelAlignment,
  int? x,
  int? y,
  void Function(Map? ad)? onAdClicked,
  void Function(Map? ad, String? trackingId)? onAdAppeared,
});