cli_progress_bar 1.0.4
cli_progress_bar: ^1.0.4 copied to clipboard
Package for creating cli progress bar, customizing it.
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#beforetag. If it is null, then nothing will be output instead of the#beforetag;bar. In the scheme, it is marked with the#bartag, instead of the tag, the progress bar itself will be output;after. Arbitrary user content. In the scheme, it is marked with the#aftertag. If null, then nothing will be output instead of the#aftertag.
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:
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.