diff --git a/CHANGELOG.md b/CHANGELOG.md index 546b78e..4b6d8ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -## 0.3.0-nullsafety +## 0.3.0-nullsafety.0 + - Updated to support 2.12.0 and null safety. ## 0.2.1 diff --git a/lib/cli_logging.dart b/lib/cli_logging.dart index 106d51e..ae03fa1 100644 --- a/lib/cli_logging.dart +++ b/lib/cli_logging.dart @@ -201,16 +201,13 @@ class AnsiProgress extends Progress { final Ansi ansi; int _index = 0; - late Timer _timer; + late final _timer = Timer.periodic(Duration(milliseconds: 80), (t) { + _index++; + _updateDisplay(); + }); AnsiProgress(this.ansi, String message) : super(message) { io.stdout.write('${message}... '.padRight(40)); - - _timer = Timer.periodic(Duration(milliseconds: 80), (t) { - _index++; - _updateDisplay(); - }); - _updateDisplay(); } @@ -258,12 +255,10 @@ class VerboseLogger implements Logger { @override Ansi ansi; bool logTime; - late Stopwatch _timer; + final _timer = Stopwatch()..start(); VerboseLogger({Ansi? ansi, this.logTime = false}) - : ansi = ansi ?? Ansi(Ansi.terminalSupportsAnsi) { - _timer = Stopwatch()..start(); - } + : ansi = ansi ?? Ansi(Ansi.terminalSupportsAnsi); @override bool get isVerbose => true;