From f3bd3053370fcee4a77c4436327dddb8918dadd9 Mon Sep 17 00:00:00 2001 From: dom Date: Thu, 12 Feb 2026 10:15:19 +0800 Subject: [PATCH] use findItemIndexCallback Signed-off-by: dom --- lib/pages/live_room/superchat/superchat_panel.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/live_room/superchat/superchat_panel.dart b/lib/pages/live_room/superchat/superchat_panel.dart index d08e875b0..72bdd3424 100644 --- a/lib/pages/live_room/superchat/superchat_panel.dart +++ b/lib/pages/live_room/superchat/superchat_panel.dart @@ -34,12 +34,12 @@ class _SuperChatPanelState extends DebounceStreamState padding: const EdgeInsets.symmetric(horizontal: 12), physics: const ClampingScrollPhysics(), itemCount: widget.controller.superChatMsg.length, - findChildIndexCallback: (key) { + findItemIndexCallback: (key) { final index = widget.controller.superChatMsg.indexWhere( (i) => i.id == (key as ValueKey).value, ); - // Multiply by 2 to account for separators - return index == -1 ? null : index * 2; + // Return item index directly - no need to multiply by 2. + return index == -1 ? null : index; }, itemBuilder: (context, index) { final item = widget.controller.superChatMsg[index];