# 05. Flutter-Plugin Guide

## Development environment

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Flutter</strong></td><td>3.29.0</td><td></td></tr><tr><td><strong>Java SDK (JAva 11)</strong></td><td>ONEAdMax : v1.2.3</td><td></td></tr></tbody></table>

## Issue and apply the **APP key**.

After issuing the app key, configure the `<meta-data/>` in the **AndroidManifest.xml** of the Flutter Android Module.&#x20;

```java
<manifest>
    ...
    <application>
        ...
        
        <meta-data android:name="com.oneadmax.global.appkey" android:value="your app key"/>
    </application>
</manifest>
```

## SDK Initialize

The app must initialize **ONEAdMax** before loading ads.\
\&#xNAN;**`ONEAdMax.initialize()`** should be executed only once during the initial setup.

```java
class _OneAdDemo extends ConsumerState<HomeDetailScreen> {

  @override
  Widget build(BuildContext context) {
    ONEAdMax.initialize((bool isSuccess) {});
  }
}
```

## Handle the process when the application is closed.

Release the resources (View, Memory) allocated in memory when the application is closed.

```java
ONEAdMax.dispose();
```

## Set up logging.

You can expose detailed logs for **ONEAdMax** during development. (Default: **false**)

```java
ONEAdMax.setLogEnable(true);
```

## Set up GDPR (General Data Protection Regulation)

To comply with the EU's **GDPR (General Data Protection Regulation)**, add the following API. Please call this API only for users who require GDPR consent. (Default: **true**)

```java
ONEAdMax.gdprConsentAvailable(true);
```

## Set up COPPA

To comply with the **COPPA (Children's Online Privacy Protection Act)**, add the following API. For the devices where this is set, all ad requests for any ad type will be treated as "No ad." (Default: **false**)

```java
ONEAdMax.tagForChildDirectedTreatment(false)
```

## Choose ad format

### Rewarded Video ADs

This is a reward-based video ad.\
When the video ad finishes, the completion information is sent via the **Complete event callback**.

{% content-ref url="05.-flutter-plugin-guide/5-1.-rewarded-video-for-flutter" %}
[5-1.-rewarded-video-for-flutter](https://one-admax-organization.gitbook.io/one-admax-sdk/oneadmax_dev_guide_en/05.-flutter-plugin-guide/5-1.-rewarded-video-for-flutter)
{% endcontent-ref %}

### Interstitial ADs

This is an ad that covers the entire screen of the app. Once completed or interrupted by the user, the app's screen will be displayed.

{% content-ref url="05.-flutter-plugin-guide/interstitial" %}
[interstitial](https://one-admax-organization.gitbook.io/one-admax-sdk/oneadmax_dev_guide_en/05.-flutter-plugin-guide/interstitial)
{% endcontent-ref %}

### Banner ADs

This displays a rectangular ad that occupies part of the app's screen. \
You can set the position and time to automatically refresh the ad.

{% content-ref url="05.-flutter-plugin-guide/5-3.-banner-ads-for-flutter" %}
[5-3.-banner-ads-for-flutter](https://one-admax-organization.gitbook.io/one-admax-sdk/oneadmax_dev_guide_en/05.-flutter-plugin-guide/5-3.-banner-ads-for-flutter)
{% endcontent-ref %}

### Interstitial Video ADs (Non Reward)

This is an ad type similar to video ads, but without offering rewards.

{% content-ref url="05.-flutter-plugin-guide/5-4.-for-flutter" %}
[5-4.-for-flutter](https://one-admax-organization.gitbook.io/one-admax-sdk/oneadmax_dev_guide_en/05.-flutter-plugin-guide/5-4.-for-flutter)
{% endcontent-ref %}
