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
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.
Works with
Packages commonly used together with ansi_styles: ones it builds on, ones built on it, and its own family.
- melosBuilt on ansi_stylesA tool for managing Dart and Flutter monorepos with script execution, versioning, and publishing.
- patrol_cliBuilt on ansi_stylesCommand-line tool to run and debug Patrol UI tests on multiple platforms
- flutterfire_cliBuilt on ansi_stylesCLI to configure Firebase services in Flutter projects
- dacoBuilt on ansi_stylesA tool for maintaining Dart documentation comments and formatting embedded code examples.