enableSlowWholeDocumentDraw method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.enableSlowWholeDocumentDraw', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#enableSlowWholeDocumentDraw()', available: '21', note: 'This method should be called before any WebViews are created.')])
For apps targeting the L release, WebView has a new default behavior that reduces memory footprint and increases performance by intelligently choosing the portion of the HTML document that needs to be drawn. These optimizations are transparent to the developers. However, under certain circumstances, an App developer may want to disable them, for example when an app draws and accesses portions of the page that is way outside the visible portion of the page. Enabling drawing the entire HTML document has a significant performance cost.
Officially Supported Platforms/Implementations:
- Android WebView 21+ (Official API - WebView.enableSlowWholeDocumentDraw):
- This method should be called before any WebViews are created.
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.enableSlowWholeDocumentDraw',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#enableSlowWholeDocumentDraw()',
available: '21',
note: 'This method should be called before any WebViews are created.',
),
],
)
Future<void> enableSlowWholeDocumentDraw() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.enableSlowWholeDocumentDraw.name} is not implemented on the current platform',
);
}