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('索引')),