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

rich_console 封面
套件詳情v1.0.7+2

rich_console

豐富您的除錯、主控台程式或分析回饋 - 在主控台中列印顏色和樣式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
109
喜歡數
6
Pub 分數
120

安裝套件

flutter pub add rich_console

套件介紹

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

rich_console 是一個 Flutter/Dart 套件,透過在基於終端的應用程式中啟用彩色文字和樣式來增強控制台輸出。它允許開發者透過可自訂的顏色、字型和格式化方式,為除錯訊息、記錄和執行時反饋增加視覺清晰度。適用於命令列工具、除錯器或分析實用程式,可在多個平台上提升可讀性和使用者體驗。此套件可無縫整合至 Flutter 專案中,並支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

適用情境

  • 除錯 CLI 工具
  • 增強日誌可讀性
  • 互動式控制台應用程式
  • 即時反饋系統
  • 測試和開發工作流程
  • 在終端中可視化資料

主要特色

  • 彩色控制台輸出
  • 文字樣式(粗體、斜體、底線)
  • 跨平台相容性
  • 簡單的 API 結合
  • 可自訂主題
  • 終端友善的格式化

適合對象

  • 開發 CLI 應用的開發者
  • 團隊提升除錯可見性
  • 教育或教程工具
  • 終端中的數據可視化
  • 開發環境中的日誌增強

使用建議

  • 僅限控制台輸出
  • 可能無法在所有終端模擬器中運作
  • 不支援非終端環境
  • 依賴於平台特定的 ANSI 轉義碼
  • 不適用於UI渲染
  • 需要手動設定主題

原始 README

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

pub package

A natural way of printing text styles and colors in flutter/dart.

This packages contains a set of configurations that make it easy to differentiate console outputs and print all sort of colors. It's multi-IDE compatible as it is based on the basic ANSI escape codes. Note that there might be parameters and features that your IDE doesn't support. You will notice this simply that no effect is applied to you text.

Features

Usage

import 'package:rich_console/rich_console.dart';

void main(){
  
  // * Reusable styles
  final yourReusableStyle = RichStyle(italic: true, foreground: Colors.pinkAccent);
  printRich("Your Text", style: yourReusableStyle);
  printRich("Another Text", style: yourReusableStyle.copyWith(framed: true));
  
  // * Simple prints
  printRich("Background", background: Colors.green);
  printRich("Foreground", foreground: Colors.blue);
  printRich("Italic", italic: true);
  printRich("Bold", bold: true);
  printRich("Underline", underline: true);
  printRich("Invert",
      foreground: Colors.blue, background: Colors.green, invert: true);
  printRich("Strike", strike: true);
  printRich("DoubleUnderline", doubleUnderline: true);
  printRich("Framed", framed: true);
  printRich("Encircled", encircled: true);
}

Additional Information

Functions
  • printRich()

  • printError()

  • printWarning()

Settable Parameters
  • Foreground
  • Background
  • Bold
  • Italic
  • Bold
  • Underline
  • SlowBlink
  • RapidBlink
  • Invert
  • Conceal
  • Strike
  • Gothic
  • DoubleUnderline
  • Framed
  • Encircled
  • Overlined
  • UnderlineColor

Contributions

Please feel welcome add anything that is missing. Simply create a pull request. Especially, ff you are familiar with obtaining text input from the console please make sure to add such features to this package.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案