File.fromJson constructor

File.fromJson(
  1. Object? j
)

Implementation

factory File.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return File(
    videoMetadata: switch (json['videoMetadata']) {
      null => null,
      Object $1 => VideoFileMetadata.fromJson($1),
    },
    name: switch (json['name']) {
      null => '',
      Object $1 => decodeString($1),
    },
    displayName: switch (json['displayName']) {
      null => '',
      Object $1 => decodeString($1),
    },
    mimeType: switch (json['mimeType']) {
      null => '',
      Object $1 => decodeString($1),
    },
    sizeBytes: switch (json['sizeBytes']) {
      null => 0,
      Object $1 => decodeInt64($1),
    },
    createTime: switch (json['createTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    updateTime: switch (json['updateTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    expirationTime: switch (json['expirationTime']) {
      null => null,
      Object $1 => Timestamp.fromJson($1),
    },
    sha256Hash: switch (json['sha256Hash']) {
      null => Uint8List(0),
      Object $1 => decodeBytes($1),
    },
    uri: switch (json['uri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    downloadUri: switch (json['downloadUri']) {
      null => '',
      Object $1 => decodeString($1),
    },
    state: switch (json['state']) {
      null => File_State.$default,
      Object $1 => File_State.fromJson($1),
    },
    source: switch (json['source']) {
      null => File_Source.$default,
      Object $1 => File_Source.fromJson($1),
    },
    error: switch (json['error']) {
      null => null,
      Object $1 => Status.fromJson($1),
    },
  );
}