TBLClassicUnit constructor

TBLClassicUnit(
  1. String _publisherId,
  2. String _mode,
  3. String _placement,
  4. String _pageUrl,
  5. String _pageType,
  6. String _pageId,
  7. String _targetType,
  8. bool _isFeed,
  9. TBLClassicListener _tblClassicListener,
  10. HashMap<String, String> _unrecognizedPageExtraProperties,
  11. TBLTrackingManager _tblTrackingManager,
  12. TBLEventsManager _tblEventsManager, {
  13. Key? key,
  14. int? viewId,
  15. ScrollController? scrollController,
  16. bool? keepAlive,
  17. Future<bool>? isWarmedUpWebview,
})

Implementation

TBLClassicUnit(
  this._publisherId,
  this._mode,
  this._placement,
  this._pageUrl,
  this._pageType,
  this._pageId,
  this._targetType,
  this._isFeed,
  this._tblClassicListener,
  this._unrecognizedPageExtraProperties,
  this._tblTrackingManager,
  this._tblEventsManager, {
  Key? key,
  int? viewId,
  ScrollController? scrollController,
  bool? keepAlive,
  Future<bool>? isWarmedUpWebview,
})  : this.scrollController = scrollController ??= ScrollController(),
      this._viewId = viewId ?? TBLWebviewUtils.generateViewId() {
  PlatformWebViewControllerCreationParams
      platformWebViewControllerCreationParams =
      TBLWebviewUtils.createPlatformWebViewControllerCreationParams();
  // drill down the page extra properties to the unit
  // To ensure that the TBLClassicUnit is initialized with the correct unit extra props, we're using setUnitExtraProps here.
  // Calling setUnitExtraProps within _initialize would be problematic on iOS, as we wait for isWarmedUpWebview to be completed.
  // This delay could lead to the constructor's setUnitExtraProps call overriding the initial values set in the publisher's.
  setUnitExtraProps(_unrecognizedPageExtraProperties);
  _initialize(platformWebViewControllerCreationParams, isWarmedUpWebview);
}