setSize method
- Size size
Set the size of the WebView in pixels.
Set -1 to match the corresponding width or height of the current device screen size.
Size(-1, -1) will match both width and height of the current device screen size.
Note that if the PlatformHeadlessInAppWebView is not running, this method won't have effect.
Officially Supported Platforms/Implementations:
- Android WebView:
Sizewidth and height values will be converted tointvalues because they cannot havedoublevalues.
- iOS WKWebView
- macOS WKWebView
- Web <iframe>
- Linux WPE WebKit
Parameters - Officially Supported Platforms/Implementations:
size: all platforms
Use the PlatformHeadlessInAppWebView.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<void> setSize(Size size) => platform.setSize(size);