ansi_styles 0.1.0 copy "ansi_styles: ^0.1.0" to clipboard
ansi_styles: ^0.1.0 copied to clipboard

outdated

ANSI escape codes for styling strings in the terminal.

AnsiStyle #

A Dart package for creating ansi styled text within io environments.

Usage #

Import the package:

import 'package:ansi_styles/ansi_styles.dart';

Use the AnsiStyle export to created styled text by chaining properties. For example, if using a Logger:

logger.stdout(AnsiStyles.red.underline('Underlined red text'));
logger.stdout(AnsiStyles.inverse.italic.green('Inversed italic green text'));
logger.stdout(AnsiStyles.cyan('Cyan text'));
logger.stdout(AnsiStyles.bgYellowBright.bold('Bold text with a yellow background'));
logger.stdout(AnsiStyles.bold.rgb(255,192,203)('Bold pink text'));
logger.stdout(AnsiStyles.strikethrough.bgRgb(255,165,0)('Strikethough text with an orange background'));

To remove any ansi styling from text, call the strip() method:

String styledText = AnsiStyles.red.underline('Underlined red text');
String cleanText = AnsiStyles.strip(styledText);

License #


Built and maintained with 💛 by Invertase.

Chat on Discord Follow on Twitter


11
likes
0
pub points
82%
popularity

Publisher

verified publisherinvertase.io

ANSI escape codes for styling strings in the terminal.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on ansi_styles