fromJson static method

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

Implementation

static NotificationType? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  switch (json['@type']) {
    case NotificationTypeNewCall.constructor:
      return NotificationTypeNewCall.fromJson(json);

    case NotificationTypeNewMessage.constructor:
      return NotificationTypeNewMessage.fromJson(json);

    case NotificationTypeNewPushMessage.constructor:
      return NotificationTypeNewPushMessage.fromJson(json);

    case NotificationTypeNewSecretChat.constructor:
      return NotificationTypeNewSecretChat.fromJson(json);

    default:
      return null;
  }
}