CharacterProgressPrinter<N extends num> constructor

CharacterProgressPrinter<N extends num>(
  1. ProgressFuture<Object?, N> future, {
  2. String? eventToString(
    1. ProgressEvent<N> event
    )?,
  3. bool newline = true,
})

Prints a character or string for each event. A dot is the default.

Implementation

CharacterProgressPrinter(
  this.future, {
  this.eventToString,
  this.newline = true,
}) {
  if (newline) {
    future.then((_) => stdout.writeln());
  }

  future.events.listen(_onEvent);
}