getSize method
Gets the current size in pixels of the WebView.
Note that if the PlatformHeadlessInAppWebView
is not running, this method will return null
.
Officially Supported Platforms/Implementations:
- Android native WebView
- iOS
- Web
- MacOS
Implementation
@override
Future<Size?> getSize() async {
if (!_running) {
return null;
}
Map<String, dynamic> args = <String, dynamic>{};
Map<String, dynamic> sizeMap =
(await channel?.invokeMethod('getSize', args))?.cast<String, dynamic>();
return MapSize.fromMap(sizeMap);
}