RemoteMessage.fromMap constructor

RemoteMessage.fromMap(
  1. Map<String, dynamic>? map
)

Implementation

factory RemoteMessage.fromMap(Map<String, dynamic>? map) {
  if (map == null) return RemoteMessage._();
  return RemoteMessage._(
    to: map[RemoteMessage.TO] == null ? null : map[RemoteMessage.TO],
    from: map[RemoteMessage.FROM] == null ? null : map[RemoteMessage.FROM],
    messageId: map[RemoteMessage.MESSAGE_ID] == null
        ? null
        : map[RemoteMessage.MESSAGE_ID],
    token: map[RemoteMessage.TOKEN] == null ? null : map[RemoteMessage.TOKEN],
    sentTime: map[RemoteMessage.SENT_TIME] == null
        ? null
        : map[RemoteMessage.SENT_TIME],
    urgency: map[RemoteMessage.URGENCY] == null
        ? null
        : map[RemoteMessage.URGENCY],
    originalUrgency: map[RemoteMessage.ORIGINAL_URGENCY] == null
        ? null
        : map[RemoteMessage.ORIGINAL_URGENCY],
    ttl: map[RemoteMessage.TTL] == null ? null : map[RemoteMessage.TTL],
    type: map[RemoteMessage.MESSAGE_TYPE] == null
        ? null
        : map[RemoteMessage.MESSAGE_TYPE],
    collapseKey: map[RemoteMessage.COLLAPSE_KEY] == null
        ? null
        : map[RemoteMessage.COLLAPSE_KEY],
    data: map[RemoteMessage.DATA] == null ? null : map[RemoteMessage.DATA],
    dataOfMap: map[RemoteMessage.DATA_OF_MAP] == null
        ? null
        : Map.from(json.decode(map[RemoteMessage.DATA_OF_MAP])),
    notification: map[RemoteMessage.NOTIFICATION] == null
        ? null
        : _RemoteMessageNotification.fromMap(map[RemoteMessage.NOTIFICATION]),
    sendMode: map[RemoteMessage.SEND_MODE] == null
        ? null
        : map[RemoteMessage.SEND_MODE],
    receiptMode: map[RemoteMessage.RECEIPT_MODE] == null
        ? null
        : map[RemoteMessage.RECEIPT_MODE],
    analyticInfo: map[RemoteMessage.ANALYTICS_INFO] == null
        ? null
        : map[RemoteMessage.ANALYTICS_INFO],
    analyticInfoMap: map[RemoteMessage.ANALYTIC_INFO_MAP] == null
        ? null
        : Map<String, String>.from(map[RemoteMessage.ANALYTIC_INFO_MAP]),
  );
}