fromJson static method

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

Implementation

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

  return StorageStatisticsByChat(
    chatId: (json['chat_id'] as int?) ?? 0,
    size: (json['size'] as int?) ?? 0,
    count: (json['count'] as int?) ?? 0,
    byFileType: List<StorageStatisticsByFileType>.from(
      tdListFromJson(json['by_file_type'])
          .map(
            (item) =>
                StorageStatisticsByFileType.fromJson(tdMapFromJson(item)),
          )
          .whereType<StorageStatisticsByFileType>(),
    ),
  );
}