搜尋套件、儲存庫與 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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。