ansi_wrap 0.1.1 ansi_wrap: ^0.1.1 copied to clipboard
Wordwrap a string with ANSI escape codes.
ansi_wrap #
Wordwrap a string with ANSI escape codes
Install #
$ dart pub add ansi_wrap
Usage #
import 'package:ansi/ansi.dart';
import 'package:ansi_wrap/ansi_wrap.dart';
void main() {
final input = 'The quick brown ${ansi.red('fox jumped over ')}the lazy ${ansi.green('dog and then ran away with the unicorn.')}';
print(wrapAnsi(input, 20));
}