From abd4b020674e0dc1f06f78206c882c29a5e0d46e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=C3=A0o=20Ho=C3=A0ng=20S=C6=A1n?= Date: Sat, 18 May 2024 11:51:04 +0700 Subject: [PATCH] Set IFRAME width & height to conform to platform view constraints (#1253) See https://docs.flutter.dev/release/breaking-changes/platform-views-using-html-slots-web Related to #1245 --- packages/fwfh_webview/lib/src/web_view/js_interop.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/fwfh_webview/lib/src/web_view/js_interop.dart b/packages/fwfh_webview/lib/src/web_view/js_interop.dart index 19fcb8a0c..512db6c87 100644 --- a/packages/fwfh_webview/lib/src/web_view/js_interop.dart +++ b/packages/fwfh_webview/lib/src/web_view/js_interop.dart @@ -20,6 +20,11 @@ class WebViewState extends State { _iframeElement.allow = 'autoplay'; } + // https://docs.flutter.dev/release/breaking-changes/platform-views-using-html-slots-web + _iframeElement.style + ..height = '100%' + ..width = '100%'; + final viewType = '$this#$hashCode'; platformViewRegistry.registerViewFactory(viewType, (_) => _iframeElement);