> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adrop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# リファレンス

> Adrop Flutter SDKのすべてのクラス、列挙型の詳細リファレンスです。

## Adrop

Adrop SDKのメインクラスです。SDKの初期化とグローバル設定を担当します。

### 静的プロパティ

| プロパティ            | 型                     | 説明                  |
| ---------------- | --------------------- | ------------------- |
| `consentManager` | `AdropConsentManager` | GDPR/CCPA同意管理マネージャー |

### 静的メソッド

| メソッド                                                                                  | 説明                            |
| ------------------------------------------------------------------------------------- | ----------------------------- |
| `initialize(bool production, {List<String>? targetCountries, bool? useInAppBrowser})` | SDKを初期化します                    |
| `setUID(String uid)`                                                                  | ユーザー識別子を設定します(SHA-256でハッシュ化)  |
| `setTheme(AdropTheme theme)`                                                          | 広告テーマを設定します                   |
| `registerWebView(int webViewIdentifier)`                                              | バックフィル広告サポートのためにWebViewを登録します |

### 使用例

```dart theme={null}
import 'package:adrop_ads_flutter/adrop_ads_flutter.dart';

// 基本初期化(テストモード)
await Adrop.initialize(false);

// プロダクションモード + ターゲット国設定
await Adrop.initialize(
  true,
  targetCountries: ['KR', 'JP', 'US'],
);

// ユーザーID設定
await Adrop.setUID('user123');

// テーマ設定
await Adrop.setTheme(AdropTheme.dark);
```

```dart theme={null}
// WebView登録
import 'dart:io';
import 'package:webview_flutter_android/webview_flutter_android.dart';
import 'package:webview_flutter_wkwebview/webview_flutter_wkwebview.dart';

final int identifier;
if (Platform.isAndroid) {
  identifier = (controller.platform as AndroidWebViewController).webViewIdentifier;
} else if (Platform.isIOS) {
  identifier = (controller.platform as WebKitWebViewController).webViewIdentifier;
}
await Adrop.registerWebView(identifier);
```

***

## AdropTheme

広告のダークモード設定用の列挙型です。

### 値

| 値       | 説明                 |
| ------- | ------------------ |
| `light` | ライトモード             |
| `dark`  | ダークモード             |
| `auto`  | システム設定に自動追従(デフォルト) |

### 使用例

```dart theme={null}
await Adrop.setTheme(AdropTheme.dark);
```

***

## AdropErrorCode

広告の読み込みと表示時に発生する可能性のあるエラーコードです。

### 値

| エラーコード                      | コード文字列                                    | 説明              |
| --------------------------- | ----------------------------------------- | --------------- |
| `network`                   | `ERROR_CODE_NETWORK`                      | ネットワークエラー       |
| `internal`                  | `ERROR_CODE_INTERNAL`                     | 内部エラー           |
| `initialize`                | `ERROR_CODE_INITIALIZE`                   | SDK初期化エラー       |
| `invalidUnit`               | `ERROR_CODE_INVALID_UNIT`                 | 無効な広告ユニットID     |
| `notTargetCountry`          | `ERROR_CODE_NOT_TARGET_COUNTRY`           | ターゲット国ではない      |
| `inactive`                  | `ERROR_CODE_AD_INACTIVE`                  | 無効化された広告        |
| `adNoFill`                  | `ERROR_CODE_AD_NO_FILL`                   | 表示可能な広告がない      |
| `adLoadDuplicate`           | `ERROR_CODE_AD_LOAD_DUPLICATED`           | 重複した広告読み込みリクエスト |
| `adLoading`                 | `ERROR_CODE_AD_LOADING`                   | 広告読み込み中         |
| `adEmpty`                   | `ERROR_CODE_AD_EMPTY`                     | 広告が空            |
| `adShown`                   | `ERROR_CODE_AD_SHOWN`                     | 広告がすでに表示されている   |
| `adHideForToday`            | `ERROR_CODE_AD_HIDE_FOR_TODAY`            | 今日は表示しない設定      |
| `accountUsageLimitExceeded` | `ERROR_CODE_ACCOUNT_USAGE_LIMIT_EXCEEDED` | アカウント使用制限超過     |
| `adLandscapeUnsupported`    | `ERROR_CODE_LANDSCAPE_UNSUPPORTED`        | 横向きモード非対応       |
| `backfillNoFill`            | `ERROR_CODE_AD_BACKFILL_NO_FILL`          | バックフィル広告もなし     |
| `undefined`                 | `UNDEFINED`                               | 未定義のエラー         |

