PlatformWebViewWidgetCreationParams class

Object specifying creation parameters for creating a WebViewWidgetDelegate.

Platform specific implementations can add additional fields by extending this class.

{@tool sample} This example demonstrates how to extend the PlatformWebViewWidgetCreationParams to provide additional platform specific parameters.

When extending PlatformWebViewWidgetCreationParams additional parameters should always accept null or have a default value to prevent breaking changes.

class AndroidWebViewWidgetCreationParams
    extends PlatformWebViewWidgetCreationParams {
  AndroidWebViewWidgetCreationParams({
    super.key,
    super.layoutDirection,
    super.gestureRecognizers,
    this.platformSpecificFieldExample,
  });

  WKWebViewWidgetCreationParams.fromPlatformWebViewWidgetCreationParams(
    PlatformWebViewWidgetCreationParams params, {
    Object? platformSpecificFieldExample,
  }) : this(
          key: params.key,
          layoutDirection: params.layoutDirection,
          gestureRecognizers: params.gestureRecognizers,
          platformSpecificFieldExample: platformSpecificFieldExample,
        );

  final Object? platformSpecificFieldExample;
}

{@end-tool}

Annotations

Constructors

PlatformWebViewWidgetCreationParams({Key? key, required PlatformWebViewController controller, TextDirection layoutDirection = TextDirection.ltr, Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{}})
Used by the platform implementation to create a new PlatformWebViewWidget.
const

Properties

controller → PlatformWebViewController
The PlatformWebViewController that allows controlling the native web view.
final
gestureRecognizers Set<Factory<OneSequenceGestureRecognizer>>
The gestureRecognizers specifies which gestures should be consumed by the web view.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
final
layoutDirection TextDirection
The layout direction to use for the embedded WebView.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited