Skip to main content

simple_admob_native_ad 2.5.1 copy "simple_admob_native_ad: ^2.5.1" to clipboard
simple_admob_native_ad: ^2.5.1 copied to clipboard

A simple, compact Flutter plugin for displaying Google AdMob native ads as banners with auto-refresh and lifecycle management.

2.5.1 #

  • Docs only: the padding to keep the AdChoices icon inside a rounded corner is about 6 for a radius of 16, not 4. The icon is a 15-point square with corners rounded by about 3; with 4 it stays inside but its corner touches the curve (0.2 points, measured on an iPhone), and with 6 it keeps about 3 points clear. The README's stacked example uses 6 (and a height of 134).

2.5.0 #

  • New layout: AdLayout.stacked: the icon and the text beside it, and the call-to-action button on its own line under them, as wide as the ad (122 points high on a phone, 164 on a tablet; the icon grows or shrinks with the height). The default, AdLayout.row, is the banner as before. Changing the layout reloads the ad.
    • iOS: built in code (the row stays the .xib); the button is a capsule (40pt, iPad 48pt) with a semibold title. Android: simple_native_ad_stacked.xml, with the row's view ids.
    • The text keeps 22 points clear of the right edge for the AdChoices icon in the top-right corner.
  • New padding (default EdgeInsets.zero): space between the background's edges and the ad's own view. The AdChoices icon sits in the very corner of the ad's view, so with a borderRadius it stuck out of the rounded corner; an inset of about a quarter of the radius (4 for 16) keeps it inside the curve. The background still fills height.
  • The recommended height (when height is left out) includes the padding.

2.4.0 #

  • A refresh no longer blinks. The ad on show stays until the next one has loaded, then cross-fades into it (animationDuration). Until now it went at once and the placeholder showed while the next one loaded. A refresh that fails keeps the ad on show.
  • Fix: the ad a refresh replaced was never disposed, so each refresh kept one more ad (and its native view) in memory for as long as the widget was up. It's disposed once its view is out of the tree.
  • New pauseRefresh (default false): holds the refresh while the ad can't be seen, scrolled away in a list or under the app's bars, say. The app coming back from the background doesn't start the refresh while it's true.
  • onAdFailedToLoad is called only when no ad is on show (not for a failed refresh).
  • The ad no longer builds again every second (the refresh countdown was kept with setState).

2.3.0 #

  • Style options to match the app's look. New optional parameters: adLabel (the attribution badge's text, for your app's language), primaryTextColor, secondaryTextColor, ctaBackgroundColor, ctaTextColor, ctaBorderColor and borderRadius. Left out, the ad looks as before. Changing any of them reloads the ad.
    • iOS: the call-to-action button is built with UIButtonConfiguration, so its colors are set on the configuration too, and in this styled mode its title gets the intended 15pt (iPad 17pt) instead of the configuration's 17pt.
    • The badge grows to fit a longer label (at least the "Ad" badge's width).
  • The ad takes the width it's given (it was always the screen's), so it can sit inset, in a card for example. Full-width layouts look the same.

2.2.0 #

  • Minimum Flutter is now 3.44 (Dart 3.12), up from 3.38.1. Apps on Flutter 3.38–3.43 can stay on 2.1.1.
  • Android: migrated to built-in Kotlin. The plugin no longer applies the Kotlin Gradle plugin (kotlin-android). Apps on AGP 9 no longer get Flutter's warning that this plugin applies KGP and will fail to build in future Flutter versions, and they can turn on android.builtInKotlin=true (Flutter 3.47+). Apps on AGP 8 need no changes: since Flutter 3.44 the Flutter Gradle plugin applies kotlin-android to plugins that do not, which is why the minimum Flutter went up.
  • Require google_mobile_ads: ^9.2.0 (was ^9.1.0), which uses Google Mobile Ads SDK 25.5.0 on Android and 13.11.0 on iOS.
  • No Dart API changes, and no iOS changes.
  • Example app: Gradle 9.3.1, AGP 9.1.0 and Kotlin 2.4.0 with built-in Kotlin enabled.

