resizeWebview method

void resizeWebview(
  1. String placement,
  2. double height
)

passed to the webviewManager that get triggered by the ML when the webview is resized

Implementation

void resizeWebview(String placement, double height) {
  final screenSize = DeviceDescriptor.getScreenSize();
  if (screenSize == Size.zero) {
    TBLLogger.log("Viewport is zero, cannot resize webview");
    return;
  }
  double maxHeight = screenSize.height;
  //Limit the height to the screen size
  if (maxHeight < height) {
    height = maxHeight;
  }

  if (webViewHeight != height) {
    this.webViewHeight = height;
    // Trigger publisher resize event
    _taboolaStandardListener.didResize(placement, webViewHeight);
    // Trigger webview resize
    if (onWebviewResizeListener != null)
      onWebviewResizeListener!(placement, webViewHeight);
  }
}