How I can remove previously printed line in console with print() in Dart?
I am willing to display a progress indicator such as:
int n = 0;
for (var item in list) {
n++;
print('${(n / list.length * 100).toStringAsFixed(0)}%');
// do something
}
Currently it prints:
1%
2%
3%
...
But I would like to delete the previous line and replace it with the newly calculated percent.