buildAdView method

  1. @override
Widget buildAdView(
  1. BuildContext context,
  2. NativeAd nativeAd
)
override

Implementation

@override
Widget buildAdView(BuildContext context, NativeAd nativeAd) {
  final customNativeStyle = customStyle ?? NativeAdStyle();
  final finalWidth = clampWidth(width, context);
  final finalHeight = clampHeight(
    height ??
        customStyle?.mediaHeight?.toDouble() ??
        (MediaQuery.of(context).size.height * 0.7),
    context,
  );

  return NativeAdLoader(context, config).renderNativeAdVerticalView(
    customStyle: customNativeStyle,
    adType: adType,
    width: finalWidth,
    adLabelAlignment: adLabelAlignment,
    adLabelText: adLabelText,
    height: finalHeight,
    customBadgeView: customBadgeView,
    customCtaView: customCtaView,
    cliUbid: nativeAd.cliUbid.toString(),
    nativeAd: nativeAd,
    onAdClicked: onAdClicked,
    onViewLoad: onAdLoaded,
  );
}