showAd method
Widget
showAd({
- required Map<
String, dynamic> adData, - double? height,
- double? width,
- String? adLabelText,
- Alignment? adLabelAlignment,
- void onAdClick()?,
- void onViewAppeared()?,
override
Creates a banner ad widget with the specified configuration.
adData - Required ad metadata to display the banner ad
height - Optional height of the banner ad in logical pixels
width - Optional width of the banner ad in logical pixels
adLabelText - Optional label text displayed on the banner ad
adLabelAlignment - Optional alignment for the label text
onAdClick - Optional callback triggered when the ad is clicked
onViewAppeared - Optional callback triggered when the ad appears
Returns a Widget that displays the banner advertisement
Implementation
@override
Widget showAd({
required Map<String, dynamic> adData,
double? height,
double? width,
String? adLabelText,
Alignment? adLabelAlignment,
void Function(Map)? onAdClick,
void Function(Map, String)? onViewAppeared,
}) {
return BannerAdWidget(
adData: adData,
height: height,
width: width,
adLabelText: adLabelText,
adLabelAlignment: AlignmentUtils.alignmentToString(adLabelAlignment),
onAdClick: onAdClick,
onViewAppeared: onViewAppeared,
config: _config,
);
}