Notification.fromMap constructor

Notification.fromMap(
  1. Map<String, dynamic> json
)

Implementation

Notification.fromMap(Map<String, dynamic> json) {
  if (json != null) {
    msg = notificationTypeFromString(json['msg']);
    collection = json['collection'];
    serverId = json['server_id'];
    subs = json['subs'] != null ? List<String>.from(json['subs']) : null;
    methods =
        json['methods'] != null ? List<String>.from(json['methods']) : null;
    id = json["id"];
    fields = json['fields'] != null
        ? NotificationFields.fromMap(json["fields"])
        : null;
    result = json['result'] != null
        ? NotificationResult.fromMap(json['result'])
        : null;
  }
}