最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Flutter SafeArea not working in iOS WebClips - Stack Overflow

programmeradmin2浏览0评论

Flutter SafeArea not working in iOS WebClips (web apps launched stand alone from Home Screen).

MediaQuery.paddingOf(context).bottom

returns zero in safari mode and in stand alone mode.

Flutter SafeArea not working in iOS WebClips (web apps launched stand alone from Home Screen).

MediaQuery.paddingOf(context).bottom

returns zero in safari mode and in stand alone mode.

Share Improve this question asked Feb 15 at 8:23 hodovhodov 693 silver badges7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

cerealexx suggest a decision there, it works https://github/flutter/flutter/issues/84833

import 'package:universal_html/html.dart' as html;

// Check if it's an installed PWA
final isPwa = kIsWeb &&
  html.window.matchMedia('(display-mode: standalone)').matches;
// Check if it's web iOS
final isWebiOS = kIsWeb &&
  html.window.navigator.userAgent
  .contains(RegExp(r'iPad|iPod|iPhone'));

// Use Container with color instead of Padding if you need to
return Padding(
  padding: EdgeInsets.only(bottom: isPwa && isWebiOS ? 25 : 0),
  child: YourApp(),
);
发布评论

评论列表(0)

  1. 暂无评论