ICloudFile.fromMap constructor

ICloudFile.fromMap(
  1. Map map
)

Constructor to create the object from the map passed from platform code. The native layer guarantees relativePath is always present when a map is returned.

Implementation

ICloudFile.fromMap(Map<dynamic, dynamic> map)
    : relativePath = _requireRelativePath(map),
      isDirectory = (map['isDirectory'] as bool?) ?? false,
      sizeInBytes = _mapToInt(map['sizeInBytes']),
      creationDate = _mapToDateTime(map['creationDate']),
      contentChangeDate = _mapToDateTime(map['contentChangeDate']),
      isDownloading = (map['isDownloading'] as bool?) ?? false,
      downloadStatus =
          _mapToDownloadStatusFromNSKeys(map['downloadStatus'] as String?),
      isUploading = (map['isUploading'] as bool?) ?? false,
      isUploaded = (map['isUploaded'] as bool?) ?? false,
      hasUnresolvedConflicts =
          (map['hasUnresolvedConflicts'] as bool?) ?? false;