From a616aa610a5e8710d21a5bef6e8fcc8a01241fe5 Mon Sep 17 00:00:00 2001 From: chuxuehaocai Date: Sun, 14 Jun 2026 00:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=91=E9=9D=A0=E6=9C=89=E5=9C=B0=E9=9B=B7?= =?UTF-8?q?=E5=A5=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home_page.dart | 37 +++++++++++++++++++------------------ lib/pages/ticket_page.dart | 4 +--- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 2cb99d8..47f5973 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -199,26 +199,26 @@ class _HomePageState extends State { Widget build(BuildContext context) { final theme = Theme.of(context); - return Scaffold( + return PopScope( + canPop: !_loggingOut, + onPopInvokedWithResult: (didPop, _) { + if (!didPop && !_loggingOut) { + _performLogoutAndExit(); + } + }, + child: Scaffold( appBar: AppBar( + leading: IconButton( + icon: _loggingOut + ? const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator(strokeWidth: 2), + ) + : const Icon(Icons.arrow_back), + onPressed: _loggingOut ? null : _performLogoutAndExit, + ), title: Text(_tabTitles[_currentTab]), - actions: [ - if (_loggingOut) - const Padding( - padding: EdgeInsets.only(right: 12), - child: SizedBox( - width: 20, - height: 20, - child: CircularProgressIndicator(strokeWidth: 2), - ), - ) - else - IconButton( - icon: const Icon(Icons.logout), - tooltip: AppStrings.logoutTooltip, - onPressed: _performLogoutAndExit, - ), - ], ), body: IndexedStack( index: _currentTab, @@ -253,6 +253,7 @@ class _HomePageState extends State { NavigationDestination(icon: Icon(Icons.info_outlined), selectedIcon: Icon(Icons.info), label: AppStrings.tabAbout), ], ), + ), ); } diff --git a/lib/pages/ticket_page.dart b/lib/pages/ticket_page.dart index c8ed29f..d0346e6 100644 --- a/lib/pages/ticket_page.dart +++ b/lib/pages/ticket_page.dart @@ -42,12 +42,10 @@ class TicketPage extends StatefulWidget { class _TicketPageState extends State { static const _ticketNameMap = { - 1: '功能票', 2: '2倍功能票', 3: '3倍功能票', 4: '4倍功能票', - 5: '5倍功能票', - 6: '6倍功能票', + 5: '5倍功能票' }; TicketStep _step = TicketStep.idle;