fromMap static method

FoundFileDownloads? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static FoundFileDownloads? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var total_counts = DownloadedFileCounts.fromMap(_map['total_counts'])!;
  var files = List<FileDownload>.from(
    (_map["files"] ?? []).map(
      (e) => FileDownload.fromMap(e),
    ),
  );
  var next_offset = _map['next_offset'] as String?;
  return FoundFileDownloads(
    extra: extra,
    clientId: clientId,
    total_counts: total_counts,
    files: files,
    next_offset: next_offset,
  );
}