mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Keep notification cards collapsed when a sibling is removed
SliverList recycles State objects by index, so when an expanded notification was marked as read and dropped from the filtered list, the next notification inherited the expanded state. Give each card a ValueKey(id) so its expand/collapse state is matched by notification, not by list position. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
2a6d480428
commit
aa5a29271b
@@ -309,6 +309,7 @@ class _NotificationsListState extends State<NotificationsList>
|
||||
itemBuilder: (context, index) {
|
||||
final item = _items[index];
|
||||
return NotificationCard(
|
||||
key: ValueKey(item.id),
|
||||
item: item,
|
||||
formatter: formatter,
|
||||
onSetRead: (read) => _setRead(item, read),
|
||||
|
||||
Reference in New Issue
Block a user