fix(client): iPad(tablet)对齐桌面——侧栏补设置/联系我们 + 顶部避让状态栏

iPad 测试反馈:① 平板侧栏只有 连接/节点/统计,缺「设置」「联系我们」(桌面侧栏有,只能从
「我的」页进);② 顶部 brand/标题与 iOS 状态栏重叠(TabletShell 没包 SafeArea)。

- TabletShell:侧栏补 设置/联系我们 两项 + content 路由到 SettingsPage/ContactPage(对齐
  DesktopShell);整体包 SafeArea(bottom:false)避开状态栏/notch。
- SettingsPage:开机自启是桌面登录项概念,iOS/Android 无此能力 → 仅 desktop 平台显示该行。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-30 21:36:33 +08:00
parent ae5d497f0b
commit 849e30dd05
2 changed files with 31 additions and 13 deletions
+4 -1
View File
@@ -2,6 +2,8 @@
// //
// 对照 ui_kits/desktop/dapp.jsx DSettings(精简):兑换入口 + 语言段控 + // 对照 ui_kits/desktop/dapp.jsx DSettings(精简):兑换入口 + 语言段控 +
// 深色外观 + 协议 + 版本。开关组(开机自启/智能分流/Kill-switch)待 l10n 补齐后加。 // 深色外观 + 协议 + 版本。开关组(开机自启/智能分流/Kill-switch)待 l10n 补齐后加。
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -39,8 +41,9 @@ class SettingsPage extends ConsumerWidget {
right: Icon(PangolinIcons.chevronRight, size: 18, color: c.fg3), onTap: () {}), right: Icon(PangolinIcons.chevronRight, size: 18, color: c.fg3), onTap: () {}),
]), ]),
const SizedBox(height: 16), const SizedBox(height: 16),
// 功能开关组 // 功能开关组(开机自启是桌面端登录项概念,iOS/Android 无此能力,仅桌面显示)
_Card(children: [ _Card(children: [
if (Platform.isMacOS || Platform.isWindows || Platform.isLinux)
_Row(title: t.autostart, sub: t.autostartSub, right: sw(s.autostart, settings.setAutostart)), _Row(title: t.autostart, sub: t.autostartSub, right: sw(s.autostart, settings.setAutostart)),
_Row(title: t.autoConnect, sub: t.autoConnectSub, right: sw(s.autoConnect, settings.setAutoConnect)), _Row(title: t.autoConnect, sub: t.autoConnectSub, right: sw(s.autoConnect, settings.setAutoConnect)),
_Row(title: t.smartRoute, sub: t.smartRouteSub, right: sw(s.smartRoute, settings.setSmartRoute)), _Row(title: t.smartRoute, sub: t.smartRouteSub, right: sw(s.smartRoute, settings.setSmartRoute)),
+17 -2
View File
@@ -8,7 +8,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../pangolin_theme.dart'; import '../pangolin_theme.dart';
import '../screens/account_page.dart'; import '../screens/account_page.dart';
import '../screens/connect_page.dart'; import '../screens/connect_page.dart';
import '../screens/contact_page.dart';
import '../screens/nodes_page.dart'; import '../screens/nodes_page.dart';
import '../screens/settings_page.dart';
import '../screens/stats_page.dart'; import '../screens/stats_page.dart';
import '../state/app_providers.dart'; import '../state/app_providers.dart';
import '../state/navigation_provider.dart'; import '../state/navigation_provider.dart';
@@ -25,11 +27,13 @@ class TabletShell extends ConsumerWidget {
final t = ref.watch(appTextProvider); final t = ref.watch(appTextProvider);
final view = ref.watch(navViewProvider); final view = ref.watch(navViewProvider);
// 「我的」移到侧栏顶部品牌按钮(见 NavSidebar)。 // 「我的」移到侧栏顶部品牌按钮(见 NavSidebar);设置/联系我们对齐桌面侧栏
final items = <NavSidebarItem>[ final items = <NavSidebarItem>[
(icon: PangolinIcons.power, label: t.tabConnect, view: NavView.connect), (icon: PangolinIcons.power, label: t.tabConnect, view: NavView.connect),
(icon: PangolinIcons.globe, label: t.tabServers, view: NavView.servers), (icon: PangolinIcons.globe, label: t.tabServers, view: NavView.servers),
(icon: PangolinIcons.barChart, label: t.tabStats, view: NavView.stats), (icon: PangolinIcons.barChart, label: t.tabStats, view: NavView.stats),
(icon: PangolinIcons.settings, label: t.settingsTitle, view: NavView.settings),
(icon: PangolinIcons.messageCircle, label: t.contactTitle, view: NavView.contact),
]; ];
final titles = <NavView, String>{ final titles = <NavView, String>{
@@ -37,6 +41,8 @@ class TabletShell extends ConsumerWidget {
NavView.servers: t.tabServers, NavView.servers: t.tabServers,
NavView.stats: t.tabStats, NavView.stats: t.tabStats,
NavView.account: t.tabMe, NavView.account: t.tabMe,
NavView.settings: t.settingsTitle,
NavView.contact: t.contactTitle,
}; };
void go(NavView v) => ref.read(navViewProvider.notifier).state = v; void go(NavView v) => ref.read(navViewProvider.notifier).state = v;
@@ -49,13 +55,21 @@ class TabletShell extends ConsumerWidget {
return NodesPage(isWide: true, onPicked: () => go(NavView.connect)); return NodesPage(isWide: true, onPicked: () => go(NavView.connect));
case NavView.stats: case NavView.stats:
return const StatsPage(isWide: true); return const StatsPage(isWide: true);
default: // account / contact / settings / plans / redeem → 账户(tablet 一级只 4 项) case NavView.settings:
return const SettingsPage();
case NavView.contact:
return const ContactPage();
default: // account / plans / redeem / devices → 账户(其余下钻在账户页内)
return const AccountPage(isWide: true); return const AccountPage(isWide: true);
} }
} }
return ColoredBox( return ColoredBox(
color: c.bg, color: c.bg,
// iPad 上内容会顶到状态栏(时间/电量/notch)。SafeArea 加顶部安全区,避开重叠;
// 底部留给页面自行处理(home indicator)。
child: SafeArea(
bottom: false,
child: Row(children: [ child: Row(children: [
NavSidebar(items: items, width: 232, dense: false), NavSidebar(items: items, width: 232, dense: false),
Expanded( Expanded(
@@ -65,6 +79,7 @@ class TabletShell extends ConsumerWidget {
]), ]),
), ),
]), ]),
),
); );
} }
} }