WebViewElement constructor

WebViewElement(
  1. dynamic context, {
  2. String? initialUrl,
  3. JavascriptMode javascriptMode = JavascriptMode.unrestricted,
  4. Set<JavascriptChannel>? javascriptChannels,
  5. NavigationDelegate? navigationDelegate,
  6. Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
  7. bool debuggingEnabled = false,
  8. bool gestureNavigationEnabled = false,
  9. String userAgent = DEFAULT_USER_AGENT,
  10. 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(
  context, {
  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(context,
          defaultStyle: _defaultStyle,
          isReplacedElement: true,
          isDefaultRepaintBoundary: true);