WebViewElement constructor
WebViewElement(
- int targetId,
- Pointer<
NativeElement> nativePtr, - ElementManager elementManager, {
- required String tagName,
- String? initialUrl,
- JavascriptMode javascriptMode = JavascriptMode.unrestricted,
- Set<
JavascriptChannel> ? javascriptChannels, - Set<
Factory< ? gestureRecognizers,OneSequenceGestureRecognizer> > - bool debuggingEnabled = false,
- String userAgent = DEFAULT_USER_AGENT,
- 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<NativeElement> nativePtr,
ElementManager elementManager, {
required String tagName,
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,
tagName: tagName, defaultStyle: _defaultStyle, isIntrinsicBox: true, repaintSelf: true) {
_width = CSSLength.toDisplayPortValue(ELEMENT_DEFAULT_WIDTH, viewportSize: viewportSize);
_height = CSSLength.toDisplayPortValue(ELEMENT_DEFAULT_HEIGHT, viewportSize: viewportSize);
}