add method

MultiProgressModel add(
  1. String key, {
  2. ProgressModel? model,
})

Adds a new progress bar with the given key.

Implementation

MultiProgressModel add(String key, {ProgressModel? model}) {
  final newBars = Map<String, ProgressModel>.from(bars);
  newBars[key] = model ?? ProgressModel(width: width);
  return MultiProgressModel(bars: newBars, width: width);
}