Style notification list items by read/unread status

Unread notifications (isNew=true) now show a secondaryContainer background,
bold title, and primary-colored icon per Material 3 guidelines. State changes
via mark-as-read/unread update the item's styling immediately in the All filter
view using mapItems with a copyWith, ensuring PagingStateBase's deep equality
check detects the change and triggers a rebuild.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-27 11:00:46 -04:00
co-authored by Claude Sonnet 4.6
parent e320d54b38
commit 527e2bd6c8
2 changed files with 31 additions and 1 deletions
+9
View File
@@ -27,6 +27,15 @@ class Notification {
body = json['body'] as String,
isNew = json['is_new'] as bool;
Notification copyWith({bool? isNew}) => Notification(
id: id,
title: title,
body: body,
notificationType: notificationType,
createdOn: createdOn,
isNew: isNew ?? this.isNew,
);
Map<String, dynamic> toJson() => {
'id': id,
'created_on': createdOn.toUtc().toIso8601String(),