### プロパティ

| プロパティ  | 型        | 説明        |
| ------ | -------- | --------- |
| `code` | `String` | エラーコード文字列 |

### ファクトリーメソッド

| メソッド                                    | 説明               |
| --------------------------------------- | ---------------- |
| `AdropErrorCode.getByCode(String code)` | コード文字列でエラーコードを取得 |

***

## AdropAdChoicesPosition

バックフィルネイティブ広告のAdChoicesマーク表示位置を設定するenumです。

### Values

| Value         | Integer | Description |
| ------------- | ------- | ----------- |
| `topLeft`     | 0       | 左上          |
| `topRight`    | 1       | 右上（デフォルト）   |
| `bottomLeft`  | 2       | 左下          |
| `bottomRight` | 3       | 右下          |

### Usage Example

```dart theme={null}
final nativeAd = AdropNativeAd(
  unitId: 'YOUR_UNIT_ID',
  preferredAdChoicesPosition: AdropAdChoicesPosition.bottomRight,
);
```

***

## AdropBannerView

バナー広告を表示するウィジェットクラスです。

### コンストラクタ

```dart theme={null}
AdropBannerView({
  required String unitId,
  AdropBannerListener? listener,
})
```

### プロパティ

| プロパティ          | 型               | 説明          |
| -------------- | --------------- | ----------- |
| `creativeSize` | `CreativeSize?` | クリエイティブサイズ  |
| `adSize`       | `Size?`         | バナービューサイズ設定 |

### メソッド

| メソッド        | 戻り値の型          | 説明      |
| ----------- | -------------- | ------- |
| `load()`    | `Future<void>` | 広告を読み込む |
| `dispose()` | `Future<void>` | リソースを解放 |

### 使用例

```dart theme={null}
late AdropBannerView bannerView;

@override
void initState() {
  super.initState();

  bannerView = AdropBannerView(
    unitId: 'YOUR_UNIT_ID',
    listener: AdropBannerListener(
      onAdReceived: (unitId, metadata) {
        setState(() => isLoaded = true);
      },
      onAdFailedToReceive: (unitId, errorCode) {
        debugPrint('エラー: ${errorCode.code}');
      },
    ),
  );

  bannerView.load();
}

@override
void dispose() {
  bannerView.dispose();
  super.dispose();
}
```

***

## AdropBannerListener

バナー広告イベントを処理するリスナークラスです。

### コンストラクタ

```dart theme={null}
AdropBannerListener({
  void Function(String unitId, Map<String, dynamic>? metadata)? onAdReceived,
  void Function(String unitId, Map<String, dynamic>? metadata)? onAdClicked,
  void Function(String unitId, Map<String, dynamic>? metadata)? onAdImpression,
  void Function(String unitId, AdropErrorCode errorCode)? onAdFailedToReceive,
  void Function(String unitId)? onAdVideoStart,
  void Function(String unitId)? onAdVideoEnd,
})
```

### コールバック

| コールバック                | パラメータ                 | 説明        |
| --------------------- | --------------------- | --------- |
| `onAdReceived`        | `unitId`, `metadata`  | 広告受信成功    |
| `onAdClicked`         | `unitId`, `metadata`  | 広告クリック    |
| `onAdImpression`      | `unitId`, `metadata`  | 広告表示      |
| `onAdFailedToReceive` | `unitId`, `errorCode` | 広告受信失敗    |
| `onAdVideoStart`      | `unitId`              | 動画広告の再生開始 |
| `onAdVideoEnd`        | `unitId`              | 動画広告の再生終了 |

### メタデータフィールド

