create method

  1. @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.')])
Future<PlatformWebViewEnvironment> create({
  1. 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:

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',
  );
}