fix(client): 底部 sheet 打开时横滑改为关 sheet,不再切 tab

- showMSheet 登记「打开中 sheet」关闭器栈(任何方式关闭都注销)
- 壳层横滑手势先查栈:有 sheet 开着 → 从左往右滑关顶层 sheet,
  任何方向都不切 tab / 不退二级屏;无 sheet 才走原 tab 切换/返回逻辑

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-04 20:55:31 +08:00
parent f9d5bc79c7
commit 11413df3db
2 changed files with 40 additions and 0 deletions
+7
View File
@@ -25,6 +25,7 @@ import '../../widgets/notification_bell.dart';
import '../../widgets/app_status_bar.dart';
import '../../widgets/ds/ds_atoms.dart';
import '../../widgets/ds/ds_toast.dart';
import '../../widgets/ds/m_sheet.dart';
import '../../widgets/ds/m_tab_bar.dart';
import '../../widgets/theme_sheet.dart';
@@ -282,6 +283,12 @@ class _AppShellState extends ConsumerState<AppShell>
onHorizontalDragEnd: (d) {
final v = d.primaryVelocity ?? 0;
if (v.abs() < 200) return; // 轻微拖动不触发
// 有底部 sheet(详情/筛选等「抽屉」)开着:从左往右滑关掉顶层
// sheet,任何方向都不切 tab / 不退屏。
if (hasOpenMSheet) {
if (v > 0) closeTopMSheet();
return;
}
if (isTabRoot) {
final pos = _tabForBranch(widget.navigationShell.currentIndex);
final next = v < 0 ? pos + 1 : pos - 1; // 向左滑→下一个 tab