WebViewEnvironment class
Constructors
- WebViewEnvironment.fromPlatform({required PlatformWebViewEnvironment platform})
- Constructs a WebViewEnvironment from a specific platform implementation.
- WebViewEnvironment.fromPlatformCreationParams({required PlatformWebViewEnvironmentCreationParams params})
- Constructs a WebViewEnvironment.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
WebView Environment ID.
no setter
- onBrowserProcessExited ↔ void Function(BrowserProcessExitedDetail detail)?
-
The onBrowserProcessExited event is raised when the collection of WebView2 Runtime
processes for the browser process of this environment terminate due to browser process failure
or normal shutdown (for example, when all associated WebViews are closed),
after all resources have been released (including the user data folder).
To learn about what these processes are, go to Process model.
getter/setter pair
- onNewBrowserVersionAvailable ↔ void Function()?
-
onNewBrowserVersionAvailable runs when a newer version of the WebView2 Runtime
is installed and available using WebView2.
To use the newer version of the browser you must create a new PlatformWebViewEnvironment and WebView.
The event only runs for new version from the same WebView2 Runtime from which the code is running.
When not running with installed WebView2 Runtime, no event is run.
getter/setter pair
- onProcessInfosChanged ↔ void Function(BrowserProcessInfosChangedDetail detail)?
-
Event fired with a list of all process using same user data folder except for crashpad process.
getter/setter pair
- platform → PlatformWebViewEnvironment
-
Implementation of PlatformWebViewEnvironment for the current platform.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- settings → WebViewEnvironmentSettings?
-
no setter
Methods
-
dispose(
) → Future< void> - Disposes the WebView Environment reference.
-
getCacheModel(
) → Future< CacheModel?> - Returns the current cache model for this WebContext.
-
getFailureReportFolderPath(
) → Future< String?> - Officially Supported Platforms/Implementations:
-
getProcessInfos(
) → Future< List< BrowserProcessInfo> > - Returns the path of the folder where minidump files are written.
-
getSpellCheckingLanguages(
) → Future< List< String> > - Returns the list of spell checking languages currently configured for this WebContext.
-
isAutomationAllowed(
) → Future< bool> - Returns whether automation is allowed for this WebContext.
-
isInterfaceSupported(
WebViewInterface interface) → Future< bool> -
Returns
trueif the WebView Environment supports the specifiedinterface, otherwisefalse. Only the ones related to WebViewInterface.ICoreWebView2Environment are valid interfaces to check; otherwise, it will always returnfalse. -
isSpellCheckingEnabled(
) → Future< bool> - Returns whether spell checking is enabled for this WebContext.
-
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
Static Methods
-
compareBrowserVersions(
{required String version1, required String version2}) → Future< int?> - Get the browser version info including channel name if it is not the WebView2 Runtime.
-
create(
{WebViewEnvironmentSettings? settings}) → Future< WebViewEnvironment> -
Creates the PlatformWebViewEnvironment using
settings. -
getAvailableVersion(
{String? browserExecutableFolder}) → Future< String?> - Get the browser version info including channel name if it is not the WebView2 Runtime.
-
isClassSupported(
{TargetPlatform? platform}) → bool -
Check if the current class is supported by the defaultTargetPlatform or a specific
platform. -
isMethodSupported(
PlatformWebViewEnvironmentMethod method, {TargetPlatform? platform}) → bool -
Check if the given
methodis supported by the defaultTargetPlatform or a specificplatform. -
isPropertySupported(
dynamic property, {TargetPlatform? platform}) → bool -
Check if the given
propertyis supported by the defaultTargetPlatform or a specificplatform. The property should be one of the PlatformWebViewEnvironmentProperty or PlatformWebViewEnvironmentCreationParamsProperty values.