StacWebView class

A Stac model representing Flutter's WebView widget.

Renders a web page within a Flutter application using the webview_flutter package. Supports JavaScript execution, custom user agents, zoom controls, and layout direction.

StacWebView(
  url: 'https://example.com',
  javaScriptMode: JavaScriptMode.unrestricted,
  backgroundColor: '#FFFFFF',
)
{
  "type": "webView",
  "url": "https://example.com",
  "javaScriptMode": "unrestricted",
  "backgroundColor": "#FFFFFF",
  "enableZoom": false,
  "layoutDirection": "ltr"
}
Inheritance
  • Object
  • StacElement
  • StacWidget
  • StacWebView
Annotations
  • @JsonSerializable.new()

Constructors

StacWebView({required String url, JavaScriptMode? javaScriptMode, String? backgroundColor, String? userAgent, bool? enableZoom, TextDirection? layoutDirection})
Creates a StacWebView with the given configuration.
const
StacWebView.fromJson(Map<String, dynamic> json)
Creates a StacWebView from JSON.
factory

Properties

backgroundColor String?
Background color of the WebView.
final
enableZoom bool?
Sets whether zoom is enabled for the WebView.
final
hashCode int
The hash code for this object.
no setterinherited
javaScriptMode → JavaScriptMode?
Sets whether JavaScript execution is enabled.
final
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
layoutDirection TextDirection?
The layout direction for the WebView.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Widget type identifier.
no setteroverride
url String
The URL to load in the WebView.
final
userAgent String?
The user agent for the WebView.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this WebView to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

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