WebView constructor
const
WebView({
- Key? key,
- WebViewCreatedCallback? onWebViewCreated,
- String? initialUrl,
- JavascriptMode javascriptMode = JavascriptMode.disabled,
- Set<
JavascriptChannel> ? javascriptChannels, - Set<
Factory< ? gestureRecognizers,OneSequenceGestureRecognizer> > - PageStartedCallback? onPageStarted,
- PageFinishedCallback? onPageFinished,
- PageLoadingCallback? onProgress,
- WebResourceErrorCallback? onWebResourceError,
- bool debuggingEnabled = false,
- String? userAgent,
- AutoMediaPlaybackPolicy initialMediaPlaybackPolicy = AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
- 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);