Skip to content
pubscout

chalkdart

3.1.0, released 9 months ago by hiveright.tech

Console and logging text coloring and styling library using ANSI and HTML modes.

$ flutter pub add chalkdart
Source repository

What it does

Provides an expressive, chainable API for coloring and styling text in the terminal or console using ANSI codes. It also supports switching to HTML output mode for sending styled logs to a server or browser.

AI-written summary of version 3.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want colorful, styled logs in the console or terminal during debugging.
  • You need to output styled text that can be viewed both in ANSI terminals and as HTML in a browser.

Skip it when

  • You require zero-allocation styling libraries for performance-critical hot paths (where quectocolors is recommended instead).
  • You do not need text styling or logging enhancements.

Strengths

  • Supports full ANSI and HTML output modes with seamless switching.
  • Allows deep nesting of colors and styles.
  • Includes optional string extensions for concise usage.

Weaknesses

  • Adds overhead compared to ultra-lightweight zero-allocation alternatives.
  • Relies on terminal or IDE support for ANSI rendering (though companion extensions exist for XCode/VSCode).

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

No native dependencies or build_runner required; just add to pubspec.

import 'package:chalkdart/chalk.dart';

print(chalk.yellow.onBlue('Hello world!'));

Alternatives

Packages that do the same job and could replace chalkdart.

Works with

Packages commonly used together with chalkdart: ones it builds on, ones built on it, and its own family.