initialSize property

  1. @SupportedPlatforms.new(platforms: [AndroidPlatform(note: '`Size` width and height values will be converted to `int` values because they cannot have `double` values.'), IOSPlatform(), MacOSPlatform(), WebPlatform(requiresSameOrigin: false), WindowsPlatform(), LinuxPlatform()])
Size initialSize
final

The WebView initial size 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.

Officially Supported Platforms/Implementations:

  • Android WebView:
    • Size width and height values will be converted to int values because they cannot have double values.
  • iOS WKWebView
  • macOS WKWebView
  • Web <iframe>
  • Windows WebView2
  • Linux WPE WebKit

Use the PlatformHeadlessInAppWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    AndroidPlatform(
      note:
          '`Size` width and height values will be converted to `int` values because they cannot have `double` values.',
    ),
    IOSPlatform(),
    MacOSPlatform(),
    WebPlatform(requiresSameOrigin: false),
    WindowsPlatform(),
    LinuxPlatform(),
  ],
)
final Size initialSize;