fromJson static method

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

Implementation

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

  return NotificationGroup(
    id: (json['id'] as int?) ?? 0,
    type: NotificationGroupType.fromJson(tdMapFromJson(json['type'])),
    chatId: (json['chat_id'] as int?) ?? 0,
    totalCount: (json['total_count'] as int?) ?? 0,
    notifications: List<Notification>.from(
      tdListFromJson(json['notifications'])
          .map((item) => Notification.fromJson(tdMapFromJson(item)))
          .whereType<Notification>(),
    ),
  );
}