v2.1.0 — Flutter, and any bare surface
A sixth native platform — Flutter — and the raw-raster primitive that drives any bare surface: a Raspberry Pi framebuffer, an SDL2 window, a GPU texture. Additive; existing platforms and output are unchanged.
Flutter
flutter/mermaidkit renders all 30 types with a Dart CustomPainter on Flutter's Skia/Impeller canvas — a fidelity match for Android, and one plugin reaches iOS, Android, web, and desktop.
final scene = MermaidNative.scene("flowchart LR\n A[Start] --> B[End]"); // dart:ffi → Swift core
CustomPaint(painter: MermaidPainter(scene!));- A
SceneWireDart model (sealed classes + atypediscriminator) +MermaidPainter/MermaidDiagram. - A
dart:ffibridge (MermaidNative) overmmk_scene_jsonin the Swift core built as a shared library — the Flutter analogue of Android's JNI and .NET's P/Invoke, calling the@_cdeclC ABI directly. - Optional
fontFamilyfor bundled/custom label fonts.
Any bare surface
MermaidRenderer.rgbaRaster — previously Apple-only — now returns raw RGBA on Linux too (reading the Cairo/Silica image surface directly). This is the primitive every display-server-free surface needs.
tools/pi-canvas is an infinite, pannable canvas of diagrams composited into a 640×480 framebuffer, with a single Framebuffer seam and three backends — a PNG stand-in, /dev/fb0 (RGB565), and SDL2 — verified on the Pi's aarch64 architecture.
Full detail in CHANGELOG.md; platform notes under flutter/ and tools/pi-canvas.