| フィールド            | 型        | 説明                               |
| ---------------- | -------- | -------------------------------- |
| `creativeId`     | `String` | クリエイティブID                        |
| `txId`           | `String` | トランザクションID                       |
| `campaignId`     | `String` | キャンペーンID                         |
| `destinationURL` | `String` | 遷移先URL                           |
| `browserTarget`  | `int?`   | ブラウザターゲット（0: 外部ブラウザ、1: アプリ内ブラウザ） |

***

## AdropNativeAd

ネイティブ広告をリクエストするクラスです。

### コンストラクタ

```dart theme={null}
AdropNativeAd({
  required String unitId,
  bool useCustomClick = false,
  AdropAdChoicesPosition preferredAdChoicesPosition = AdropAdChoicesPosition.topRight,
  AdropNativeListener? listener,
})
```

### プロパティ

| プロパティ                        | 型                        | 説明                                                |
| ---------------------------- | ------------------------ | ------------------------------------------------- |
| `isLoaded`                   | `bool`                   | 広告読み込み完了の有無                                       |
| `unitId`                     | `String`                 | 広告ユニットID                                          |
| `creativeId`                 | `String`                 | クリエイティブID                                         |
| `txId`                       | `String`                 | トランザクションID                                        |
| `campaignId`                 | `String`                 | キャンペーンID                                          |
| `destinationURL`             | `String`                 | 遷移先URL                                            |
| `browserTarget`              | `BrowserTarget?`         | 遷移先URLの開き方（外部/アプリ内ブラウザ）                           |
| `properties`                 | `AdropNativeProperties`  | ネイティブ広告プロパティ                                      |
| `creativeSize`               | `CreativeSize`           | クリエイティブサイズ                                        |
| `isBackfilled`               | `bool`                   | バックフィル広告かどうか                                      |
| `preferredAdChoicesPosition` | `AdropAdChoicesPosition` | バックフィルネイティブ広告のAdChoicesマーク表示位置（デフォルト: `topRight`） |

### メソッド

| メソッド     | 戻り値の型          | 説明      |
| -------- | -------------- | ------- |
| `load()` | `Future<void>` | 広告を読み込む |

### 使用例

```dart theme={null}
final nativeAd = AdropNativeAd(
  unitId: 'YOUR_UNIT_ID',
  useCustomClick: true,
  listener: AdropNativeListener(
    onAdReceived: (ad) {
      debugPrint('広告受信: ${ad.creativeId}');
    },
    onAdFailedToReceive: (ad, errorCode) {
      debugPrint('エラー: ${errorCode.code}');
    },
  ),
);

await nativeAd.load();
```

***

## AdropNativeAdView

ネイティブ広告を画面に表示するウィジェットです。

### コンストラクタ

```dart theme={null}
AdropNativeAdView({
  required AdropNativeAd? ad,
  required Widget child,
})
```

### 使用例

```dart theme={null}
AdropNativeAdView(
  ad: nativeAd,
  child: Container(
    child: Column(
      children: [
        Text(nativeAd?.properties.headline ?? ''),
        Text(nativeAd?.properties.body ?? ''),
      ],
    ),
  ),
)
```

***

## AdropNativeListener

ネイティブ広告イベントを処理するリスナークラスです。

### コンストラクタ

```dart theme={null}
AdropNativeListener({
  void Function(AdropNativeAd ad)? onAdReceived,
  void Function(AdropNativeAd ad)? onAdClicked,
  void Function(AdropNativeAd ad)? onAdImpression,
  void Function(AdropNativeAd ad, AdropErrorCode errorCode)? onAdFailedToReceive,
  void Function(AdropNativeAd ad)? onAdVideoStart,
  void Function(AdropNativeAd ad)? onAdVideoEnd,
})
```

### コールバック

| コールバック                | パラメータ             | 説明        |
| --------------------- | ----------------- | --------- |
| `onAdReceived`        | `ad`              | 広告受信成功    |
| `onAdClicked`         | `ad`              | 広告クリック    |
| `onAdImpression`      | `ad`              | 広告表示      |
| `onAdFailedToReceive` | `ad`, `errorCode` | 広告受信失敗    |
| `onAdVideoStart`      | `ad`              | 動画広告の再生開始 |
| `onAdVideoEnd`        | `ad`              | 動画広告の再生終了 |

