Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-04 12:25:02 +08:00
parent f0c4d3412d
commit f0828ea18c
6 changed files with 21 additions and 17 deletions

View File

@@ -16,14 +16,17 @@ class SuperChatPanel extends StatefulWidget {
State<SuperChatPanel> createState() => _SuperChatPanelState();
}
class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool> {
class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool>
with AutomaticKeepAliveClientMixin {
@override
Duration get duration => const Duration(milliseconds: 300);
@override
Widget build(BuildContext context) {
super.build(context);
return Obx(
() => ListView.separated(
key: const PageStorageKey('live-sc'),
padding: const EdgeInsets.symmetric(horizontal: 12),
physics: const ClampingScrollPhysics(),
itemCount: widget.controller.superChatMsg.length,
@@ -42,4 +45,7 @@ class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool> {
@override
void onValueChanged(value) => widget.controller.clearSC();
@override
bool get wantKeepAlive => true;
}