ConsoleTagParser class
Parser for console-style tags.
Converts tagged text into a tree of TagSegments, which can then be rendered to ANSI-styled output.
Constructors
- ConsoleTagParser({ColorProfile colorProfile = ColorProfile.trueColor, bool hasDarkBackground = true})
- Creates a new console tag parser with default named styles.
Properties
- colorProfile → ColorProfile
-
The color profile used for rendering.
no setter
- hasDarkBackground → bool
-
Whether the terminal has a dark background.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
styleNames
→ Iterable<
String> -
Returns all registered style names.
no setter
Methods
-
getStyle(
String name) → Style? - Gets a registered named style, or null if not found.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String text) → List< TagSegment> - Parses tagged text into a list of segments.
-
registerStyle(
String name, Style style) → void -
Registers a named style that can be used with
<name>...</name>syntax. -
render(
String text) → String - Parses tagged text and renders it with ANSI escape codes.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterStyle(
String name) → void - Removes a named style.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited