ansix 0.0.9-prerelease copy "ansix: ^0.0.9-prerelease" to clipboard
ansix: ^0.0.9-prerelease copied to clipboard

AnsiX is a powerful and easy-to-use library that provides tools and extensions for adding ANSI color and styling support to your Dart & Flutter applications.

example/main.dart

// ignore_for_file: avoid_print

import 'package:ansix/ansix.dart';

void main() {
  // Ensure that the attached terminal supports ANSI formatting
  AnsiX.ensureSupportsAnsi();

  // String extensions
  print('This is a bold text'.bold());
  print('This is a text with red foreground color'.red());

  // StringBuffer extensions
  print(StringBuffer()
    ..writeWithForegroundColor('Hello ', AnsiColor.blue)
    ..writeStyled(
      'AnsiX ',
      textStyle: const AnsiTextStyle(bold: true),
      foregroundColor: AnsiColor.aquamarine2,
    )
    ..writeWithForegroundColor('!', AnsiColor.fuchsia)
    ..writeWithForegroundColor('!', AnsiColor.red1)
    ..writeWithForegroundColor('!', AnsiColor.darkOrange3)
    ..toString());
}
14
likes
0
pub points
83%
popularity

Publisher

verified publishernikosportolos.com

AnsiX is a powerful and easy-to-use library that provides tools and extensions for adding ANSI color and styling support to your Dart & Flutter applications.

Repository (GitHub)
View/report issues

Topics

#ansi #cli #console #style #color

Documentation

Documentation

License

unknown (license)

Dependencies

collection, data_class_plugin, meta, path

More

Packages that depend on ansix