Skip to content

v2.1.0 — Flutter, and any bare surface

Choose a tag to compare

@clintecker clintecker released this 21 Jul 03:56
· 12 commits to main since this release
fb7abdd

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 SceneWire Dart model (sealed classes + a type discriminator) + MermaidPainter / MermaidDiagram.
  • A dart:ffi bridge (MermaidNative) over mmk_scene_json in the Swift core built as a shared library — the Flutter analogue of Android's JNI and .NET's P/Invoke, calling the @_cdecl C ABI directly.
  • Optional fontFamily for 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.