2.1.1 #

  • Ads no longer break at large text sizes. The ad sits in a fixed-size slot laid out by Flutter, so its text cannot grow with the user's text size setting.
    • iOS: the call-to-action button is built with UIButtonConfiguration, which follows Dynamic Type and ignores titleLabel.font. At the largest accessibility sizes its title overflowed the slot and was drawn on top of the app's other Flutter screens. The ad view now caps Dynamic Type (maximumContentSizeCategory, iOS 15+) and clips to its bounds.
    • Android: ad text sizes are now in dp instead of sp, so the font size setting no longer pushes the text out of the fixed-height banner.

2.1.0 #

  • Swift Package Manager support on iOS. The plugin now ships ios/simple_admob_native_ad/Package.swift, so it no longer conflicts with google_mobile_ads 9.x when Flutter builds with SPM (the default since Flutter 3.47). Apps can drop enable-swift-package-manager: false and the CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES workaround that 2.0.0 required.
  • SPM builds require Flutter 3.47 or newer (that is where the tooling learned to resolve a plugin's Swift package dependency on another plugin). On Flutter 3.38–3.46 keep enable-swift-package-manager: false, which is the default there anyway.
  • CocoaPods keeps working — the podspec builds the same sources. Apps that still need CocoaPods (for example because another plugin has not adopted SPM) need no changes, but they do still need the CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES flag, because that is a google_mobile_ads 9.x + CocoaPods issue.
  • iOS sources moved from ios/Classes/ to ios/simple_admob_native_ad/Sources/ (SPM requires every source file to live inside the package directory), and Swift and Objective-C are split into two targets (simple_admob_native_ad / simple_admob_native_ad_objc) because SPM cannot mix languages in one target. The Swift module name is unchanged, so import simple_admob_native_ad in your AppDelegate keeps working. No Dart or Android changes.
  • Fix SimpleNativeAd.xib lookup: under SPM the nib lives in the target's resource bundle, not next to the class, so the factory now resolves the bundle at runtime.

2.0.0 #

  • Breaking: Require google_mobile_ads: ^9.1.0 (was ^6.0.0). Apps still on google_mobile_ads 6.x–8.x must stay on 1.2.1.
  • Breaking: Raise minimum Flutter to 3.38.1, as required by google_mobile_ads 8.0.0.
  • No Dart API changes. The Kotlin and Objective-C factory interfaces used by this plugin (NativeAd, NativeAdListener, NativeAdOptions, GoogleMobileAdsPlugin.registerNativeAdFactory, FLTGoogleMobileAdsPlugin.registerNativeAdFactory) are unchanged in google_mobile_ads 9.x; only the Android import path of NativeAdFactory moved (it is now a top-level type instead of nested in GoogleMobileAdsPlugin).
  • iOS setup changed. google_mobile_ads 9.x ships a Swift Package, and Flutter 3.47 enables Swift Package Manager by default. Because this plugin is still CocoaPods-only, apps must turn SPM off (flutter: config: enable-swift-package-manager: false) and set CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES in their Podfile. See the iOS section of the README. Swift Package Manager adoption is tracked for a future release.

1.2.1 #

  • Fix iOS native ad icon left padding
  • Fix Android Ad label rounded corners

1.2.0 #

  • Add leftPadding and rightPadding parameters for native ad layout customization
  • Add adChoicesPlacement parameter to control AdChoices icon position

1.0.1 #

  • Added screenshots to pub.dev listing

1.0.0 #

  • Initial release
  • Native ad banner support for iOS and Android
  • Auto-refresh with configurable interval
  • Automatic lifecycle management
  • Dark/light mode support with forceColorMode parameter
  • Customizable background color with backgroundColor parameter
  • Customizable placeholder and borders
  • Theme-aware color scheme
2
likes
150
points
817
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A simple, compact Flutter plugin for displaying Google AdMob native ads as banners with auto-refresh and lifecycle management.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, google_mobile_ads, plugin_platform_interface

More

Packages that depend on simple_admob_native_ad

Packages that implement simple_admob_native_ad