second commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
class RiderNotificationRequest {
|
||||
String? token;
|
||||
NotificationRider? notification;
|
||||
RiderNotificationRequest({this.token, this.notification});
|
||||
RiderNotificationRequest.fromJson(Map<String, dynamic> json) {
|
||||
token = json['token'];
|
||||
notification = json['notification'] != null
|
||||
? new NotificationRider.fromJson(json['notification'])
|
||||
: null;
|
||||
}
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['token'] = this.token;
|
||||
if (this.notification != null) {
|
||||
data['notification'] = this.notification!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
class NotificationRider {
|
||||
String? title;
|
||||
String? body;
|
||||
String? sound;
|
||||
String? image;
|
||||
NotificationRider({this.title, this.body, this.sound, this.image});
|
||||
NotificationRider.fromJson(Map<String, dynamic> json) {
|
||||
title = json['title'];
|
||||
body = json['body'];
|
||||
sound = json['sound'];
|
||||
image = json['image'];
|
||||
}
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['title'] = this.title;
|
||||
data['body'] = this.body;
|
||||
data['sound'] = this.sound;
|
||||
data['image'] = this.image;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
69
lib/Model/Request/Notification/Notificationrequest.dart
Normal file
69
lib/Model/Request/Notification/Notificationrequest.dart
Normal file
@@ -0,0 +1,69 @@
|
||||
class NotificationRequest {
|
||||
String? priority;
|
||||
List<String>? registrationIds;
|
||||
Data? data;
|
||||
Notification? notification;
|
||||
|
||||
NotificationRequest(
|
||||
{this.priority, this.registrationIds, this.data, this.notification});
|
||||
|
||||
NotificationRequest.fromJson(Map<String, dynamic> json) {
|
||||
priority = json['priority'];
|
||||
registrationIds = json['registration_ids'].cast<String>();
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
notification = json['notification'] != null
|
||||
? new Notification.fromJson(json['notification'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['priority'] = this.priority;
|
||||
data['registration_ids'] = this.registrationIds;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
if (this.notification != null) {
|
||||
data['notification'] = this.notification!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
String? accessid;
|
||||
|
||||
Data({this.accessid});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
accessid = json['accessid'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['accessid'] = this.accessid;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Notification {
|
||||
String? title;
|
||||
String? body;
|
||||
String? sound;
|
||||
|
||||
Notification({this.title, this.body, this.sound});
|
||||
|
||||
Notification.fromJson(Map<String, dynamic> json) {
|
||||
title = json['title'];
|
||||
body = json['body'];
|
||||
sound = json['sound'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['title'] = this.title;
|
||||
data['body'] = this.body;
|
||||
data['sound'] = this.sound;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user