NotificationType.fromJson constructor

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

Implementation

factory NotificationType.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case NotificationTypeNewMessage.CONSTRUCTOR:
      return NotificationTypeNewMessage.fromJson(json);
    case NotificationTypeNewSecretChat.CONSTRUCTOR:
      return NotificationTypeNewSecretChat.fromJson(json);
    case NotificationTypeNewCall.CONSTRUCTOR:
      return NotificationTypeNewCall.fromJson(json);
    case NotificationTypeNewPushMessage.CONSTRUCTOR:
      return NotificationTypeNewPushMessage.fromJson(json);
    default:
      return const NotificationType();
  }
}