removeWebview static method

dynamic removeWebview(
  1. WebViewController webViewController,
  2. TBLWebViewManager webViewManager
)

Previously, the webview was not cleared, resulting in an issue where an alert popup would appear on Android devices after switching to tabs. After clearing the webview in the dispose() function, this problem was resolved. For more details, refer to the following link: https://github.com/flutter/flutter/issues/119616

Implementation

static removeWebview(
    WebViewController webViewController, TBLWebViewManager webViewManager) {
  webViewController.removeJavaScriptChannel(webViewManager.flutterBridge);
  webViewController.loadRequest(Uri.parse('about:blank'));
}