Skip to content
pubscout

ansi_escapes

2.0.1, released 11 months ago by an unverified publisher

ANSI escape codes for terminal manipulation

$ flutter pub add ansi_escapes
Source repository

What it does

Provides functions to move the cursor, clear lines, scroll, and output control sequences in a terminal. It exposes a simple API that returns the escape strings for common terminal actions.

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

Use it when

  • You need to control cursor position or clear parts of the terminal output
  • You want to create clickable links or beeps in a CLI
  • You need to programmatically format terminal output without external dependencies

Skip it when

  • You are building a GUI or mobile app that does not use a terminal
  • You need advanced terminal features like color or styling beyond basic control sequences

Strengths

  • No external dependencies
  • Cross‑platform support (Android, iOS, Windows, macOS, Linux)
  • Small and focused API

Weaknesses

  • Only useful in terminal environments
  • No built‑in color or styling support
  • API changes in 2.0.0 may break existing code

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:ansi_escapes/ansi_escapes.dart';

stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);

Alternatives

Packages that do the same job and could replace ansi_escapes.

  • io

    Utilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.

  • dart_style

    Provides an API and CLI to format Dart source code automatically.

  • ansix

    Provides ANSI color, text styling, grid, and tree view tools for Dart and Flutter.

  • ansi_styles

    ANSI escape codes for styling strings in the terminal.

Works with

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