Skip to content
pubscout

ansi

0.4.2, released 3 years ago by an unverified publisher

Terminal string styling with builtin style functions and string extensions.

$ flutter pub add ansi
Source repository

What it does

Allows developers to easily color and style terminal strings using functions or string extensions. Supports combining styled and normal strings for console output.

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

Use it when

  • You are building a Dart command-line application and want colored terminal output.
  • You want simple string extensions to quickly apply ANSI styles.

Skip it when

  • You are building a Flutter GUI application where terminal formatting is not visible.
  • You need complex UI widget libraries.

Strengths

  • Simple API with both functional and extension-based styling methods.
  • Supports running in tests.
  • No external dependencies.

Weaknesses

  • Limited only to terminal string styling.
  • Not applicable for Flutter UI rendering.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

Add package via 'dart pub add ansi' and import it in your Dart code.

import 'package:ansi/ansi.dart';

void main() {
  print(blue('Hello world!'));
  print('extension method on String'.cyan());
}

Alternatives

Packages that do the same job and could replace ansi.

  • console

    Another option for terminal text styling and manipulation in Dart.

Works with

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