toEscapedString method

  1. @override
  2. @nonVirtual
String toEscapedString(
  1. {bool verbose = false}
)
override

Returns the string representation of this sequence.

If verbose is true, parameters that are otherwise default are still included in the string, i.e. [1;1m instead of [m, for readability.

Implementation

@override
@nonVirtual
String toEscapedString({bool verbose = false}) {
  var sequence = this;
  if (!verbose) {
    sequence = sequence.toTerse();
  }
  final params = sequence.parameters.join(';');
  return '\x1B[$prefix$params${sequence.finalChars}';
}