搜尋套件、儲存庫與 APP 分類

cli_spin 封面
套件詳情v1.0.1

cli_spin

一個 Dart 套件,透過為同步和非同步操作顯示優雅的終端機旋轉進度指示器來增強使用者體驗。

AndroidiOSmacOSWindowsLinux
近 30 天下載
9850
喜歡數
33
Pub 分數
150

安裝套件

flutter pub add cli_spin

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

cli_spin 是一個 Dart 套件,旨在透過在同步和非同步操作期間顯示流暢的動畫旋轉圖示來改善終端使用者體驗。它可無縫整合至 CLI 應用程式中,為使用者提供處理任務時的視覺反饋。該旋轉圖示支援 Android、iOS、macOS、Windows 和 Linux 等多個平台,確保在不同環境中行為一致。透過 `flutter pub add cli_spin` 即可輕鬆設定,開發者可為其命令列工具增添專業外觀的進度指示器。此套件輕量且專注於簡潔與可靠性。

適用情境

  • 在CLI工具中顯示進度
  • 增強異步操作期間的使用者回饋
  • 改善命令列腳本中的使用者體驗
  • 為長時間執行的任務提供視覺提示
  • 在控制台應用程式中整合流暢的旋轉進度條

主要特色

  • 支援同步和非同步作業
  • 跨平台相容性
  • 最小 API 表面
  • 流暢的終端旋轉動畫
  • 與 Flutter CLI 應用的輕鬆整合

適合對象

  • CLI 開發者
  • 命令列工具創建者
  • Flutter 開發人員建構主控台工具
  • 尋求簡單進度指示器的使用者
  • 需要輕量級終端使用者體驗增強的專案

使用建議

  • 僅限終端基礎輸出
  • 無自定義旋轉樣式
  • 不支援非終端環境
  • 需要手動控制旋轉器生命週期
  • 依賴於平台特定的終端功能

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

A Dart package that enhances the user experience by displaying a sleek terminal spinner for both sync and async operations.

preview

Features

  • 80+ predefined spinners accessible via CliSpinners
  • Easily change color of spinners and/or text with use of CliSpinnerColor helper
  • Define your own character sets (frames) and intervals for your custom spinners
  • Custom spinner text (w/ separate suffix and prefix options)
  • Start/stop methods
  • Stop and persist the spinner with custom text and symbol
  • Predefiend success, fail, warn and info methods (cross-platform compatible)

Getting started

TODO: List prerequisites and provide or point to information on how to start using the package.

Usage example

import 'dart:async';
import 'package:cli_spin/cli_spin.dart';

void main() {
  // Instantiate spinner
  final spinner = CliSpin(
    text: 'Loading data...',
    spinner: CliSpinners.line,
  ).start(); // Chaining methods

  Timer(Duration(milliseconds: 1000), () {
    // Change spinner color
    spinner.color = CliSpinnerColor.yellow; 
    
    // Change spinner text
    spinner.text = 'Still loading, please wait...';

    Timer(Duration(milliseconds: 1000), () {
      // Alias for `stopAndPersist(...)` method
      spinner.success('Data loaded successfully.');
    });
  });
}

Additional information

Inspired by the ora library written in Javascript.

所屬分類

依賴

依賴清單 2 項

  • ansi_strip^0.1.1+1
  • string_width^0.1.5

原始碼儲存庫

使用此套件的專案

暫無相關資料。