搜索插件、代码仓与 APP 分类

console_bars 封面
插件详情v1.3.0

console_bars

一个用于在控制台中轻松创建可自定义进度条的包。

AndroidiOSmacOSWindowsLinux
近 30 天下载
1.1万
喜欢数
33
Pub 分数
160

安装插件

flutter pub add console_bars

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

console_bars 是一个专为 Flutter/Dart 设计的包,用于在控制台中创建可自定义的进度条。它提供了一个易于使用的 API,可在命令行应用程序中显示实时进度指示器,非常适合 CLI 工具、脚本或任何需要视觉反馈的基于控制台的工作流程。该包支持 Android、iOS、macOS、Windows 和 Linux 多个平台,确保广泛的兼容性。通过简单的配置选项,开发者可以根据需求定制进度条的外观和行为。

适合场景

  • CLI 工具进度跟踪
  • 脚本执行监控
  • 基于控制台的数据处理
  • 命令行应用程序反馈
  • 批量操作可视化

主要特点

  • 易于使用的 API
  • 可自定义外观
  • 实时进度更新
  • 多平台支持
  • 与 Flutter/Dart 的简单集成

适合对象

  • 开发 CLI 工具的开发者
  • 需要控制台进度指示器的用户
  • 基于终端的工作流项目
  • Dart/Flutter 应用程序带有控制台输出
  • 脚本编写和自动化任务

使用建议

  • 需要控制台环境
  • 仅限文本界面
  • 不适用于GUI应用程序
  • 并非所有终端类型都能正确渲染
  • 依赖于平台特定的控制台功能

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Pub Version (including pre-releases) GitHub last commit GitHub language count GitHub top language

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

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:

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

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.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。