Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 1 month ago
JSON representation
Compute progress of a long-running process.
- Host: GitHub
- URL: https://github.com/matanlurey/progress.dart
- Owner: matanlurey
- License: bsd-3-clause
- Archived: true
- Created: 2017-05-27T23:38:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-27T23:52:07.000Z (over 7 years ago)
- Last Synced: 2024-09-26T01:07:30.568Z (about 2 months ago)
- Topics: cli, dart, dartlang, flutter, progress
- Language: Dart
- Size: 7.81 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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);
```