listFiles method
Step 5: Get the final file results with patch IDs.
Implementation
Future<List<WriteFileResult>> listFiles() async {
if (_step != _WriteFilesFlowStep.certified) {
throw StateError('Must call certify() before listFiles()');
}
final metadata = _metadata!;
final index = _quiltIndex!;
return index.patches.map((patch) {
return WriteFileResult(
id: encodeQuiltPatchId(
quiltBlobId: metadata.blobId,
version: 1,
startIndex: patch.startIndex,
endIndex: patch.endIndex,
),
blobId: metadata.blobId,
blobObjectId: _blobObjectId!,
);
}).toList();
}