PlatformWebViewEnvironment class abstract

Controls a WebView Environment used by WebView instances. Use dispose when not needed anymore to release references.

Inheritance
Implemented types
Annotations
  • @SupportedPlatforms.new(platforms: [WindowsPlatform(), LinuxPlatform()])

Constructors

PlatformWebViewEnvironment(PlatformWebViewEnvironmentCreationParams params)
Creates a new PlatformInAppWebViewController
factory
PlatformWebViewEnvironment.implementation(PlatformWebViewEnvironmentCreationParams params)
Used by the platform implementation to create a new PlatformWebViewEnvironment.
PlatformWebViewEnvironment.static()
Creates a new PlatformWebViewEnvironment to access static methods.
factory

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
params PlatformWebViewEnvironmentCreationParams
The parameters used to initialize the PlatformWebViewEnvironment.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings WebViewEnvironmentSettings?
WebView Environment settings.
no setter

Methods

compareBrowserVersions({required String version1, required String version2}) Future<int?>
This method is for anyone want to compare version correctly to determine which version is newer, older or same.
create({WebViewEnvironmentSettings? settings}) Future<PlatformWebViewEnvironment>
Creates the PlatformWebViewEnvironment using settings.
dispose() Future<void>
Disposes the WebView Environment reference.
override
getAvailableVersion({String? browserExecutableFolder}) Future<String?>
Get the browser version info including channel name if it is not the WebView2 Runtime.
getCacheModel() Future<CacheModel?>
Returns the current cache model for this WebContext.
getFailureReportFolderPath() Future<String?>
Returns the path of the folder where minidump files are written.
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.
isClassSupported({TargetPlatform? platform}) bool
Check if the current class is supported by the defaultTargetPlatform or a specific platform.
isInterfaceSupported(WebViewInterface interface) Future<bool>
Returns true if the WebView Environment supports the specified interface, otherwise false. Only the ones related to WebViewInterface.ICoreWebView2Environment are valid interfaces to check; otherwise, it will always return false.
isMethodSupported(PlatformWebViewEnvironmentMethod method, {TargetPlatform? platform}) bool
Check if the given method is supported by the defaultTargetPlatform or a specific platform.
isPropertySupported(dynamic property, {TargetPlatform? platform}) bool
Check if the given property is supported by the defaultTargetPlatform or a specific platform. The property should be one of the PlatformWebViewEnvironmentProperty or PlatformWebViewEnvironmentCreationParamsProperty values.
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 Properties

debugLoggingSettings DebugLoggingSettings
Debug settings used by PlatformWebViewEnvironment.
getter/setter pair