runWith method

void runWith(
  1. void callback(
    1. void update(
      1. int current,
      2. int total
      )
    )
)

Runs the progress bar with a callback that provides updates.

Implementation

void runWith(
    void Function(void Function(int current, int total) update) callback) {
  runSession(() {
    int phase = 0;
    callback((current, total) {
      show(current: current, total: total, shimmerPhase: phase++);
    });
  }, plainStart: prompt, plainSuccess: prompt);
}