cli_progress_bar 1.0.4 copy "cli_progress_bar: ^1.0.4" to clipboard
cli_progress_bar: ^1.0.4 copied to clipboard

discontinued

Package for creating cli progress bar, customizing it.

example/README.md

pub package

Languages:

English Russian

Example of creating progress bar:

import 'dart:async';

import 'package:cli_progress_bar/cli_progress_bar.dart';

void main() {
  final schema = '#before [#bar] #after';

  final max = 200;

  final bar = ProgressBar(
    schema: schema,
    before: 'Progress',
    after: '0/$max',
    settings: ProgressBarSettings(
      max: max,
      size: 20,
    ),
  );

   bar.update();

  var progress = 0;

  Timer.periodic(Duration(seconds: 1), (timer) {
    progress += 10;

    if (progress > max) {
      timer.cancel();

      return;
    }

    bar.setProgress(progress);

    bar.setAfter('$progress/$max');

    bar.update();
  });
}

Example of creating custom progress bar:

import 'dart:async';

import 'package:cli_progress_bar/cli_progress_bar.dart';

void main() {
  final schema = '#before | #bar | #after';

  final max = 400;

  final bar = ProgressBar(
    schema: schema,
    before: 'Custom progress bar',
    after: 'progress 0/$max',
    settings: ProgressBarSettings(
      max: max,
      size: 40,
      filled: '0',
      notFilled: '.',
      edge: '>',
    ),
  );

  bar.update();

  var progress = 0;

  Timer.periodic(Duration(seconds: 1), (timer) {
    progress += 40;

    if (progress > max) {
      timer.cancel();

      return;
    }

    bar.setProgress(progress);

    bar.setAfter('$progress/$max');

    bar.update();
  });
}
1
likes
140
points
24
downloads

Publisher

verified publisherbatykov-gleb.ru

Weekly Downloads

Package for creating cli progress bar, customizing it.

Repository (GitHub)
View/report issues

Topics

#cli #progress #bar

Documentation

API reference

License

MIT (license)

Dependencies

dart_console

More

Packages that depend on cli_progress_bar