fix find sc index

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2026-01-03 15:28:19 +08:00
parent 3d95165d46
commit 9f5ce5ae37

View File

@@ -38,7 +38,8 @@ class _SuperChatPanelState extends DebounceStreamState<SuperChatPanel, bool>
final index = widget.controller.superChatMsg.indexWhere( final index = widget.controller.superChatMsg.indexWhere(
(i) => i.id == (key as ValueKey<int>).value, (i) => i.id == (key as ValueKey<int>).value,
); );
return index == -1 ? null : index; // Multiply by 2 to account for separators
return index == -1 ? null : index * 2;
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
final item = widget.controller.superChatMsg[index]; final item = widget.controller.superChatMsg[index];