initialize method

void initialize(
  1. List<BannerResponse> banners,
  2. ScrollController? scrollController,
  3. RelevaClient? client
)

Implementation

void initialize(List<BannerResponse> banners, ScrollController? scrollController, RelevaClient? client) {
  debugPrint('[BannerManagerService] initialize called with ${banners.length} banners');
  _banners.clear();
  _banners.addAll(banners);
  _scrollController = scrollController;
  _client = client;

  // Clear previous subscriptions
  for (var subscription in _subscriptions) {
    subscription.cancel();
  }
  _subscriptions.clear();

  // Clear displayed banners so they can be shown again when returning to screen
  debugPrint('[BannerManagerService] Clearing _displayedBanners (had ${_displayedBanners.length} entries)');
  _displayedBanners.clear();

  _setupTriggers();
}