setSize method

Future<void> setSize(
  1. 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.

NOTE for Android: Size width and height values will be converted to int values because they cannot have double values.

Officially Supported Platforms/Implementations:

  • Android native WebView
  • iOS
  • Web
  • MacOS

Implementation

Future<void> setSize(Size size) => platform.setSize(size);