# ADD IN PUBSPEC.YMAL
```dart
dependencies:
google_applovin_unity_ads: ^2.3.33
get:
flutter_screenutil:
visibility_detector: ^0.3.3
```

# ADD IN ANDROID MANIFEST

```dart

//PERMISSION 
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>

<applicaton
<meta-data
android:name="com.google.android.gms.ads.AD_MANAGER_APP"
android:value="true" />

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713" />

//FOR ANDROID SPLASH SCREEN
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
</application>

```

# ADD IN BUILD GRADEL
```dart
    multiDexEnabled true
    targetSdkVersion 33
    minsdk 20
```

# ADD IN VOID MAIN

```dart
void main() {
    WidgetsFlutterBinding.ensureInitialized();
    MobileAds.instance.initialize();
    FacebookAds.instance.initialize();
    runApp(const MyApp());
}
```

# INITIALISE ADS FIRST TIME
```dart

@override
void initState() {
  // TODO: implement initState
  super.initState();
  fetchAdsSettings(
      appVersionCode: 1,
      settingsUrl:
      "https://gitlab.com/pp.bitcoding/demotest/-/raw/main/test.json",
      keyName: "com.bitlinks.arebic.iptv.m3ulist")
      .then((value) =>
  {


    // todo for custom loading ads dialog

    setProgressDialogWidget(
        aaaaa() // widget ui
    ),

    initOpenAds(onOpenAdLoaded: () => {showOpenAds()}),
    if(value?.adsSequence?.contains("app_lovin") ?? false)
      {
        if ((getAdsSettings()?.appLovin?.sdkKey ?? "").isNotEmpty)
          {
            AppLovinAds.instance
                .initialize(value!.appLovin!.sdkKey!, "", 0)
                .then((value) =>
            {
              YOUR PAGE ROUTE
            })
          }
        else
          {
            YOUR PAGE ROUTE
          }
      }
    else
      {
        YOUR PAGE ROUTE
      }
  });
}

```

# FOR OPEN AD

```dart
    initOpenAds(onOpenAdLoaded: () => {showOpenAds()}),
```

# FOR INTRA AD

```dart
    showIntraAds(callback: () => {});
```

# FOR REWARD AD
```dart
    showRewardAds(callback: () => {});
```

# FOR BANNER AD

SMALL BANNER

```dart
        Widget bannerShow = Container(height: 0);
var adSizeBanner = AdSize.banner;   
```

MEDIUM BANNER

```dart
        Widget bannerShow = Container(height: 0);
var adSizeBanner = AdSize.mediumRectangle;  
```


BIG BANNER

```dart
        Widget bannerShow = Container(height: 0);
var adSizeBanner = AdSize.largeBanner;  
```


LOAD BANNER ADS

    showBannerAds(
      size: adSizeBanner,
      onAdLoadedCallback: (p0) {
        setState(() {
          bannerShow = p0;
        });
      },
    );

SHOW BANNER ADS
```dart 
      bannerShow
```

# NATIVE ADS

##### ADD IN MAINACTIVITY.KT
```dart

import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import com.btcpiyush.ads.google_applovin_unity_ads.CustomNativeAd
import com.btcpiyush.ads.google_applovin_unity_ads.GoogleApplovinUnityAdsPlugin

class MainActivity: FlutterActivity() {
  override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
    super.configureFlutterEngine(flutterEngine)
    val factory: CustomNativeAd =
        CustomNativeAd(
            getLayoutInflater()
        )
    GoogleApplovinUnityAdsPlugin.registerNativeAdFactory(flutterEngine, "nativeFactoryId", factory)
  }

  override fun cleanUpFlutterEngine(flutterEngine: FlutterEngine) {
    GoogleApplovinUnityAdsPlugin.unregisterNativeAdFactory(flutterEngine, "nativeFactoryId")
  }
}
```

### SMALL NATIVE

```dart
 Widget smallNativeShow = Container(
  height: 0,
);

<--------load native ad -------->

showMediumNativeAds(
onAdLoadedCallback: (a) => {
setState(() {
smallNativeShow = a;
})
});

<--------show native ad -------->
smallNativeShow,

```




### BIG NATIVE

```dart

Widget BigNativeShow = Container(
  height: 0,
);

<--------load native ad -------->
showNativeAds(
onAdLoadedCallback: (a) => {
setState(() {
BigNativeShow = a;
})
});


<--------show native ad -------->
BigNativeShow,
```