Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shan-shaji/chalkdart

Chalk package helps to style your terminal strings🎨.
https://github.com/shan-shaji/chalkdart

ansi-escape-codes ansi-escape-sequences chalk chalk-dart chalkdart cli dart dart-cli hacktoberfest-accepted

Last synced: 9 days ago
JSON representation

Chalk package helps to style your terminal strings🎨.

Awesome Lists containing this project

README

        



Style your terminal strings🎨

----

This is a feature clone of the awesome [Chalk](https://github.com/chalk/chalk) (JavaScript) library.

All credits go to [Sindre Sorhus](https://github.com/sindresorhus).

[![Build Status](https://www.travis-ci.com/shan-shaji/chalkdart.svg?branch=main)](https://www.travis-ci.com/shan-shaji/chalkdart)

## Highlights

- Expressive API
- Highly performant
- Ability to nest styles
- Clean and focused

## Install

With dart:

```dart
$ dart pub add chalk
```
With Flutter:

```dart
$ flutter pub add chalk
```
Chalk comes with an easy to use API where you just chain the styles you want.

```dart

// Specify font face by using [ftFace] property
print(chalk.blue('blue text', ftFace: ChalkFtFace.italic));
print(chalk.red('red Text', ftFace: ChalkFtFace.bold));

// Chain styles
print(chalk.faint('faint text').blue());
print(chalk.cyan('cyan').bold());

// Not widely supported
print(chalk.yellow('yellow').underLined());
print(chalk.yellow('yellow').strikeThrough());

// Combine styled and normal strings
print('chain text'.green() + ' Normal Text ' + 'chain text2'.red());
print('\n');
```