https://github.com/glebbatykov/cli_progress_bar
Package for creating cli progress bar, customizing it.
https://github.com/glebbatykov/cli_progress_bar
Last synced: 3 months ago
JSON representation
Package for creating cli progress bar, customizing it.
- Host: GitHub
- URL: https://github.com/glebbatykov/cli_progress_bar
- Owner: GlebBatykov
- License: mit
- Created: 2023-06-05T22:33:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-26T17:54:35.000Z (almost 2 years ago)
- Last Synced: 2025-02-09T16:17:10.530Z (4 months ago)
- Language: Dart
- Homepage:
- Size: 93.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pub.dev/packages/cli_progress_bar)
**Languages:**
[](README.md)
[](README.ru.md)- [About package](#about-package)
- [Example](#example)
- [How to use](#how-to-use)# About package
The package provides the ability to output the progress bar to the terminal, change its appearance and change the degree of progress in it.
# Example


# How to use
The progress bar consists of 3 main parts:
- `before`. Arbitrary user content. In the scheme, it is marked with the `#before` tag. If it is null, then nothing will be output instead of the `#before` tag;
- `bar`. In the scheme, it is marked with the `#bar` tag, instead of the tag, the progress bar itself will be output;
- `after`. Arbitrary user content. In the scheme, it is marked with the `#after` tag. If null, then nothing will be output instead of the `#after` tag.When creating progress bar, you must specify the scheme. The scheme uses tags to indicate the places where the content will be displayed.
Example of the scheme: '#before #bar #after'. Instead of the `#before` tag, the before content will be output, instead of the `#after` tag, the after content will be output, instead of the `#bar` tag, the progress bar itself will be output.
Example of creating and launching progress bar, increasing its fullness:
```dart
final schema = '#before [#bar] #after';final max = 100;
final bar = ProgressBar(
schema: schema,
before: 'Progress',
after: '0/$max',
settings: ProgressBarSettings(
max: max,
size: 100 * 0.1,
),
);bar.update();
bar.setProgress(10);
bar.update();
```You can change the appearance and settings of your progress bar using `ProgressBarSettings`:
- `max`. Maximum progress;
- `size`. The size of the progress bar in characters;
- `filled`. The symbol of the filled part;
- `notFilled`. Blank part symbol;
- `edge`. The symbol of the extreme character of the filled part.