***

## AdropNativeProperties

ネイティブ広告のコンテンツプロパティです。

### プロパティ

| プロパティ            | 型                     | 説明               |
| ---------------- | --------------------- | ---------------- |
| `headline`       | `String?`             | 広告タイトル           |
| `body`           | `String?`             | 広告本文             |
| `creative`       | `String?`             | HTMLクリエイティブコンテンツ |
| `asset`          | `String?`             | 画像アセットURL        |
| `destinationURL` | `String?`             | クリック時の遷移先URL     |
| `callToAction`   | `String?`             | CTAボタンテキスト       |
| `profile`        | `AdropNativeProfile?` | 広告主プロフィール情報      |
| `extra`          | `Map<String, String>` | 追加カスタムフィールド      |
| `isBackfilled`   | `bool`                | バックフィル広告かどうか     |

***

## AdropNativeProfile

ネイティブ広告のプロフィール情報です。

### プロパティ

| プロパティ         | 型         | 説明         |
| ------------- | --------- | ---------- |
| `displayName` | `String?` | 広告主名       |
| `displayLogo` | `String?` | 広告主ロゴ画像URL |

***

## AdropInterstitialAd

インタースティシャル広告を表示するクラスです。

### コンストラクタ

```dart theme={null}
AdropInterstitialAd({
  required String unitId,
  AdropInterstitialListener? listener,
})
```

### プロパティ

| プロパティ            | 型                | 説明                      |
| ---------------- | ---------------- | ----------------------- |
| `isLoaded`       | `bool`           | 広告読み込み完了の有無             |
| `unitId`         | `String`         | 広告ユニットID                |
| `creativeId`     | `String`         | クリエイティブID               |
| `txId`           | `String`         | トランザクションID              |
| `campaignId`     | `String`         | キャンペーンID                |
| `destinationURL` | `String`         | 遷移先URL                  |
| `browserTarget`  | `BrowserTarget?` | 遷移先URLの開き方（外部/アプリ内ブラウザ） |

### メソッド

| メソッド        | 戻り値の型          | 説明                      |
| ----------- | -------------- | ----------------------- |
| `load()`    | `Future<void>` | 広告を読み込む                 |
| `show()`    | `Future<void>` | 広告を表示                   |
| `close()`   | `Future<void>` | プログラムで広告を閉じる（Android専用） |
| `dispose()` | `Future<void>` | リソースを解放                 |

### 使用例

```dart theme={null}
final interstitialAd = AdropInterstitialAd(
  unitId: 'YOUR_UNIT_ID',
  listener: AdropInterstitialListener(
    onAdReceived: (ad) {
      ad.show();
    },
    onAdFailedToReceive: (ad, errorCode) {
      debugPrint('エラー: ${errorCode.code}');
    },
    onAdDidDismissFullScreen: (ad) {
      debugPrint('広告が閉じられました');
    },
  ),
);

await interstitialAd.load();
```

***

## AdropInterstitialListener

インタースティシャル広告イベントを処理するリスナークラスです。

### コンストラクタ

```dart theme={null}
AdropInterstitialListener({
  void Function(AdropAd ad)? onAdReceived,
  void Function(AdropAd ad)? onAdClicked,
  void Function(AdropAd ad)? onAdImpression,
  void Function(AdropAd ad)? onAdWillPresentFullScreen,
  void Function(AdropAd ad)? onAdDidPresentFullScreen,
  void Function(AdropAd ad)? onAdWillDismissFullScreen,
  void Function(AdropAd ad)? onAdDidDismissFullScreen,
  void Function(AdropAd ad, AdropErrorCode errorCode)? onAdFailedToReceive,
  void Function(AdropAd ad, AdropErrorCode errorCode)? onAdFailedToShowFullScreen,
  void Function(AdropAd ad)? onAdBackButtonPressed,
})
```

### コールバック

