40 lines
891 B
Dart
40 lines
891 B
Dart
|
|
import 'notification_payload.dart';
|
||
|
|
|
||
|
|
class NotificationItem {
|
||
|
|
const NotificationItem({
|
||
|
|
required this.id,
|
||
|
|
required this.notificationId,
|
||
|
|
required this.type,
|
||
|
|
required this.title,
|
||
|
|
required this.body,
|
||
|
|
required this.payload,
|
||
|
|
required this.isRead,
|
||
|
|
required this.createdAt,
|
||
|
|
this.readAt,
|
||
|
|
});
|
||
|
|
|
||
|
|
final String id;
|
||
|
|
final String notificationId;
|
||
|
|
final String type;
|
||
|
|
final String title;
|
||
|
|
final String body;
|
||
|
|
final NotificationPayload payload;
|
||
|
|
final bool isRead;
|
||
|
|
final DateTime createdAt;
|
||
|
|
final DateTime? readAt;
|
||
|
|
|
||
|
|
NotificationItem copyWith({bool? isRead, DateTime? readAt}) {
|
||
|
|
return NotificationItem(
|
||
|
|
id: id,
|
||
|
|
notificationId: notificationId,
|
||
|
|
type: type,
|
||
|
|
title: title,
|
||
|
|
body: body,
|
||
|
|
payload: payload,
|
||
|
|
isRead: isRead ?? this.isRead,
|
||
|
|
createdAt: createdAt,
|
||
|
|
readAt: readAt ?? this.readAt,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|