Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rohitedathil/consolebars
A dart library to create Progress Bars in console.
https://github.com/rohitedathil/consolebars
dart hacktoberfest library progress-bar pubdev terminal
Last synced: 19 days ago
JSON representation
A dart library to create Progress Bars in console.
- Host: GitHub
- URL: https://github.com/rohitedathil/consolebars
- Owner: RohitEdathil
- License: gpl-3.0
- Created: 2021-11-13T04:41:15.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-27T06:31:55.000Z (over 1 year ago)
- Last Synced: 2023-08-27T07:35:13.665Z (over 1 year ago)
- Topics: dart, hacktoberfest, library, progress-bar, pubdev, terminal
- Language: Dart
- Homepage:
- Size: 301 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/console_bars?include_prereleases)
![GitHub last commit](https://img.shields.io/github/last-commit/RohitEdathil/ConsoleBars)
![GitHub language count](https://img.shields.io/github/languages/count/RohitEdathil/ConsoleBars)
![GitHub top language](https://img.shields.io/github/languages/top/RohitEdathil/ConsoleBars)A package for creating an awesome progress bar in the terminal. Handy while developing a CLI or a desktop utility in dart.
### [See in pub.dev](https://pub.dev/packages/console_bars)
## Usage
Options:
- `total` : Total number of steps
- `desc `: Simple text shown before the bar (optional)
- `space` : Character denoting empty space (default : '.')
- `fill `: Character denoting filled space (default : '█')
- `time `: Toggle timing mode (default : false)
- `percentage` : Toggle percentage display (default : false)
- `scale` : Scale of the bar relative to width (between: 0 and 1, default: 0.5, Irrelavant if width is specified)
- `width` : Width of the bar (If not specified, it will be automatically calculated using the terminal width and scale)Code:
```dart
final p = FillingBar(desc: "Loading", total: 1000, time: true, percentage:true);
for (var i = 0; i < 1000; i++) {
p.increment();
sleep(Duration(milliseconds: 10));
}
```Result:
![Animation](https://github.com/RohitEdathil/ConsoleBars/blob/master/img/Animation.gif)
```
Loading : ████████████████████████████████████████.................... 673/1000 67.3% [ 0:00:13.28 / 0:00:06.45 ]
```**Note:** You can use the `total` and `desc` setters to change the total number of steps and description mid-way.