getProgress method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.getProgress', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#getProgress()'), IOSPlatform(apiName: 'WKWebView.estimatedProgress', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1415007-estimatedprogress'), MacOSPlatform(apiName: 'WKWebView.estimatedProgress', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/1415007-estimatedprogress'), LinuxPlatform(apiName: 'webkit_web_view_get_estimated_load_progress', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_estimated_load_progress.html'), WindowsPlatform(note: 'Progress is tracked through navigation events: NavigationStarting (0), ContentLoading (33), DOMContentLoaded (66), NavigationCompleted (100).')])
Gets the progress for the current page. The progress value is between 0 and 100.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.getProgress)
- iOS WKWebView (Official API - WKWebView.estimatedProgress)
- macOS WKWebView (Official API - WKWebView.estimatedProgress)
- Linux WPE WebKit (Official API - webkit_web_view_get_estimated_load_progress)
- Windows WebView2:
- Progress is tracked through navigation events: NavigationStarting (0), ContentLoading (33), DOMContentLoaded (66), NavigationCompleted (100).
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.getProgress',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#getProgress()',
),
IOSPlatform(
apiName: 'WKWebView.estimatedProgress',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1415007-estimatedprogress',
),
MacOSPlatform(
apiName: 'WKWebView.estimatedProgress',
apiUrl:
'https://developer.apple.com/documentation/webkit/wkwebview/1415007-estimatedprogress',
),
LinuxPlatform(
apiName: 'webkit_web_view_get_estimated_load_progress',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.get_estimated_load_progress.html',
),
WindowsPlatform(
note:
'Progress is tracked through navigation events: NavigationStarting (0), ContentLoading (33), DOMContentLoaded (66), NavigationCompleted (100).',
),
],
)
Future<int?> getProgress() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.getProgress.name} is not implemented on the current platform',
);
}