onWebViewScrolledToContentTop method

void onWebViewScrolledToContentTop()

This event is eventually called from MobileLoader, when the WebView's content reached top

Implementation

void onWebViewScrolledToContentTop() {
  Logger.log('onWebViewScrolledToContentTop');
  // since on bounce affect we received form ML multiple time webViewDidScrollToTop() event (negative number) we need to check if we already received it once
  // You can refer to the code on ML project that notify us on scrollToTop here: updateScrollPosition() in TaboolaMobile.ts
  if (!didReceiveFromMLScrollToTop) {
    didReceiveFromMLScrollToTop = true;
    canWVContentScrollUp = false;
    // Set y position to 0 because the webView scrolled to top
    yGlobal = 0;
    dragDistance = Offset.zero;
  }
}