Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit ce0e429

Browse files
committed
fix: update progress correctly for idea
1 parent f1bca85 commit ce0e429

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/src/logger/progress.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Progress {
6363

6464
void complete([String? update]) {
6565
_stopwatch.stop();
66-
_writeLn('$_clearLn${okPen('')} ${update ?? _message} $_time\n');
66+
_writeLn('$_clearLn${okPen('')} ${update ?? _message} $_time\n');
6767
_timer?.cancel();
6868
}
6969

@@ -76,8 +76,7 @@ class Progress {
7676
void _onTick(Timer? _, [bool withTime = true]) {
7777
_index++;
7878
final char = _progressAnimation[_index % _progressAnimation.length];
79-
_write('$_clearMessageLength$char $_message... ${withTime ? _time : ''}'
80-
.trim());
79+
_write('$_clearLn$char $_message... ${withTime ? _time : ''}'.trim());
8180
}
8281

8382
void _write(Object? object) {
@@ -92,13 +91,8 @@ class Progress {
9291
}
9392
}
9493

95-
String get _clearMessageLength {
96-
final length = _message!.length + 8 + _time.length;
97-
98-
return '\b${'\b' * length}';
99-
}
100-
101-
String get _clearLn => '$_clearMessageLength\u001b[2K';
94+
String get _clearLn => '\u001b[2K'
95+
'\r';
10296

10397
String get _time {
10498
final elapsedTime = _stopwatch.elapsed.inMilliseconds;

0 commit comments

Comments
 (0)