パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリhuzaibsayyed/easy_admob_ads_flutter

easy_admob_ads_flutter

Google AdMobラッパーのFlutterパッケージ

easy_admob_ads_flutter のプロジェクト画像
スター
2
フォーク
4
最終プッシュ(UTC)
2026/08/21
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

Stand With Palestine

Easy AdMob Integration for Flutter

pub package Pub Points Last Commit Pull Requests Code Size License

A simple, configurable Flutter wrapper for Google AdMob. One EasyAdMobAds.instance sets up the SDK, GDPR/UMP consent, and a global on/off switch for ads. All six ad formats are supported with their own controller or widget.

Show some ❤️ by giving the repo a ⭐ and liking 👍 the package on pub.dev!

Screenshots

Static AdMob Demo Animated AdMob Demo Static AdMob Demo

Features

  • Banner (adaptive, optionally collapsible)
  • Interstitial
  • Rewarded
  • Rewarded Interstitial
  • App Open (auto-preloaded and shown on app resume)
  • Native (small/medium templates)
  • GDPR/UMP consent flow, including the "privacy options" re-consent form
  • App Tracking Transparency (ATT) consent on iOS 14.5+, requested automatically during initialize()
  • Network connectivity awareness — ad requests pause while offline and resume as soon as connectivity returns

Getting started

1. Install
dependencies:
  easy_admob_ads_flutter: ^<latest_version>
2. Platform setup

Add your AdMob App ID:

Android — android/app/src/main/AndroidManifest.xml:

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

iOS — ios/Runner/Info.plist:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>
3. Initialize
void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await EasyAdMobAds.instance.initialize(
    config: const EasyAdsConfig(
      androidAdUnitIds: {
        AdType.banner: 'ca-app-pub-.../...',
        AdType.interstitial: 'ca-app-pub-.../...',
      },
      iosAdUnitIds: {
        AdType.banner: 'ca-app-pub-.../...',
        AdType.interstitial: 'ca-app-pub-.../...',
      },
      testDeviceIds: ['YOUR_TEST_DEVICE_ID'],
    ),
  );

  runApp(const MyApp());
}

Any AdType you don't configure automatically falls back to a Google test ad unit ID (with a warning logged), so the package works out of the box during development.

Usage

// Banner
const EasyBannerAd(collapsible: true, height: 100)

// Native
EasyNativeAd.medium()

// Interstitial
final interstitialAd = EasyInterstitialAd()..loadAd();
await interstitialAd.showAd();

// Rewarded
final rewardedAd = EasyRewardedAd(onRewardEarned: (reward) {
  // grant the reward
})..loadAd();
await rewardedAd.showAd();

// Rewarded Interstitial
final rewardedInterstitialAd = EasyRewardedInterstitialAd(onRewardEarned: (reward) {
  // grant the reward
})..loadAd();
await rewardedInterstitialAd.showAd();

// App Open — preloaded automatically; show it manually if you want:
await EasyAdMobAds.instance.appOpenAd?.showAdIfAvailable();

// Turn all ads on/off (e.g. after a "remove ads" purchase)
EasyAdMobAds.instance.adsEnabled = false;

// GDPR privacy options
if (EasyAdMobAds.instance.isPrivacyOptionsRequired) {
  EasyAdMobAds.instance.showPrivacyOptionsForm();
}

See the example/ app for a full demo screen with all ad types, the on/off switch, and the consent button wired up.

Author

Huzaib Sayyed

GitHub LinkedIn

Huzaib Sayyed GitHub avatar
GitHub 作者

Huzaib Sayyed ↗

言語DartSwiftKotlinObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 8 件

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