WebView constructor

const WebView({
  1. Key? key,
  2. WebViewCreatedCallback? onWebViewCreated,
  3. String? initialUrl,
  4. JavascriptMode javascriptMode = JavascriptMode.disabled,
  5. Set<JavascriptChannel>? javascriptChannels,
  6. NavigationDelegate? navigationDelegate,
  7. Set<Factory<OneSequenceGestureRecognizer>>? gestureRecognizers,
  8. PageStartedCallback? onPageStarted,
  9. PageFinishedCallback? onPageFinished,
  10. PageLoadingCallback? onProgress,
  11. WebResourceErrorCallback? onWebResourceError,
  12. bool debuggingEnabled = false,
  13. bool gestureNavigationEnabled = false,
  14. String? userAgent,
  15. AutoMediaPlaybackPolicy initialMediaPlaybackPolicy = AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
  16. bool allowsInlineMediaPlayback = false,
})

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

const WebView({
  Key? key,
  this.onWebViewCreated,
  this.initialUrl,
  this.javascriptMode = JavascriptMode.disabled,
  this.javascriptChannels,
  this.navigationDelegate,
  this.gestureRecognizers,
  this.onPageStarted,
  this.onPageFinished,
  this.onProgress,
  this.onWebResourceError,
  this.debuggingEnabled = false,
  this.gestureNavigationEnabled = false,
  this.userAgent,
  this.initialMediaPlaybackPolicy = AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
  this.allowsInlineMediaPlayback = false,
})  : assert(javascriptMode != null),
      assert(initialMediaPlaybackPolicy != null),
      assert(allowsInlineMediaPlayback != null),
      super(key: key);