| コールバック                       | 説明                          |
| ---------------------------- | --------------------------- |
| `onAdReceived`               | 広告受信成功                      |
| `onAdClicked`                | 広告クリック                      |
| `onAdImpression`             | 広告表示                        |
| `onAdWillPresentFullScreen`  | 広告表示開始(iOS専用)               |
| `onAdDidPresentFullScreen`   | 広告表示完了                      |
| `onAdWillDismissFullScreen`  | 広告を閉じる開始(iOS専用)             |
| `onAdDidDismissFullScreen`   | 広告を閉じる完了                    |
| `onAdFailedToReceive`        | 広告受信失敗                      |
| `onAdFailedToShowFullScreen` | 広告表示失敗                      |
| `onAdBackButtonPressed`      | 広告表示中に戻るボタンが押された（Android専用） |

***

## AdropRewardedAd

リワード広告を表示するクラスです。

### コンストラクタ

```dart theme={null}
AdropRewardedAd({
  required String unitId,
  AdropRewardedListener? listener,
})
```

### プロパティ

| プロパティ                           | 型                                | 説明                                |
| ------------------------------- | -------------------------------- | --------------------------------- |
| `isLoaded`                      | `bool`                           | 広告読み込み完了の有無                       |
| `unitId`                        | `String`                         | 広告ユニットID                          |
| `creativeId`                    | `String`                         | クリエイティブID                         |
| `txId`                          | `String`                         | トランザクションID                        |
| `campaignId`                    | `String`                         | キャンペーンID                          |
| `destinationURL`                | `String`                         | 遷移先URL                            |
| `browserTarget`                 | `BrowserTarget?`                 | 遷移先URLの開き方（外部/アプリ内ブラウザ）           |
| `serverSideVerificationOptions` | `ServerSideVerificationOptions?` | サーバーサイド検証オプション（userId、customData） |

### メソッド

| メソッド        | 戻り値の型          | 説明      |
| ----------- | -------------- | ------- |
| `load()`    | `Future<void>` | 広告を読み込む |
| `show()`    | `Future<void>` | 広告を表示   |
| `dispose()` | `Future<void>` | リソースを解放 |

### 使用例

```dart theme={null}
final rewardedAd = AdropRewardedAd(
  unitId: 'YOUR_UNIT_ID',
  listener: AdropRewardedListener(
    onAdReceived: (ad) {
      ad.show();
    },
    onAdEarnRewardHandler: (ad, type, amount) {
      // 報酬付与
      debugPrint('報酬: type=$type, amount=$amount');
    },
  ),
);

await rewardedAd.load();
```

***

## ServerSideVerificationOptions

リワード広告のサーバーサイド検証（SSV）オプションです。`load()`を呼び出す前に設定して、サーバーコールバックにカスタムデータを渡します。

### コンストラクタ

```dart theme={null}
const ServerSideVerificationOptions({
  String? userId,
  String? customData,
})
```

### プロパティ

| プロパティ        | 型         | 説明                      |
| ------------ | --------- | ----------------------- |
| `userId`     | `String?` | サーバーサイド検証用のユーザー識別子      |
| `customData` | `String?` | サーバーコールバックに渡すカスタムデータ文字列 |

### 使用例

```dart theme={null}
final rewardedAd = AdropRewardedAd(
  unitId: 'YOUR_UNIT_ID',
  listener: AdropRewardedListener(
    onAdEarnRewardHandler: (ad, type, amount) {
      debugPrint('報酬: type=$type, amount=$amount');
    },
  ),
);

// ロード前にSSVオプションを設定
rewardedAd.serverSideVerificationOptions = ServerSideVerificationOptions(
  userId: 'user_123',
  customData: 'extra_data',
);

await rewardedAd.load();
```

***

## AdropRewardedListener

リワード広告イベントを処理するリスナークラスです。

### コンストラクタ

