withAnsiStyleCode method

String withAnsiStyleCode(
  1. int? code
)

Adds the ANSI escape code to the string.

Implementation

String withAnsiStyleCode(int? code) {
  if (code == null) return this;
  return '\u001b[${code}m$this\u001b[0m';
}