mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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:
co-authored by
Claude Sonnet 4.6
parent
e320d54b38
commit
527e2bd6c8
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user