Adding AdMob in Flutter app projects is one of the easiest ways to start earning money from a free app. Whether you built a radio player, a game or a small utility, Google AdMob lets you show ads and get paid without charging your users anything.
In this guide, we will walk through the whole process step by step. You will learn how to set up your AdMob account, install the right package, and show both banner ads and interstitial ads. No advanced experience needed, just a working Flutter project.
What You Need Before You Start
Before writing any code, make sure you have these things ready:
- A working Flutter project that runs on Android, iOS or both
- A Google AdMob account (free to create at admob.google.com)
- An app registered inside AdMob for each platform you support
- Ad units created for the ad types you want (banner, interstitial)
When you register your app in AdMob, you get an App ID. When you create ad units, each one gets an Ad Unit ID. Keep both handy, because you will need them in the next steps.
Step 1: Install the Google Mobile Ads Package
Google provides an official package called google_mobile_ads. It is the recommended way to use AdMob in Flutter app development.
Open your terminal in the project folder and run:
flutter pub add google_mobile_ads
This adds the package to your pubspec.yaml file. Then run flutter pub get if your editor does not do it automatically.
Add Your App ID on Android
Open android/app/src/main/AndroidManifest.xml and add a meta-data tag inside the application tag. Use the name com.google.android.gms.ads.APPLICATION_ID and set the value to your Android App ID from AdMob.
Also check that your minSdkVersion in android/app/build.gradle meets the requirement listed on the package page.
Add Your App ID on iOS
Open ios/Runner/Info.plist and add a key called GADApplicationIdentifier with your iOS App ID as a string. Google also recommends adding the SKAdNetwork identifiers listed in the AdMob documentation.
Important: if the App ID is missing, your app may crash on launch. This is the most common beginner mistake.
Step 2: Initialize the Mobile Ads SDK
The SDK must start before you load any ads. The best place to do this is in your main() function.
Make your main function async, call WidgetsFlutterBinding.ensureInitialized(), then call MobileAds.instance.initialize() before runApp(). That is all it takes.
Initializing early gives the SDK time to prepare, so your first ads load faster.
Step 3: Show a Banner Ad
Banner ads are small rectangles, usually placed at the top or bottom of a screen. They stay visible while users use your app, so they are a gentle way to start.
Create and Load the Banner
Inside a StatefulWidget, create a BannerAd object. You give it:
- adUnitId – your banner Ad Unit ID (use a test ID while developing)
- size – for example AdSize.banner
- request – a simple AdRequest()
- listener – a BannerAdListener with onAdLoaded and onAdFailedToLoad callbacks
Call .load() in initState(). In onAdLoaded, call setState so your screen knows the ad is ready. In onAdFailedToLoad, call ad.dispose() to free memory.
Display the Banner on Screen
Once loaded, place an AdWidget(ad: yourBannerAd) inside a SizedBox that matches the ad's width and height. Many developers put it in the bottomNavigationBar slot of a Scaffold.
Always dispose the banner in your widget's dispose() method. Forgetting to dispose ads can cause memory leaks.
Step 4: Show an Interstitial Ad
Interstitial ads cover the full screen. They usually earn more than banners, but they also interrupt the user. That is why timing matters a lot.
Load the Interstitial in Advance
Use InterstitialAd.load() with your interstitial Ad Unit ID, an AdRequest and an InterstitialAdLoadCallback. When it loads, save the ad in a variable. Load it a little before you need it, so it is ready when the moment comes.
Show It at the Right Moment
Before showing, set the fullScreenContentCallback. In onAdDismissedFullScreenContent, dispose the ad and load a new one for next time. Then call .show().
Good moments to show interstitials include:
- After a user finishes a game level
- When moving between major sections of the app
- After completing a task, like saving a file
Avoid showing them right when the app opens or in the middle of an action. Google's policies are strict about unexpected or accidental ad clicks.
Testing and Common Mistakes to Avoid
Testing is where many beginners get into trouble. When working with AdMob in Flutter app builds, follow these rules:
- Use test ad unit IDs during development. Google publishes official test IDs for each ad type.
- Never click your own live ads. This can get your account limited or suspended.
- Use different IDs for Android and iOS. Check the platform in code and pick the matching ID.
- Be patient with new ad units. Fresh accounts and ad units may not show live ads right away.
- Add a privacy policy and handle user consent where required, using the User Messaging Platform that Google provides.
Before publishing, swap your test IDs for real ones and test on a real device one more time.
Want a Ready-Made App With AdMob Already Built In?
If you would rather skip the setup work, a ready-made script can save you a lot of time. For example, our Single Radio Flutter app already includes AdMob, a sleep timer and a music visualizer for Android and iOS. You can browse more options in our scripts and apps store.
And if you have a unique idea, our team can build it for you, with AdMob in Flutter app code set up properly from day one.
Ready to launch your monetized app? Check out our Flutter App Development service or get a free quote today.
Frequently asked questions
Which package do I use to add AdMob to Flutter?
Use the official google_mobile_ads package from pub.dev. It supports banner, interstitial, rewarded and native ads on Android and iOS.
Why are my AdMob ads not showing in Flutter?
New ad units can take some time before they serve ads. Also check that your App ID is in AndroidManifest.xml and Info.plist and that you called MobileAds.instance.initialize().
Can I click my own ads to test them?
No. Clicking your own live ads can get your AdMob account limited. Always use Google's test ad unit IDs or register your phone as a test device.
How often should I show interstitial ads?
Show them only at natural breaks, such as after finishing a level or closing a screen. Showing them too often annoys users and can break AdMob policies.
Do I need a separate ad unit for Android and iOS?
Yes. Create a separate app and separate ad units in AdMob for each platform, then pick the right ID in your code based on the platform.


