highlighting 0.8.1+11.7.0 highlighting: ^0.8.1+11.7.0 copied to clipboard
Syntax highlighting for Dart with lots of languages and themes support.
import 'package:highlighting/highlighting.dart';
import 'package:highlighting/languages/dart.dart';
void main() {
final source = '''main() {
print('Highlighting by Akvelon.');
}
''';
highlight.registerLanguage('dart', dart);
final highlighted = highlight.parse(source, language: 'dart');
final html = highlighted.toHtml();
print(html); // HTML string
}