v2.0.3easy_admob_ads_flutter
AdMob विज्ञापन प्रारूपों को न्यूनतम सेटअप के साथ एकीकृत करने के लिए एक सरल और लचीला Flutter पैकेज।
एक गूगल एडमोब वापसी फ्लटर पैकेज
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
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!



initialize()dependencies:
easy_admob_ads_flutter: ^<latest_version>
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>
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.
// 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.
निर्भरता सूची 8 आइटम
{"sdk":"flutter"}^9.1.0^2.0.7^2.5.5^1.3.0^7.3.1{"sdk":"flutter"}^6.0.0उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