WebViewElement constructor

WebViewElement(
  1. int targetId,
  2. Pointer<NativeEventTarget> nativePtr,
  3. ElementManager elementManager, {
  4. String? initialUrl,
  5. JavascriptMode javascriptMode = JavascriptMode.unrestricted,
  6. Set<JavascriptChannel>? javascriptChannels,
  7. NavigationDelegate? navigationDelegate,
  8. Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
  9. bool debuggingEnabled = false,
  10. bool gestureNavigationEnabled = false,
  11. String userAgent = DEFAULT_USER_AGENT,
  12. AutoMediaPlaybackPolicy initialMediaPlaybackPolicy = AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
})

Creates a new web view.

The web view can be controlled using a WebViewController that is passed to the onWebViewCreated callback once the web view is created.

The javascriptMode and autoMediaPlaybackPolicy parameters must not be null.

Implementation

WebViewElement(
  int targetId,
  Pointer<NativeEventTarget> nativePtr,
  ElementManager elementManager, {
  this.initialUrl,
  this.javascriptMode = JavascriptMode.unrestricted,
  this.javascriptChannels,
  this.navigationDelegate,
  this.gestureRecognizers,
  this.debuggingEnabled = false,
  this.gestureNavigationEnabled = false,
  this.userAgent = DEFAULT_USER_AGENT,
  this.initialMediaPlaybackPolicy =
      AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
})  : assert(javascriptMode != null),
      assert(initialMediaPlaybackPolicy != null),
      super(targetId, nativePtr, elementManager,
          defaultStyle: _defaultStyle,
          isIntrinsicBox: true,
          isDefaultRepaintBoundary: true);