finish method
Writes bytes where the last start of id put its part file, then reports the download complete.
Implementation
void finish(String id, List<int> bytes) {
final start = lastStart(id) ?? (throw StateError('$id was never started'));
File(start.path)
..createSync(recursive: true)
..writeAsBytesSync(bytes);
kept.remove(id);
emit(ModelDownloadUpdate(id: id, state: ModelDownloadState.complete));
}