dispose method

  1. @override
void dispose()

Implementation

@override
void dispose() {
  _channel?.setMethodCallHandler(null);
  _channel = null;
  iframeContainer.remove();
  if (WebPlatformManager.webViews.containsKey(_viewId)) {
    WebPlatformManager.webViews.remove(_viewId);
  }
  bridgeJsObject = js.JsObject.fromBrowserObject(
      js.context[WebPlatformManager.BRIDGE_JS_OBJECT_NAME]);
  var webViews = bridgeJsObject['webViews'] as js.JsObject;
  if (webViews.hasProperty(_viewId)) {
    webViews.deleteProperty(_viewId);
  }
}