show static method
Shows the progress by overwritting the existing console line with the
string returned from format
.
Once the download is complete a final newline will be sent to the console
so that subsequent output from your script will go on a separate line.
fetch(
url:
'https://some/resource/file.zip',
saveToPath: pathToPiImage,
fetchProgress: (progress) => 'So far: progress.download')
});
Implementation
static void show(
FetchProgress progress, {
String Function(FetchProgress progress)? format,
}) {
final message = format == null ? progress.toString() : format(progress);
Terminal().overwriteLine(message);
if (progress.status == FetchStatus.complete) {
print('');
}
}