WebView constructor
const
WebView({
- Key? key,
- WebViewCreatedCallback? onWebViewCreated,
- String? initialUrl,
- List<
WebViewCookie> initialCookies = const <WebViewCookie>[], - JavascriptMode javascriptMode = JavascriptMode.disabled,
- Set<
JavascriptChannel> ? javascriptChannels, - Set<
Factory< ? gestureRecognizers,OneSequenceGestureRecognizer> > - PageStartedCallback? onPageStarted,
- PageFinishedCallback? onPageFinished,
- PageLoadingCallback? onProgress,
- WebResourceErrorCallback? onWebResourceError,
- bool debuggingEnabled = false,
- bool geolocationEnabled = false,
- String? userAgent,
- bool zoomEnabled = true,
- AutoMediaPlaybackPolicy initialMediaPlaybackPolicy = AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
- bool allowsInlineMediaPlayback = false,
- Color? backgroundColor,
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.initialCookies = const <WebViewCookie>[],
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.geolocationEnabled = false,
this.userAgent,
this.zoomEnabled = true,
this.initialMediaPlaybackPolicy =
AutoMediaPlaybackPolicy.require_user_action_for_all_media_types,
this.allowsInlineMediaPlayback = false,
this.backgroundColor,
}) : assert(javascriptMode != null),
assert(initialMediaPlaybackPolicy != null),
assert(allowsInlineMediaPlayback != null),
super(key: key);