fix(client): iOS 顶栏避开状态栏,修复菜单按钮被遮挡退不出登录
顶栏 Container 原从 y=0 起绘,iOS 状态栏盖住左上角菜单按钮,窄屏无法 打开抽屉菜单/退出登录。顶栏高度加上 MediaQuery.padding.top,内容下移 一个状态栏高度,蓝色仍铺满到屏幕顶。桌面/Web 状态栏高度为 0 不受影响。 todo #53。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -155,6 +155,8 @@ class _AppShellState extends ConsumerState<AppShell> {
|
||||
final isOnline = ref.watch(connectivityProvider);
|
||||
final location = GoRouterState.of(context).matchedLocation;
|
||||
final isMobile = context.isMobile;
|
||||
// iOS/刘海屏状态栏高度:顶栏需下移此距离,避免菜单按钮被状态栏遮挡
|
||||
final topInset = MediaQuery.of(context).padding.top;
|
||||
final sidebarWidth = _sidebarExpanded ? 200.0 : 56.0;
|
||||
final updateNotifier = ref.watch(updateProvider.notifier);
|
||||
final updateInfo = ref.watch(updateProvider).valueOrNull;
|
||||
@@ -169,11 +171,11 @@ class _AppShellState extends ConsumerState<AppShell> {
|
||||
drawerEnableOpenDragGesture: !kIsWeb && isMobile,
|
||||
body: Column(
|
||||
children: [
|
||||
// Top Bar
|
||||
// Top Bar(高度含状态栏内边距,蓝色铺满到屏幕顶,内容下移避开状态栏)
|
||||
Container(
|
||||
height: 56,
|
||||
height: 56 + topInset,
|
||||
color: AppTheme.primary,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: EdgeInsets.only(top: topInset, left: 8, right: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
IconButton(
|
||||
|
||||
Reference in New Issue
Block a user