relatica/lib/serializers/friendica/notification_friendica_extension.dart

16 lines
546 B
Dart

import '../../models/user_notification.dart';
extension NotificationFriendicaExtension on UserNotification {
static UserNotification fromJson(Map<String, dynamic> json) =>
UserNotification(
id: json['id'].toString(),
type: json['type'].toString(),
fromName: json['name'],
fromUrl: json['url'],
timestamp: int.tryParse(json['timestamp'] ?? '') ?? 0,
iid: json['iid'].toString(),
seen: json['seen'] ?? false,
content: json['msg_html'],
link: json['link'],
);
}