57 lines
1.4 KiB
Dart
57 lines
1.4 KiB
Dart
class NotificationMessage {
|
|
String? notificationType;
|
|
String? title;
|
|
String? body;
|
|
String? id;
|
|
String? type;
|
|
String? link;
|
|
String? image;
|
|
String? photo;
|
|
|
|
NotificationMessage(
|
|
{this.notificationType,
|
|
this.title,
|
|
this.body,
|
|
this.id,
|
|
this.type,
|
|
this.link,
|
|
this.image,
|
|
this.photo,
|
|
});
|
|
|
|
NotificationMessage.fromJson(Map<String, dynamic> json) {
|
|
notificationType = json['notificationType'];
|
|
title = json['title'];
|
|
body = json['body'];
|
|
id = json['id'];
|
|
type = json['type'];
|
|
link = json['link'];
|
|
image = json['image'];
|
|
photo = json['photo'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
data['notificationType'] = this.notificationType;
|
|
data['title'] = this.title;
|
|
data['body'] = this.body;
|
|
data['id'] = this.id;
|
|
data['type'] = this.type;
|
|
data['link'] = this.link;
|
|
data['image'] = this.image;
|
|
data['photo'] = this.photo;
|
|
return data;
|
|
}
|
|
Map<String, String> toPayload() {
|
|
final Map<String, String> data = new Map<String, String>();
|
|
data['notificationType'] = this.notificationType!;
|
|
data['title'] = this.title!;
|
|
data['body'] = this.body!;
|
|
data['id'] = this.id!;
|
|
data['type'] = this.type!;
|
|
data['link'] = this.link!;
|
|
data['image'] = this.image!;
|
|
data['photo'] = this.photo!;
|
|
return data;
|
|
}
|
|
} |