progress

Compute progress of a long-running process.

pub package Build Status Coverage Status

This package is platform agnostic, and will work equally well for command-line applications (CLI), mobile applications on Flutter, and web applications written in Dart.

Warning: This is not an official Google or Dart project.

Installation

dependencies:
  progress: ^0.1.0

Usage

To produce a Stream<Moment>, use an Updater:

// A simple stub of reporting 50% progress, then 100%.
Stream<Moment> progress() {
  final updater = new Updater(100);
  scheduleMicrotask(() {
    updater.update(50);
    scheduleMicrotask(() {
      updater.update(100);
    });
  });
  return updater;
}

To use an existing Stream<num> of current values, use asProgress:

asProgress(currentValues, totalValue);

Libraries

progress