Skip to main content

customadswidget 1.1.0 copy "customadswidget: ^1.1.0" to clipboard
customadswidget: ^1.1.0 copied to clipboard

Non-intrusive custom ads for Flutter Web: image banners and templates loaded from a remote JSON, rotation, scheduling and viewable impression tracking.

1.1.0 #

Customizable banner sizes, bottom banner support, and new standard IAB/mobile banner formats.

Added

  • CustomAd.banner(...): factory constructor designed for bottom and standard banners with customizable dimensions (e.g. Size(double.infinity, 50) for full-width docked bottom bars or Size(320, 50)).
  • size parameter in CustomAd, CustomAdRotator, and AdSlot to override or explicitly specify width and height.
  • New standard formats in AdFormat:
    • banner: 320x50 standard mobile banner (ideal for bottom bars and mobile navigation).
    • largeBanner: 320x100 large mobile banner with room for title, meta line, description, and CTA.
    • fullBanner: 468x60 horizontal banner for tablets and desktop.
    • custom: fluid/freeform format for non-standard container sizes.
  • AdLayout: added _buildLargeBanner layout to present title, description, image, and CTA in larger horizontal banners.
  • AdPlacement.size: placements now support explicit sizes in code, as well as deserializing width, height, or a size object/array from server JSON.
  • resolveAdSize: updated sizing engine to handle explicit size overrides while continuing to enforce non-intrusive height caps and viewport policies.

1.0.1 #

Internal clean-up following SOLID, plus a few additions. Existing code keeps working without changes.

Added

  • AdSource: base class for any ads source. It handles the loading state, errors, the last valid configuration, periodic refresh and merging simultaneous requests; a source only implements fetchConfig(). CustomAdScope.source and AdSlot.source now accept any AdSource.
  • AssetAdSource: reads the ads JSON from the app's assets, so AdSlot works without a server.
  • MemoryAdSource: ads that are already in memory, with update(config).
  • CustomAdScope.onOpenUrl and CustomAdScope.defaultOpenUrl: replace how a click opens the ad's link, for example to route it inside the app.
  • ResolvedAdStyle: what AdStyle.resolve() returns, with non-null colors. builder callbacks receive it.
  • AdPolicy.maxAdHeight() and AdPolicy.allowsVerticalAd().

Fixed

  • AdCta and AdMetaLine no longer throw when given an AdStyle without colors (for example const AdStyle() inside a builder): missing colors are taken from the theme.

Changed (internal)

  • RemoteAdSource now extends AdSource; its public API is unchanged.
  • Size and policy calculations moved out of CustomAd into a pure function, and impression tracking into its own class. Both are unit tested.
  • Magic numbers in the layouts replaced by named constants.

1.0.0 #

Initial release.

  • AdSlot: shows the ads of a placement from a remote JSON, with rotation, scheduling and an optional placeholder.
  • CustomAd: a single ad in six formats (creative, leaderboard, mediumRectangle, skyscraper, card, hero), with hover effects, click handling, viewable impression tracking, an optional close button and a fully custom builder.
  • CustomAdRotator: rotates several ads in the same space and pauses on hover.
  • CustomAdScope: shared source, style, policy and analytics callbacks, with CustomAdScope.merge for per-section overrides.
  • RemoteAdSource: downloads and refreshes the ads JSON, merges simultaneous requests and keeps the last valid configuration on errors.
  • AdPolicy: non-intrusive rules based on the Better Ads Standards and Acceptable Ads (mandatory label, height cap, side-only vertical ads, frozen animations, minimum rotation interval).
  • AdData, AdAsset, AdConfig, AdPlacement and AdStyle models, plus the AdImage, AdCta and AdMetaLine building blocks.
0
likes
150
points
1.14k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Non-intrusive custom ads for Flutter Web: image banners and templates loaded from a remote JSON, rotation, scheduling and viewable impression tracking.

Repository (GitHub)
View/report issues

Topics

#ads #advertising #banner #web #widget

License

MIT (license)

Dependencies

flutter, http, url_launcher, visibility_detector

More

Packages that depend on customadswidget