isSupported property

bool get isSupported

returns true if stdout supports ansi escape characters.

Implementation

static bool get isSupported {
  if (_emitAnsi == null) {
    // We don't trust [stdout.supportsAnsiEscapes] except on Windows.
    // [stdout] relies on the TERM environment variable
    // which generates false negatives.
    if (!Platform.isWindows) {
      _emitAnsi = true;
    } else {
      _emitAnsi = stdout.supportsAnsiEscapes;
    }
  }
  return _emitAnsi!;
}
set isSupported (bool emit)

You can set isSupported to override the detected ansi settings. Dart doesn't do a great job of correctly detecting ansi support so this give a way to override it. If isSupported is true then escape charaters are emmitted If isSupported is false escape characters are not emmited By default the detected setting is used. After setting emitAnsi you can reset back to the default detected by calling resetEmitAnsi.

Implementation

static set isSupported(bool emit) => _emitAnsi = emit;