create method
- @SupportedPlatforms.new(platforms: [WindowsPlatform(apiName: 'CreateCoreWebView2EnvironmentWithOptions', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2210.55#createcorewebview2environmentwithoptions'), LinuxPlatform(apiName: 'WebKitWebContext', apiUrl: 'https://webkitgtk.org/reference/webkit2gtk/stable/class.WebContext.html', note: 'Creates a new WebKitWebContext for shared WebView configuration.')])
- WebViewEnvironmentSettings? settings,
Creates the PlatformWebViewEnvironment using settings.
Check https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2210.55#createcorewebview2environmentwithoptions for more info.
Officially Supported Platforms/Implementations:
- Windows WebView2 (Official API - CreateCoreWebView2EnvironmentWithOptions)
- Linux WPE WebKit (Official API - WebKitWebContext):
- Creates a new WebKitWebContext for shared WebView configuration.
Parameters - Officially Supported Platforms/Implementations:
settings: all platforms
Use the PlatformWebViewEnvironment.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
WindowsPlatform(
apiName: 'CreateCoreWebView2EnvironmentWithOptions',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2210.55#createcorewebview2environmentwithoptions',
),
LinuxPlatform(
apiName: 'WebKitWebContext',
apiUrl:
'https://webkitgtk.org/reference/webkit2gtk/stable/class.WebContext.html',
note:
'Creates a new WebKitWebContext for shared WebView configuration.',
),
],
)
Future<PlatformWebViewEnvironment> create({
WebViewEnvironmentSettings? settings,
}) {
throw UnimplementedError(
'create is not implemented on the current platform',
);
}