This commit is contained in:
2026-05-24 16:25:51 +08:00
parent 4ad57dc1cf
commit feed9b898a
4 changed files with 42 additions and 16 deletions

View File

@@ -92,6 +92,7 @@ class _HomePageState extends State<HomePage> {
Future<void> _performLogout() async {
setState(() => _loggingOut = true);
await Future.delayed(const Duration(seconds: 5));
try {
if (TitleServerConfigHolder().isConfigured && _data != null && _data!.isLogin) {
final service = TitleApiService(TitleServerConfigHolder().config!);
@@ -114,17 +115,21 @@ class _HomePageState extends State<HomePage> {
appBar: AppBar(
title: Text(_tabTitles[_currentTab]),
actions: [
IconButton(
icon: _loggingOut
? const SizedBox(
width: 20,
height: 20,
child: CircularProgressIndicator(strokeWidth: 2),
)
: const Icon(Icons.logout),
tooltip: AppStrings.logoutTooltip,
onPressed: _loggingOut ? null : _performLogout,
),
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: _performLogout,
),
],
),
body: IndexedStack(