PushNotification.fromJson constructor

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

Deserializes the specified JSON into an object of the PushNotification object.

Implementation

factory PushNotification.fromJson(Map<String, dynamic>? json) {
  String pushType =
      json?['pushType'] == null ? PushType.DEFAULT.value : json?['pushType'];
  return PushNotification(
      json?['mechanismUID'],
      json?['messageId'],
      json?['challenge'],
      json?['amlbCookie'],
      json?['customPayload'],
      json?['message'],
      json?['contextInfo'],
      json?['numbersChallenge'],
      json?['timeAdded'],
      json?['timeExpired'],
      json?['ttl'],
      json?['approved'],
      json?['pending'],
      pushType.parsePushType());
}