```dart theme={null}
AdropRewardedListener({
  void Function(AdropAd ad)? onAdReceived,
  void Function(AdropAd ad)? onAdClicked,
  void Function(AdropAd ad)? onAdImpression,
  void Function(AdropAd ad)? onAdWillPresentFullScreen,
  void Function(AdropAd ad)? onAdDidPresentFullScreen,
  void Function(AdropAd ad)? onAdWillDismissFullScreen,
  void Function(AdropAd ad)? onAdDidDismissFullScreen,
  void Function(AdropAd ad, AdropErrorCode errorCode)? onAdFailedToReceive,
  void Function(AdropAd ad, AdropErrorCode errorCode)? onAdFailedToShowFullScreen,
  void Function(AdropAd ad, int type, int amount)? onAdEarnRewardHandler,
})
```

### コールバック

| コールバック                       | 説明              |
| ---------------------------- | --------------- |
| `onAdReceived`               | 広告受信成功          |
| `onAdClicked`                | 広告クリック          |
| `onAdImpression`             | 広告表示            |
| `onAdWillPresentFullScreen`  | 広告表示開始(iOS専用)   |
| `onAdDidPresentFullScreen`   | 広告表示完了          |
| `onAdWillDismissFullScreen`  | 広告を閉じる開始(iOS専用) |
| `onAdDidDismissFullScreen`   | 広告を閉じる完了        |
| `onAdFailedToReceive`        | 広告受信失敗          |
| `onAdFailedToShowFullScreen` | 広告表示失敗          |
| `onAdEarnRewardHandler`      | 報酬獲得            |

***

## AdropPopupAd

ポップアップ広告を表示するクラスです。

### コンストラクタ

```dart theme={null}
AdropPopupAd({
  required String unitId,
  AdropPopupListener? listener,
  Color? closeTextColor,
  Color? hideForTodayTextColor,
  Color? backgroundColor,
})
```

### プロパティ

| プロパティ                   | 型                | 説明                      |
| ----------------------- | ---------------- | ----------------------- |
| `isLoaded`              | `bool`           | 広告読み込み完了の有無             |
| `unitId`                | `String`         | 広告ユニットID                |
| `creativeId`            | `String`         | クリエイティブID               |
| `txId`                  | `String`         | トランザクションID              |
| `campaignId`            | `String`         | キャンペーンID                |
| `destinationURL`        | `String`         | 遷移先URL                  |
| `browserTarget`         | `BrowserTarget?` | 遷移先URLの開き方（外部/アプリ内ブラウザ） |
| `closeTextColor`        | `Color?`         | 閉じるボタンテキスト色             |
| `hideForTodayTextColor` | `Color?`         | "今日は表示しない"テキスト色         |
| `backgroundColor`       | `Color?`         | ボタン背景色                  |

### メソッド

| メソッド        | 戻り値の型          | 説明      |
| ----------- | -------------- | ------- |
| `load()`    | `Future<void>` | 広告を読み込む |
| `show()`    | `Future<void>` | 広告を表示   |
| `close()`   | `Future<void>` | 広告を閉じる  |
| `dispose()` | `Future<void>` | リソースを解放 |

### 使用例

```dart theme={null}
final popupAd = AdropPopupAd(
  unitId: 'YOUR_UNIT_ID',
  closeTextColor: Colors.white,
  backgroundColor: Colors.black87,
  listener: AdropPopupListener(
    onAdReceived: (ad) {
      ad.show();
    },
  ),
);

await popupAd.load();
```

***

## AdropPopupListener

ポップアップ広告イベントを処理するリスナークラスです。

### コンストラクタ

```dart theme={null}
AdropPopupListener({
  void Function(AdropAd ad)? onAdReceived,
  void Function(AdropAd ad)? onAdClicked,
  void Function(AdropAd ad)? onAdImpression,
  void Function(AdropAd ad)? onAdWillPresentFullScreen,
  void Function(AdropAd ad)? onAdDidPresentFullScreen,
  void Function(AdropAd ad)? onAdWillDismissFullScreen,
  void Function(AdropAd ad)? onAdDidDismissFullScreen,
  void Function(AdropAd ad, AdropErrorCode errorCode)? onAdFailedToReceive,
  void Function(AdropAd ad, AdropErrorCode errorCode)? onAdFailedToShowFullScreen,
  void Function(AdropAd ad)? onAdVideoStart,
  void Function(AdropAd ad)? onAdVideoEnd,
})
```

***

