flutter_tex_js
7.0.0, released 3 months ago by madlon-kay.com
Render TeX to PNG using KaTeX in a native WebView
What it does
This plugin renders TeX markup to a PNG image via a lightweight native WebView and displays it as an image widget. It uses KaTeX for rendering and supports Android and iOS platforms.
AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display mathematical expressions in a Flutter app
- You want a lightweight solution without pulling in the full webview_flutter dependency
- You target Android 4.1+ and iOS 11+
- You prefer PNG output for consistent sizing
Skip it when
- You need support for iOS 9 or 10
- You are using a Flutter version older than 3.47
- You require dynamic HTML/CSS rendering instead of PNG
Strengths
- Lightweight – only a single native WebView is used
- Fast rendering via KaTeX
- Supports both Android and iOS
- No heavy dependencies
Weaknesses
- Requires Flutter 3.47/Dart 3.13 or newer
- iOS 11+ required for rendering
- Limited to PNG output (no vector)
- No support for older Flutter versions
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
import 'package:flutter_tex_js/flutter_tex_js.dart';
class MyMathWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return TexImage(r'a=\pm\sqrt{b^2+c^2} \int_\infty^\beta d\gamma');
}
}Alternatives
Packages that do the same job and could replace flutter_tex_js.
- flutter_tex
Renders mathematical and chemical equations using LaTeX, TeX, MathML, and AsciiMath.
83Compare - val_latex
LaTeX math parser and layout engine in pure Dart with OpenType fonts.
78Compare - val_latex_flutter
Render LaTeX math formulas, inline math, and Markdown with math in Flutter.
78Compare - reorderable_grid_view
A reorderable grid view widget for Flutter supporting drag-and-drop reordering.
50Compare
Works with
Packages commonly used together with flutter_tex_js: ones it builds on, ones built on it, and its own family.