AnsiSpan class

A run of text that shares one SGR state.

Deliberately expressed in SGR numbers and flags rather than in a renderer's colour type: the parser lives in the model layer, where a service's output is stored raw, and the mapping to whatever is painting belongs to whatever is painting.

Constructors

AnsiSpan(String text, {int? color, bool bold = false, bool dim = false})
const

Properties

bold bool
final
color int?
The foreground SGR number in effect — 30-37 or 90-97 — or null for the terminal's default.
final
dim bool
SGR 2. Kept separate from color because it is a modifier: a dim red is still red, and a renderer with no dim of its own needs to know which of the two it is dropping.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The visible characters. Never contains an escape sequence.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override