pwa_safe_area 0.1.0
pwa_safe_area: ^0.1.0 copied to clipboard
Flutter web fix for iOS home-screen PWAs where env(safe-area-inset-*) reads zero: re-asserts viewport-fit=cover and merges real CSS safe-area insets into MediaQuery.
Changelog #
0.1.0 #
- Keep
viewport-fit=coveron the viewport meta tag when the Flutter web engine rewrites it. Use the bootstrap before the engine starts andsetupViewportFit()from Dart. Only iOS home-screen apps override the viewport dimensions. - Read CSS safe-area insets with
safeAreaInsetsand receive changes throughsafeAreaInsetsStream. - Use
PwaSafeAreato merge CSS insets with Flutter's view padding. On native builds it passes the child through unchanged. - Export
mergeSafeAreaViewPaddingandresolveSafeAreaPaddingfor apps that need to calculate their own padding. - Include a Flutter web example that displays the CSS insets and the padding available to widgets.