2024-10-16 14:16:03 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2024-09-16 18:14:23 +00:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
2024-09-07 07:36:06 +00:00
|
|
|
|
|
|
|
part 'notification.g.dart';
|
|
|
|
|
2024-10-16 14:16:03 +00:00
|
|
|
const Map<String, IconData> NotificationTopicIcons = {
|
|
|
|
'passport.security.alert': Icons.gpp_maybe,
|
|
|
|
};
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
@JsonSerializable()
|
2024-05-18 10:17:16 +00:00
|
|
|
class Notification {
|
|
|
|
int id;
|
|
|
|
DateTime createdAt;
|
|
|
|
DateTime updatedAt;
|
|
|
|
DateTime? deletedAt;
|
2024-10-15 16:50:48 +00:00
|
|
|
DateTime? readAt;
|
2024-10-16 14:16:03 +00:00
|
|
|
String topic;
|
2024-07-19 15:38:25 +00:00
|
|
|
String title;
|
|
|
|
String? subtitle;
|
|
|
|
String body;
|
|
|
|
String? avatar;
|
|
|
|
String? picture;
|
2024-10-16 14:16:03 +00:00
|
|
|
Map<String, dynamic>? metadata;
|
2024-05-18 10:17:16 +00:00
|
|
|
int? senderId;
|
2024-07-21 15:43:18 +00:00
|
|
|
int accountId;
|
2024-05-18 10:17:16 +00:00
|
|
|
|
|
|
|
Notification({
|
|
|
|
required this.id,
|
|
|
|
required this.createdAt,
|
|
|
|
required this.updatedAt,
|
2024-05-28 16:14:41 +00:00
|
|
|
required this.deletedAt,
|
2024-10-15 16:50:48 +00:00
|
|
|
required this.readAt,
|
2024-10-16 14:16:03 +00:00
|
|
|
required this.topic,
|
2024-07-19 15:38:25 +00:00
|
|
|
required this.title,
|
|
|
|
required this.subtitle,
|
|
|
|
required this.body,
|
|
|
|
required this.avatar,
|
|
|
|
required this.picture,
|
2024-10-16 14:16:03 +00:00
|
|
|
required this.metadata,
|
2024-05-28 16:14:41 +00:00
|
|
|
required this.senderId,
|
2024-07-21 15:43:18 +00:00
|
|
|
required this.accountId,
|
2024-05-18 10:17:16 +00:00
|
|
|
});
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
factory Notification.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$NotificationFromJson(json);
|
2024-05-18 10:17:16 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$NotificationToJson(this);
|
2024-05-18 10:17:16 +00:00
|
|
|
}
|