🐛 Bug fixes and optimization

This commit is contained in:
2024-05-13 22:52:41 +08:00
parent f43f9e91f6
commit d46d584ff3
5 changed files with 52 additions and 16 deletions

View File

@@ -28,9 +28,9 @@ class Notification {
});
factory Notification.fromJson(Map<String, dynamic> json) => Notification(
id: json['id'],
createdAt: DateTime.parse(json['created_at']),
updatedAt: DateTime.parse(json['updated_at']),
id: json['id'] ?? 0,
createdAt: json['created_at'] == null ? DateTime.now() : DateTime.parse(json['created_at']),
updatedAt: json['updated_at'] == null ? DateTime.now() : DateTime.parse(json['updated_at']),
deletedAt: json['deleted_at'],
subject: json['subject'],
content: json['content'],