import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';

import '../utils/native_ad_manager.dart';

class NativeAdsCustom extends StatelessWidget {
  const NativeAdsCustom({Key? key, required this.nativeAdManager, required this.height, required this.radius}) : super(key: key);
  final NativeAdManager nativeAdManager;

  final double height;
  final double radius;

  @override
  Widget build(BuildContext context) {
    return Obx(() => (nativeAdManager.isLoaded.value?
    ClipRRect(
      borderRadius: BorderRadius.circular(radius),
      child: Container(
        color: Colors.white,
        alignment: Alignment.center,

        height: height,
        child: AdWidget(
            ad: nativeAdManager.nativeAd!),
      ),
    ): const SizedBox()));
  }
}