fromReleaseFile static method

FutureOr<ReleaseManifestFile> fromReleaseFile(
  1. ReleaseFile releaseFile
)

Implementation

static FutureOr<ReleaseManifestFile> fromReleaseFile(
    ReleaseFile releaseFile) {
  var sha256 = releaseFile.dataSHA256;
  var length = releaseFile.length;
  if (sha256 is Uint8List && length is int) {
    return ReleaseManifestFile(releaseFile.filePath, length, sha256);
  } else {
    return Future.sync(() => sha256).then((sha256Value) {
      return Future.sync(() => length).then((lengthValue) =>
          ReleaseManifestFile(
              releaseFile.filePath, lengthValue, sha256Value));
    });
  }
}