feat(client): 账户子页 desktop 内容区下钻(档1)
- desktop 上套餐选择/兑换购买/设备管理改为内容区下钻(侧栏保留、shell 顶栏带 返回箭头),不再全屏 push 盖住侧栏;mobile/tablet 仍全屏 push - _SubScaffold 加 embedded 参数(true 只返回内容),PlansScreen/DevicesScreen/ RedeemScreen 透传;NavView 加 devices + kAccountSubViews 集合 - desktop_shell 渲染子页(embedded) + 顶栏 onBack→account;account_page 按 formFactor 选下钻(切 navView)或 push - desktop 整页 golden 补 套餐/兑换/设备 三子页(共 8 页) 测试: flutter test 84 通过(+3 子页 golden), analyze 0 error Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import '../screens/settings_page.dart';
|
||||
import '../screens/stats_page.dart';
|
||||
import '../state/app_providers.dart';
|
||||
import '../state/navigation_provider.dart';
|
||||
import '../widgets/account_screens.dart';
|
||||
import '../widgets/content_top_bar.dart';
|
||||
import '../widgets/nav_sidebar.dart';
|
||||
import '../widgets/pangolin_icons.dart';
|
||||
@@ -42,6 +43,9 @@ class DesktopShell extends ConsumerWidget {
|
||||
NavView.account: t.tabMe,
|
||||
NavView.contact: t.contactTitle,
|
||||
NavView.settings: t.settingsTitle,
|
||||
NavView.plans: t.choosePlan,
|
||||
NavView.redeem: t.redeemTitle,
|
||||
NavView.devices: t.myDevices,
|
||||
};
|
||||
|
||||
void go(NavView v) => ref.read(navViewProvider.notifier).state = v;
|
||||
@@ -60,19 +64,27 @@ class DesktopShell extends ConsumerWidget {
|
||||
return const ContactPage();
|
||||
case NavView.settings:
|
||||
return const SettingsPage();
|
||||
// 账户下钻子页(内容区,顶栏带返回)
|
||||
case NavView.plans:
|
||||
return PlansScreen(t: t, embedded: true, onChoose: (_) => go(NavView.redeem));
|
||||
case NavView.redeem:
|
||||
return const AccountPage(isWide: true);
|
||||
return RedeemScreen(t: t, embedded: true);
|
||||
case NavView.devices:
|
||||
return DevicesScreen(t: t, embedded: true);
|
||||
}
|
||||
}
|
||||
|
||||
final isSub = kAccountSubViews.contains(view);
|
||||
return ColoredBox(
|
||||
color: c.bg,
|
||||
child: Row(children: [
|
||||
NavSidebar(items: items),
|
||||
Expanded(
|
||||
child: Column(children: [
|
||||
ContentTopBar(title: titles[view] ?? t.brand),
|
||||
ContentTopBar(
|
||||
title: titles[view] ?? t.brand,
|
||||
onBack: isSub ? () => go(NavView.account) : null,
|
||||
),
|
||||
Expanded(child: content()),
|
||||
]),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user