DriveFile.fromMap constructor

DriveFile.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory DriveFile.fromMap(Map<String, dynamic> map) {
  return DriveFile(
    category: map['category'],
    id: map['id'],
    fileName: map['fileName'],
    size: map['size'],
    mimeType: map['mimeType'],
    parentFolder: map['parentFolder'] == null
        ? null
        : List<String>.from(map['parentFolder']),
    createdTime: map['createdTime'] == null
        ? null
        : DateTime.parse(map['createdTime']),
    editedTime:
        map['editedTime'] == null ? null : DateTime.parse(map['editedTime']),
    description: map['description'],
    owners: map['owners'] == null
        ? null
        : List<DriveUser>.from(
            map['owners']?.map(
              (dynamic x) => DriveUser.fromMap(x),
            ),
          ),
    favorite: map['favorite'],
    recycled: map['recycled'],
    appSettings: map['appSettings'] == null
        ? null
        : Map<String, String>.from(map['appSettings']),
    properties: map['properties'] == null
        ? null
        : Map<String, String>.from(map['properties']),
    capabilities: map['capabilities'] == null
        ? null
        : DriveCapabilities.fromMap(map['capabilities']),
    contentExtras: map['contentExtras'] == null
        ? null
        : ContentExtras.fromMap(map['contentExtras']),
    writerHasCopyPermission: map['writerHasCopyPermission'],
    directlyRecycled: map['directlyRecycled'],
    fileSuffix: map['fileSuffix'],
    fullFileSuffix: map['fullFileSuffix'],
    existThumbnail: map['existThumbnail'],
    iconDownloadLink: map['iconDownloadLink'],
    pictureMetadata: map['pictureMetadata'] == null
        ? null
        : PictureMetadata.fromMap(map['pictureMetadata']),
    isAppAuthorized: map['isAppAuthorized'],
    lastEditor: map['lastEditor'] == null
        ? null
        : DriveUser.fromMap(map['lastEditor']),
    editedByMe: map['editedByMe'],
    editedByMeTime: map['editedByMeTime'] == null
        ? null
        : DateTime.parse(map['editedByMeTime']),
    ownedByMe: map['ownedByMe'],
    permissionIds: map['permissionIds'] == null
        ? null
        : List<String>.from(map['permissionIds']),
    permissions: map['permissions'] == null
        ? null
        : List<DrivePermission>.from(
            map['permissions']?.map(
              (Map<String, dynamic> x) => DrivePermission.fromMap(x),
            ),
          ),
    occupiedSpace: map['occupiedSpace'],
    sha256: map['sha256'],
    hasShared: map['hasShared'],
    sharedWithMeTime: map['sharedWithMeTime'] == null
        ? null
        : DateTime.parse(map['sharedWithMeTime']),
    sharer: map['sharer'] == null ? null : DriveUser.fromMap(map['sharer']),
    containers: map['containers'] == null
        ? null
        : List<String>.from(map['containers']),
    thumbnailDownloadLink: map['thumbnailDownloadLink'],
    smallThumbnailDownloadLink: map['smallThumbnailDownloadLink'],
    recycledTime: map['recycledTime'] == null
        ? null
        : DateTime.parse(map['recycledTime']),
    recyclingUser: map['recyclingUser'] == null
        ? null
        : DriveUser.fromMap(map['recyclingUser']),
    videoMetadata: map['videoMetadata'] == null
        ? null
        : VideoMetadata.fromMap(map['videoMetadata']),
    contentDownloadLink: map['contentDownloadLink'],
    writersHasSharePermission: map['writersHasSharePermission'],
    contentVersion: map['contentVersion'],
    lastHistoryVersionId: map['lastHistoryVersionId'],
    originalFilename: map['originalFilename'],
    thumbnailVersion: map['thumbnailVersion'],
    version: map['version'],
    onLineViewLink: map['onLineViewLink'],
  );
}