val_highlight
0.1.1, released 5 weeks ago by useval.io
Syntax highlighter in pure Dart for 55 languages, themes, incremental updates, and HTML output.
WASM-ready
What it does
Provides syntax highlighting for 55 languages in pure Dart with no native code, WebView, or JavaScript dependencies. Includes incremental updates, pre-built themes, VS Code theme import, and HTML output for text rendering.
AI-written summary of version 0.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to highlight code snippets or render syntax-highlighted code in pure Dart across any platform.
- You want incremental updates for a code editor experience.
- You want to import VS Code themes into a Dart application.
Skip it when
- You are looking for pre-built Flutter code editor widgets like CodeView or CodeField (use val_highlight_flutter instead).
Strengths
- Pure Dart with no native or JS dependencies, running on every platform.
- Incremental updating designed for editors, scanning only affected lines.
- Supports 55 languages and includes VS Code theme import.
- Fast linear-time performance.
Weaknesses
- Does not include Flutter-specific widgets out of the box (requires val_highlight_flutter for that).
- Writing custom grammars from scratch can be complex.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:val_highlight/val_highlight.dart';
import 'package:val_highlight/languages/dart.dart';
final html = const Highlighter().toHtml(source, language: dartLanguage);Alternatives
Packages that do the same job and could replace val_highlight.
- flutter_highlighter
Syntax highlighting widget for Flutter with multiple languages and themes.
50Compare - xdg_icons
XDG theme icons for Flutter.
62Compare
Works with
Packages commonly used together with val_highlight: ones it builds on, ones built on it, and its own family.
- val_latexSame familyLaTeX math parser and layout engine in pure Dart with OpenType fonts.
- val_latex_flutterSame familyRender LaTeX math formulas, inline math, and Markdown with math in Flutter.
- gpt_markdownBuilt on val_highlightPowerful Flutter Markdown and LaTeX renderer built for AI streaming outputs.
- val_highlight_flutterBuilt on val_highlightFlutter widgets for displaying and editing syntax-highlighted code.