codeSyntaxDecorationPrefix top-level constant

String const codeSyntaxDecorationPrefix

Syntax highlighter that converts code to ANSI-styled terminal output.

Uses the highlight.dart package for parsing and artisanal's Style system for rendering.

final highlighter = SyntaxHighlighter(theme: ChromaTheme.dark);
final highlighted = highlighter.highlight(
  'void main() { print("Hello"); }',
  language: 'dart',
);
print(highlighted);

Implementation

const String codeSyntaxDecorationPrefix = 'syntax';