Flutter AdMob Native Ads

Native and banner ads for Flutter on Android and iOS, with automatic reload, preloading, and 12 customizable native layouts.

pub.dev License

  • Native ads: 12 layouts, theme-aware styling, and cached ad support.
  • Banner ads: adaptive, inline adaptive, and standard sizes.
  • Automatic reload for both: configurable intervals, visibility/lifecycle/network checks, and retry on failure.
  • Preload and callbacks: prepare ads ahead of time and track load, click, impression, and revenue events.

Install & Setup

dependencies:
  flutter_admob_native_ads: ^1.1.4

Run flutter pub get, then configure your AdMob App ID on both platforms. App IDs contain ~; the ad unit IDs used in widgets contain /.

Android: set minSdk to 23 or higher, and add this inside <application> in android/app/src/main/AndroidManifest.xml:

<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="YOUR_ADMOB_APP_ID" />

iOS: target iOS 13 or higher, and add to ios/Runner/Info.plist:

<key>GADApplicationIdentifier</key>
<string>YOUR_ADMOB_APP_ID</string>

Initialize Google Mobile Ads in AppDelegate with MobileAds.shared.start(completionHandler: nil). See the complete platform setup for the AppDelegate example and CocoaPods instructions.

Native Ads with Auto Reload

Use Google test ad unit IDs during development; replace the placeholder below with the appropriate platform's native test ID.

import 'package:flutter_admob_native_ads/flutter_admob_native_ads.dart';

NativeAdWidget(
  options: NativeAdOptions(
    adUnitId: 'YOUR_NATIVE_AD_UNIT_ID',
    layoutType: NativeAdLayoutType.form6,
    enableSmartReload: true,
    reloadIntervalSeconds: 60,
    retryDelaySeconds: 12,
  ),
  height: NativeAdLayoutType.form6.recommendedHeight,
)

Omit style to follow the Flutter light/dark theme, or provide a NativeAdStyle for custom colors and spacing.

Use the platform's banner test ID during development.

BannerAdWidget(
  options: BannerAdOptions(
    adUnitId: 'YOUR_BANNER_AD_UNIT_ID',
    size: BannerAdSize.adaptiveBanner,
    enableSmartReload: true,
    reloadIntervalSeconds: 60,
    retryDelaySeconds: 12,
  ),
)

How Automatic Reload Works

Both examples enable an automatic reload attempt every 60 seconds. A reload proceeds only while the app is in the foreground, the ad is visible, and the network is available. Failed reloads use the configured retry delay.

Option Purpose
enableSmartReload: true Enable visibility-aware reload handling. Disabled by default.
reloadIntervalSeconds: 60 Attempt reload every 60 seconds. null disables the interval timer.
retryDelaySeconds: 12 Wait 12 seconds before retrying a failed reload.

The widgets track visibility automatically; their default visibilityThreshold is 0.5. For manual loading, preloading, or explicit reload() calls, use a NativeAdController or BannerAdController as shown in the usage guide.

Layout Previews

Design references for the 12 supported forms. Actual ad content and styling vary.

form1 form2 form3
Native ad form1 design reference Native ad form2 design reference Native ad form3 design reference
form4 form5 form6
Native ad form4 design reference Native ad form5 design reference Native ad form6 design reference
form7 form8 form9
Native ad form7 design reference Native ad form8 design reference Native ad form9 design reference
form10 form11 form12
Native ad form10 design reference Native ad form11 design reference Native ad form12 design reference
Additional full-screen design reference

This reference is separate from the 12 supported forms.

Full-screen native ad design reference

More Examples

MIT License — see LICENSE. Maintained by VietHoangTran.

Libraries

flutter_admob_native_ads
Flutter plugin for displaying AdMob Native Ads with customizable layouts and SwiftUI-style declarative styling.