getCurrentWebViewPackage method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewCompat.getCurrentWebViewPackage', apiUrl: 'https://developer.android.com/reference/androidx/webkit/WebViewCompat#getCurrentWebViewPackage(android.content.Context)', available: '21')])
If WebView has already been loaded into the current process this method will return the package that was used to load it. Otherwise, the package that would be used if the WebView was loaded right now will be returned; this does not cause WebView to be loaded, so this information may become outdated at any time. The WebView package changes either when the current WebView package is updated, disabled, or uninstalled. It can also be changed through a Developer Setting. If the WebView package changes, any app process that has loaded WebView will be killed. The next time the app starts and loads WebView it will use the new WebView package instead.
Officially Supported Platforms/Implementations:
- Android WebView 21+ (Official API - WebViewCompat.getCurrentWebViewPackage)
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebViewCompat.getCurrentWebViewPackage',
apiUrl:
'https://developer.android.com/reference/androidx/webkit/WebViewCompat#getCurrentWebViewPackage(android.content.Context)',
available: '21',
),
],
)
Future<WebViewPackageInfo?> getCurrentWebViewPackage() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.getCurrentWebViewPackage.name} is not implemented on the current platform',
);
}