Skip to content
pubscout

ansi_styles

0.3.2+1, released 5 years ago by invertase.io

ANSI escape codes for styling strings in the terminal.

WASM-readyRepository archived
$ flutter pub add ansi_styles
Source repository

What it does

Provides utilities and string extension methods to create colorful terminal output using ANSI escape codes. Allows chaining formatting properties such as colors, bold, italic, underline, and RGB values.

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

Use it when

  • You need to output colored and styled text in command-line or terminal applications.
  • You want to strip ANSI styling from strings.

Skip it when

  • You are building a graphical user interface (GUI) or Flutter app where terminal text styling is not applicable.

Strengths

  • Simple API with method chaining and string extension support.
  • Supports standard colors, bright variants, RGB, and background formatting.

Weaknesses

  • Limited only to terminal environments.
  • Not documented for non-terminal UI applications.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

none

import 'package:ansi_styles/ansi_styles.dart';

void main() {
  print(AnsiStyles.red.underline('Underlined red text'));
}

Alternatives

Packages that do the same job and could replace ansi_styles.

  • console

    Alternative library for console and terminal manipulation utilities.

Works with

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