From 97537f3a311618767ab16a792d0a59b6d2b4c2b5 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sun, 19 Jul 2026 13:46:38 +0800 Subject: [PATCH] remove conflicting mobile drawer gesture layer --- lib/pages/workspace_page.dart | 71 ++++------------------------------- 1 file changed, 8 insertions(+), 63 deletions(-) diff --git a/lib/pages/workspace_page.dart b/lib/pages/workspace_page.dart index db6f944..2377119 100644 --- a/lib/pages/workspace_page.dart +++ b/lib/pages/workspace_page.dart @@ -311,17 +311,14 @@ class _WorkspacePageState extends ConsumerState { children: [_buildCloudContent(fp), _buildMediaContent()], ); if (compact) { - return _MobileDrawerSwipeArea( - onOpen: _openMobileDrawer, - child: Padding( - padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), - child: Column( - children: [ - topBar, - const SizedBox(height: 8), - Expanded(child: content), - ], - ), + return Padding( + padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), + child: Column( + children: [ + topBar, + const SizedBox(height: 8), + Expanded(child: content), + ], ), ); } @@ -822,58 +819,6 @@ class _UploadListTopButtonState extends State<_UploadListTopButton> { ); } -class _MobileDrawerSwipeArea extends StatefulWidget { - final Widget child; - final VoidCallback onOpen; - - const _MobileDrawerSwipeArea({required this.child, required this.onOpen}); - - @override - State<_MobileDrawerSwipeArea> createState() => _MobileDrawerSwipeAreaState(); -} - -class _MobileDrawerSwipeAreaState extends State<_MobileDrawerSwipeArea> { - var _distance = 0.0; - var _opening = false; - - void _onDragUpdate(DragUpdateDetails details) { - if (_opening) return; - final delta = details.primaryDelta ?? 0; - if (delta <= 0) { - _distance = 0; - return; - } - _distance += delta; - if (_distance >= 28) { - _opening = true; - _distance = 0; - widget.onOpen(); - Future.delayed(const Duration(milliseconds: 300), () { - if (mounted) _opening = false; - }); - } - } - - @override - Widget build(BuildContext context) => Stack( - children: [ - widget.child, - Positioned( - left: 0, - top: 0, - bottom: 0, - width: 28, - child: GestureDetector( - behavior: HitTestBehavior.translucent, - onHorizontalDragUpdate: _onDragUpdate, - onHorizontalDragEnd: (_) => _distance = 0, - onHorizontalDragCancel: () => _distance = 0, - ), - ), - ], - ); -} - class _NativeMobileDrawerContent extends StatelessWidget { final WorkspaceMode mode; final FileState cloudState;