🐛 Fix notification list render issue

This commit is contained in:
LittleSheep 2024-07-23 22:09:20 +08:00
parent e91b4b0947
commit 39c8597428

View File

@ -32,7 +32,7 @@ class _NotificationScreenState extends State<NotificationScreen> {
if (markList.isNotEmpty) { if (markList.isNotEmpty) {
final client = auth.configureClient('auth'); final client = auth.configureClient('auth');
await client.put('/notifications/batch/read', {'messages': markList}); await client.put('/notifications/read', {'messages': markList});
} }
provider.notifications.clear(); provider.notifications.clear();
@ -55,7 +55,7 @@ class _NotificationScreenState extends State<NotificationScreen> {
final client = auth.configureClient('auth'); final client = auth.configureClient('auth');
await client.put('/notifications/${element.id}/read', {}); await client.put('/notifications/read/${element.id}', {});
provider.notifications.removeAt(index); provider.notifications.removeAt(index);
@ -98,14 +98,14 @@ class _NotificationScreenState extends State<NotificationScreen> {
), ),
if (provider.notifications.isNotEmpty) if (provider.notifications.isNotEmpty)
SliverToBoxAdapter( SliverToBoxAdapter(
child: ListTile( child: Container(
tileColor: padding: const EdgeInsets.symmetric(horizontal: 10),
Theme.of(context).colorScheme.secondaryContainer, color: Theme.of(context).colorScheme.secondaryContainer,
leading: const Icon(Icons.checklist), child: ListTile(
title: Text('notifyAllRead'.tr), leading: const Icon(Icons.checklist),
contentPadding: title: Text('notifyAllRead'.tr),
const EdgeInsets.symmetric(horizontal: 28), onTap: _isBusy ? null : () => markAllRead(),
onTap: _isBusy ? null : () => markAllRead(), ),
), ),
), ),
SliverList.separated( SliverList.separated(