google_mobile_ads
9.2.0, released 4 weeks ago by google.dev
Flutter plugin to show AdMob banner, interstitial, rewarded and native ads.
What it does
Provides a Dart API that wraps the Google Mobile Ads SDK for Android and iOS. Lets you load and display various ad formats and configure ad request settings.
AI-written summary of version 9.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to monetize a Flutter app with AdMob or Ad Manager ads
- You require banner, interstitial, rewarded or native ad support on Android and iOS
Skip it when
- You prefer a fully open‑source ad solution without Google dependencies
- You target platforms other than Android or iOS
Strengths
- Official Google‑maintained plugin
- Supports all major ad formats
- Regular updates and bug fixes
Weaknesses
- Requires native SDK setup and platform‑specific configuration
- Limited to Google’s ad ecosystem
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Add the plugin to pubspec, run flutter pub get, then follow Android (update AndroidManifest, Gradle) and iOS (add App Transport Security exceptions, update Info.plist) setup steps in the official docs.
import 'package:google_mobile_ads/google_mobile_ads.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
MobileAds.instance.initialize();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final BannerAd _banner = BannerAd(
adUnitId: '<YOUR_AD_UNIT_ID>',
size: AdSize.banner,
request: AdRequest(),
listener: BannerAdListener(),
)..load();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('AdMob Banner')),
body: Center(child: AdWidget(ad: _banner)),
),
);
}
}Alternatives
Packages that do the same job and could replace google_mobile_ads.
- in_app_purchase
If you need to sell digital goods or subscriptions instead of showing ads
94Compare
Works with
Packages commonly used together with google_mobile_ads: ones it builds on, ones built on it, and its own family.
- webview_flutter_wkwebviewgoogle_mobile_ads depends on itA Flutter plugin providing a WebView widget based on Apple's WKWebView control.
- webview_flutter_androidgoogle_mobile_ads depends on itAndroid implementation of the webview_flutter plugin providing a WebView widget.
- webview_fluttergoogle_mobile_ads depends on itFlutter plugin that embeds a native WebView widget.
- google_walletSame familyFlutter plugin to integrate Google Wallet and save passes via JWT
- gma_mediation_metaBuilt on google_mobile_adsMediation adapter for Meta Audience Network using google_mobile_ads.
- gma_mediation_unityBuilt on google_mobile_adsMediation adapter for Unity Ads to work with the google_mobile_ads Flutter plugin
- gma_mediation_applovinBuilt on google_mobile_adsMediation adapter for AppLovin ad network via the google_mobile_ads plugin.
- gma_mediation_liftoffmonetizeBuilt on google_mobile_adsMediation adapter for Liftoff Monetize in the Google Mobile Ads plugin