customadswidget 1.1.0
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 orSize(320, 50)).sizeparameter inCustomAd,CustomAdRotator, andAdSlotto 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_buildLargeBannerlayout to present title, description, image, and CTA in larger horizontal banners.AdPlacement.size: placements now support explicit sizes in code, as well as deserializingwidth,height, or asizeobject/array from server JSON.resolveAdSize: updated sizing engine to handle explicitsizeoverrides 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 implementsfetchConfig().CustomAdScope.sourceandAdSlot.sourcenow accept anyAdSource.AssetAdSource: reads the ads JSON from the app's assets, soAdSlotworks without a server.MemoryAdSource: ads that are already in memory, withupdate(config).CustomAdScope.onOpenUrlandCustomAdScope.defaultOpenUrl: replace how a click opens the ad's link, for example to route it inside the app.ResolvedAdStyle: whatAdStyle.resolve()returns, with non-null colors.buildercallbacks receive it.AdPolicy.maxAdHeight()andAdPolicy.allowsVerticalAd().
Fixed
AdCtaandAdMetaLineno longer throw when given anAdStylewithout colors (for exampleconst AdStyle()inside abuilder): missing colors are taken from the theme.
Changed (internal)
RemoteAdSourcenow extendsAdSource; its public API is unchanged.- Size and policy calculations moved out of
CustomAdinto 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 custombuilder.CustomAdRotator: rotates several ads in the same space and pauses on hover.CustomAdScope: shared source, style, policy and analytics callbacks, withCustomAdScope.mergefor 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,AdPlacementandAdStylemodels, plus theAdImage,AdCtaandAdMetaLinebuilding blocks.