Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/matanlurey/progress.dart

Compute progress of a long-running process.
https://github.com/matanlurey/progress.dart

cli dart dartlang flutter progress

Last synced: about 2 months ago
JSON representation

Compute progress of a long-running process.

Awesome Lists containing this project

README

        

# progress

Compute progress of a long-running process.

[![pub package](https://img.shields.io/pub/v/progress.svg)](https://pub.dartlang.org/packages/progress)
[![Build Status](https://travis-ci.org/matanlurey/progress.dart.svg)](https://travis-ci.org/matanlurey/progress.dart)
[![Coverage Status](https://coveralls.io/repos/github/matanlurey/progress.dart/badge.svg?branch=master)](https://coveralls.io/github/matanlurey/progress.dart?branch=master)

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.

[Flutter]: https://flutter.io

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

## Installation

```yaml
dependencies:
progress: ^0.1.0
```

## Usage

To produce a `Stream`, use an `Updater`:

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

To use an existing `Stream` of current values, use `asProgress`:

```dart
asProgress(currentValues, totalValue);
```