diff --git a/client/lib/screens/shell/app_shell.dart b/client/lib/screens/shell/app_shell.dart index 7b46c27..39ee3a1 100644 --- a/client/lib/screens/shell/app_shell.dart +++ b/client/lib/screens/shell/app_shell.dart @@ -224,6 +224,29 @@ class _AppShellState extends ConsumerState { // 并在顶栏出返回箭头(_buildTopBar 内)。 final isTabRoot = _tabRoots.contains(widget.location); + // 窄屏横滑手势(2026-07-04 拍板):tab 根左右滑切换相邻 tab(不循环); + // 二级屏左滑退出(回来源/我的),右滑无响应。内容区里的横向滚动 + //(分段 tab / 表格横滚)在手势竞技场中优先,互不冲突。 + Widget shellContent = widget.navigationShell; + if (isMobile) { + shellContent = GestureDetector( + behavior: HitTestBehavior.translucent, + onHorizontalDragEnd: (d) { + final v = d.primaryVelocity ?? 0; + if (v.abs() < 200) return; // 轻微拖动不触发 + if (isTabRoot) { + final pos = _tabForBranch(widget.navigationShell.currentIndex); + final next = v < 0 ? pos + 1 : pos - 1; // 左滑→下一个 tab + if (next < 0 || next >= _mobileTabs.length) return; + _goBranch(_mobileTabs[next].$3); + } else if (v < 0) { + _backFromSecondary(); // 左滑退出;右滑无响应 + } + }, + child: widget.navigationShell, + ); + } + final Widget shell = SelectionArea( child: Scaffold( body: Column( @@ -238,7 +261,7 @@ class _AppShellState extends ConsumerState { children: [ ..._buildBanners(context, isOnline, updateInfo, updateNotifier, licenseInfo), - Expanded(child: widget.navigationShell), + Expanded(child: shellContent), if (!isMobile) AppStatusBar(loginTime: _loginTime), ], ),