BannerManager class
Singleton manager for banner operations Handles caching, updates, merging, and real-time updates
Constructors
- BannerManager()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearCache(
String bannerName, String bannerSize) → void - Clear cache for a banner
-
dispose(
) → void - Dispose resources
-
getCachedBanners(
String bannerName, String bannerSize) → List< AdItem> ? - Get cached banners (without fetching)
-
loadBanners(
String bannerName, String bannerSize, {bool forceRefresh = false}) → Future< List< AdItem> > - Load banners for a banner name and size ALWAYS calls the API to fetch fresh data, regardless of cache Cache is only used as fallback if API call fails bannerSize is used for cache keys and callbacks (apiValue format like "BANNER") Automatically converts to widthxheight format (like "320x50") for API calls
-
mergeAndUpdateBanners(
String bannerName, String bannerSize, List< AdItem> newItems) → List<AdItem> - Merge new items with existing items Updates existing items by ID/campaignId, adds new items, sorts by priority
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshBanner(
String bannerName, String bannerSize) → Future< List< AdItem> > - Refresh banners (force refresh from API)
-
registerCallback(
String bannerName, String bannerSize, BannerCallback callback) → void - Register a callback for banner updates
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterCallback(
String bannerName, String bannerSize, BannerCallback callback) → void - Unregister a callback
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited