fromJson static method

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

Implementation

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

  return StorageStatistics(
    size: (json['size'] as int?) ?? 0,
    count: (json['count'] as int?) ?? 0,
    byChat: List<StorageStatisticsByChat>.from(
      tdListFromJson(json['by_chat'])
          .map(
            (item) => StorageStatisticsByChat.fromJson(tdMapFromJson(item)),
          )
          .whereType<StorageStatisticsByChat>(),
    ),
  );
}