NotificationMessage.fromJson constructor

NotificationMessage.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory NotificationMessage.fromJson(Map<String, dynamic> json) {
  debugPrint(json.toString());
  return NotificationMessage(
    id: json['id'] ?? '',
    alert: json['alert'] ?? '',
    sound: json['sound'],
    soundName: json['soundName'],
    title: json['title'],
    subtitle: json['subtitle'],
    type: json['type'] ?? '',
    trigger: json['trigger'] ?? '',
    url: json['url'],
    mediaUrl: json['mediaUrl'],
    mediaAltText: json['mediaAltText'],
    customKeys: json['customKeys'] is Map<dynamic, dynamic>
        ? Map<String, String>.from(json['customKeys'])
        : null,
    custom: json['custom'],
    payload: json['payload'] != null
        ? Map<String, String>.from(json['payload'])
        : null,
  );
}