An open API service indexing awesome lists of open source software.

https://github.com/ipcjs/safe_area_insets


https://github.com/ipcjs/safe_area_insets

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# safe_area_insets

Use Dart to get the `safe-area-insets` on Web platform.

## Usage

It is recommended to add this line in [index.html](example/web/index.html) to prevent flickering during loading.

```html

```

Use `WebSafeAreaInsets` to handle safe area, See [example](example/lib/main.dart) for more detail.

```dart
Widget build(BuildContext context) {
return MaterialApp(
home: const HomePage(),
builder: (context, child) {
child ??= const SizedBox();
return kIsWeb ? WebSafeAreaInsets(child: child) : child;
},
);
}
```

![screenshot-example](doc/screenshot-example.png)

## Related Reading

- [[web][PWA] SafeArea Widget does not work on iOS Safari PWA · Issue #84833 · flutter/flutter](https://github.com/flutter/flutter/issues/84833#issuecomment-890540239)
- [Designing Websites for iPhone X | WebKit](https://webkit.org/blog/7929/designing-websites-for-iphone-x/)
- [zhetengbiji/safeAreaInsets: Use javascript to get the safe area insets.](https://github.com/zhetengbiji/safeAreaInsets)