From 959bcfaa30610ff5c2f2e3b89603072245ef55d9 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 16 Feb 2025 13:27:26 +0800 Subject: [PATCH] mod: keep pgc index page Signed-off-by: bggRGjQaUbCoE --- lib/pages/bangumi/pgc_index/pgc_index_page.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pages/bangumi/pgc_index/pgc_index_page.dart b/lib/pages/bangumi/pgc_index/pgc_index_page.dart index 377c9028..d2068a47 100644 --- a/lib/pages/bangumi/pgc_index/pgc_index_page.dart +++ b/lib/pages/bangumi/pgc_index/pgc_index_page.dart @@ -22,14 +22,19 @@ class PgcIndexPage extends StatefulWidget { State createState() => _PgcIndexPageState(); } -class _PgcIndexPageState extends State { +class _PgcIndexPageState extends State + with AutomaticKeepAliveClientMixin { late final _ctr = Get.put( PgcIndexController(widget.indexType), tag: '${widget.indexType}', ); + @override + bool get wantKeepAlive => widget.indexType != null; + @override Widget build(BuildContext context) { + super.build(context); return widget.indexType == null ? Scaffold( appBar: AppBar(title: const Text('索引')),