mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Three intertwined fixes so that marking a notification as read from the trailing menu, swipe-dismiss, and 'Mark all as read' all consistently update the UI and surface backend failures. - Guard the mark-read, mark-new, and mark-all calls with try/catch; on failure show a snackbar with the mapped error and leave the list untouched. - Use the State's own `mounted` and `context` after the await instead of the per-card BuildContext, so the SliverList rebuild reliably runs even when the originating NotificationCard's element has been swapped out by the reconciliation. _setRead and _markAllAsRead no longer take a BuildContext. - Replace `Dismissible(key: UniqueKey())` with `ValueKey(item.id)` in the notification card. UniqueKey was regenerated on every build, forcing the Dismissible/PopupMenuButton subtree to be disposed on any parent rebuild; the open menu's `mounted` check would then drop `onSelected` silently. - Add `ValueKey(device.macAddress)` to the device list rows for the same reason, anchoring each row's Element (and its PopupMenuButton State) to its device identity instead of its list position. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
frontend
A new Flutter project.