## AdropMetrics

ユーザープロパティとイベントを管理するクラスです。

### 静的メソッド

| メソッド                                                     | 戻り値の型                          | 説明                          |
| -------------------------------------------------------- | ------------------------------ | --------------------------- |
| `setProperty(String key, dynamic value)`                 | `Future<void>`                 | ユーザープロパティを設定                |
| `sendEvent(String name, [Map<String, dynamic>? params])` | `Future<void>`                 | イベントを送信                     |
| `logEvent(String name, [dynamic params])`                | `Future<void>`                 | イベントをログ（非推奨、`sendEvent`を使用） |
| `properties()`                                           | `Future<Map<String, dynamic>>` | すべてのプロパティを取得                |

### 使用例

```dart theme={null}
import 'package:adrop_ads_flutter/adrop_ads_flutter.dart';

// プロパティ設定
await AdropMetrics.setProperty('membership_level', 'premium');
await AdropMetrics.setProperty('age', 25);
await AdropMetrics.setProperty('is_subscriber', true);

// プロパティ削除
await AdropMetrics.setProperty('membership_level', null);

// イベント送信
await AdropMetrics.sendEvent('purchase', {
  'item_id': 'SKU_001',
  'price': 29900,
});

// すべてのプロパティ取得
final props = await AdropMetrics.properties();
debugPrint('プロパティ: $props');
```

***

## AdropConsentManager

ユーザーの同意を管理するクラス（GDPR、CCPAなど）。`Adrop.consentManager`経由でアクセスします。

### メソッド

| メソッド                                                     | 戻り値の型                        | 説明                             |
| -------------------------------------------------------- | ---------------------------- | ------------------------------ |
| `requestConsentInfoUpdate(listener)`                     | `Future<void>`               | 同意情報の更新をリクエストし、必要に応じて同意フォームを表示 |
| `getConsentStatus()`                                     | `Future<AdropConsentStatus>` | 現在の同意ステータスを取得                  |
| `canRequestAds()`                                        | `Future<bool>`               | 広告リクエストが可能か確認                  |
| `setDebugSettings(AdropConsentDebugGeography geography)` | `Future<void>`               | テスト用のデバッグ地域を設定                 |
| `reset()`                                                | `Future<void>`               | 同意情報をリセット                      |

### 使用例

```dart theme={null}
// 同意をリクエスト
Adrop.consentManager.requestConsentInfoUpdate((result) {
  debugPrint('ステータス: ${result.status}');
  debugPrint('広告リクエスト可能: ${result.canRequestAds}');
});

// ステータスを個別に確認
final status = await Adrop.consentManager.getConsentStatus();
final canRequest = await Adrop.consentManager.canRequestAds();
```

***

## AdropConsentResult

同意情報更新コールバックが返す結果オブジェクトです。

### プロパティ

| プロパティ                    | 型                    | 説明                      |
| ------------------------ | -------------------- | ----------------------- |
| `status`                 | `AdropConsentStatus` | 現在の同意ステータス              |
| `canRequestAds`          | `bool`               | 広告リクエストが可能かどうか          |
| `canShowPersonalizedAds` | `bool`               | パーソナライズド広告の表示が可能かどうか    |
| `error`                  | `String?`            | エラーメッセージ（エラーがない場合はnull） |

***

## AdropConsentStatus

ユーザーの同意ステータスを表す列挙型です。

### 値

| 値             | 説明                  |
| ------------- | ------------------- |
| `unknown`     | 同意ステータスがまだ決定されていない  |
| `required`    | 同意が必要（ポップアップが表示される） |
| `notRequired` | 同意は不要（非GDPR地域）      |
| `obtained`    | すでに同意を取得済み          |

***

## AdropConsentDebugGeography

異なる地域での同意フローをテストするための列挙型です。

### 値

| 値                  | 説明                 |
| ------------------ | ------------------ |
| `disabled`         | 実際のデバイス位置を使用       |
| `eea`              | GDPRテスト（欧州経済領域）    |
| `regulatedUSState` | CCPAテスト（カリフォルニアなど） |
| `other`            | 非規制地域テスト           |

