搜索插件、代码仓与 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 转义码
  • 不适用于用户界面渲染
  • 需要手动配置主题

原始 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 项

源码仓库

使用此插件的项目