SyntaxHighlighter class

Constructors

SyntaxHighlighter({ChromaTheme? theme})
Creates a syntax highlighter with the given theme.
SyntaxHighlighter.adaptive({AdaptiveChromaTheme? adaptiveTheme, bool hasDarkBackground = true})
Creates a syntax highlighter that adapts to terminal background.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
theme ChromaTheme
The color theme to use for highlighting.
final

Methods

decorationStyles({String prefix = codeSyntaxDecorationPrefix}) Map<String, Style>
Returns decoration styles keyed for use with editable code overlays.
highlightCode(String code, {String? language}) String
Highlights code and returns ANSI-styled output.
highlightSpans(String code, {String? language}) List<SyntaxHighlightSpan>
Highlights code and returns grapheme-aware decoration spans.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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