getAvailableVersion method
- @SupportedPlatforms.new(platforms: [WindowsPlatform(apiName: 'GetAvailableCoreWebView2BrowserVersionString', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2849.39#getavailablecorewebview2browserversionstring'), LinuxPlatform(apiName: 'webkit_get_major_version', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/func.get_major_version.html', note: 'Returns WPE WebKit version string composed of major.minor.micro versions.')])
- String? browserExecutableFolder,
Get the browser version info including channel name if it is not the WebView2 Runtime.
Channel names are Beta, Dev, and Canary.
If an override exists for the browserExecutableFolder or the channel preference, the override is used.
If an override is not specified, then the parameter value passed to getAvailableVersion is used.
Returns null if it fails to find an installed WebView2 runtime or non-stable Microsoft Edge installation.
Officially Supported Platforms/Implementations:
- Windows WebView2 (Official API - GetAvailableCoreWebView2BrowserVersionString)
- Linux WPE WebKit (Official API - webkit_get_major_version):
- Returns WPE WebKit version string composed of major.minor.micro versions.
Parameters - Officially Supported Platforms/Implementations:
browserExecutableFolder: all platforms
Use the PlatformWebViewEnvironment.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
WindowsPlatform(
apiName: 'GetAvailableCoreWebView2BrowserVersionString',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/webview2-idl?view=webview2-1.0.2849.39#getavailablecorewebview2browserversionstring',
),
LinuxPlatform(
apiName: 'webkit_get_major_version',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/func.get_major_version.html',
note:
'Returns WPE WebKit version string composed of major.minor.micro versions.',
),
],
)
Future<String?> getAvailableVersion({String? browserExecutableFolder}) {
throw UnimplementedError(
'getAvailableVersion is not implemented on the current platform',
);
}