mod: keep pgc index page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-16 13:27:26 +08:00
parent fa465f792d
commit 959bcfaa30

View File

@@ -22,14 +22,19 @@ class PgcIndexPage extends StatefulWidget {
State<PgcIndexPage> createState() => _PgcIndexPageState(); State<PgcIndexPage> createState() => _PgcIndexPageState();
} }
class _PgcIndexPageState extends State<PgcIndexPage> { class _PgcIndexPageState extends State<PgcIndexPage>
with AutomaticKeepAliveClientMixin {
late final _ctr = Get.put( late final _ctr = Get.put(
PgcIndexController(widget.indexType), PgcIndexController(widget.indexType),
tag: '${widget.indexType}', tag: '${widget.indexType}',
); );
@override
bool get wantKeepAlive => widget.indexType != null;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return widget.indexType == null return widget.indexType == null
? Scaffold( ? Scaffold(
appBar: AppBar(title: const Text('索引')), appBar: AppBar(title: const Text('索引')),