***

## BrowserTarget

広告クリック時の遷移先URLの開き方を制御する列挙型です。

### 値

| 値          | 説明                |
| ---------- | ----------------- |
| `external` | システムのデフォルトブラウザで開く |
| `internal` | アプリ内ブラウザで開く       |

### 使用例

```dart theme={null}
final ad = interstitialAd;
if (ad.browserTarget == BrowserTarget.internal) {
  debugPrint('アプリ内ブラウザで広告が開きます');
}
```

***

## CreativeSize

クリエイティブのサイズを表すクラスです。

### コンストラクタ

```dart theme={null}
const CreativeSize({
  required double width,
  required double height,
})
```

### プロパティ

| プロパティ    | 型        | 説明 |
| -------- | -------- | -- |
| `width`  | `double` | 幅  |
| `height` | `double` | 高さ |

***

## AdropProperties

`AdropMetrics.setProperty`で使用する事前定義されたユーザープロパティキーの列挙型です。

### 値

| 値        | コード     | 説明                               |
| -------- | ------- | -------------------------------- |
| `age`    | `AGE`   | ユーザー年齢                           |
| `birth`  | `BIRTH` | ユーザー生年月日（yyyy、yyyyMM、yyyyMMdd形式） |
| `gender` | `GDR`   | ユーザー性別（`AdropGender`の値を使用）       |

### 使用例

```dart theme={null}
await AdropMetrics.setProperty(AdropProperties.age.code, 25);
await AdropMetrics.setProperty(AdropProperties.birth.code, '19900101');
await AdropMetrics.setProperty(AdropProperties.gender.code, AdropGender.male.code);
```

***

## AdropGender

`AdropProperties.gender`と一緒に使用する性別の値の列挙型です。

### 値

| 値         | コード | 説明  |
| --------- | --- | --- |
| `male`    | `M` | 男性  |
| `female`  | `F` | 女性  |
| `other`   | `O` | その他 |
| `unknown` | `U` | 不明  |

***

## 非推奨クラス

以下のクラスは非推奨であり、将来のバージョンで削除される予定です。

| 非推奨クラス                   | マイグレーション             | 備考                                                       |
| ------------------------ | -------------------- | -------------------------------------------------------- |
| `AdropBanner`            | `AdropBannerView`を使用 | バナー広告ウィジェット。`AdropBannerView`と`AdropBannerListener`に置き換え |
| `AdropNavigatorObserver` | 削除可能                 | 機能を提供しなくなり、将来のバージョンで削除予定                                 |

マイグレーションの詳細については[はじめに](/ja/sdk/flutter/overview#deprecated-class-migration)を参照してください。

***

## テストユニットID

開発およびテスト時に使用できるユニットIDです。

| フォーマット       | テストユニットID                          |
| ------------ | ---------------------------------- |
| バナー(320x50)  | `PUBLIC_TEST_UNIT_ID_320_50`       |
| バナー(320x100) | `PUBLIC_TEST_UNIT_ID_320_100`      |
| ネイティブ        | `PUBLIC_TEST_UNIT_ID_NATIVE`       |
| インタースティシャル   | `PUBLIC_TEST_UNIT_ID_INTERSTITIAL` |
| リワード         | `PUBLIC_TEST_UNIT_ID_REWARDED`     |
| ポップアップ(下部)   | `PUBLIC_TEST_UNIT_ID_POPUP_BOTTOM` |
| ポップアップ(中央)   | `PUBLIC_TEST_UNIT_ID_POPUP_CENTER` |
| スプラッシュ       | `PUBLIC_TEST_UNIT_ID_SPLASH`       |

<Warning>
  本番デプロイ前に必ず実際のユニットIDに置き換えてください。
</Warning>

***

## 関連ドキュメント

<CardGroup cols={2}>
  <Card title="はじめに" icon="rocket" href="/ja/sdk/flutter/overview">
    SDKインストールおよび設定ガイド
  </Card>

  <Card title="サンプル" icon="code" href="/ja/sdk/flutter/examples">
    サンプルコードとプロジェクト
  </Card>
</CardGroup>
