ContainerItem.fromMap constructor

ContainerItem.fromMap(
  1. Map map
)

Creates a ContainerItem from a platform channel map.

Used internally by the method channel layer to deserialize native results. Expected keys: relativePath (String, required), downloadStatus (String?), isDownloading (bool?), isUploaded (bool?), isUploading (bool?), hasUnresolvedConflicts (bool?), isDirectory (bool?).

Implementation

ContainerItem.fromMap(Map<dynamic, dynamic> map)
    : relativePath = _requireRelativePath(map),
      downloadStatus = _mapDownloadStatus(
        map['downloadStatus'] as String?,
      ),
      isDownloading = (map['isDownloading'] as bool?) ?? false,
      isUploaded = (map['isUploaded'] as bool?) ?? false,
      isUploading = (map['isUploading'] as bool?) ?? false,
      hasUnresolvedConflicts =
          (map['hasUnresolvedConflicts'] as bool?) ?? false,
      isDirectory = (map['isDirectory'] as bool?) ?? false;