showAd abstract method

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

Displays a picture-in-picture ad with the specified configuration.

context - Required BuildContext for calculating dimensions adData - Required ad metadata to display the PIP ad width - Optional width of the PIP ad view in pixels height - Optional height of the PIP ad view in pixels x - Optional X-axis coordinate for ad positioning y - Optional Y-axis coordinate for ad positioning adLabelText - Optional text for the ad label adLabelAlignment - Optional alignment for the ad label 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,
  int? x,
  int? y,
  String? adLabelText,
  Alignment? adLabelAlignment,
  void Function(Map? ad)? onAdClicked,
  void Function(Map? ad, String? trackingId)? onAdAppeared,
});