Skip to main content

mermaid_flutter 0.7.0 copy "mermaid_flutter: ^0.7.0" to clipboard
mermaid_flutter: ^0.7.0 copied to clipboard

Native Flutter renderer for mermaid_core: TextPainter text measurement and a CustomPainter that paints the mermaid render scene directly. 28 diagram types.

0.7.0 #

  • Require mermaid_core 0.7.0.
  • Breaking: diagrams follow the mermaid.js 12 defaults (see the mermaid_core changelog): the redux-color theme and neo look for flowchart, class, ER, requirement, sequence, state and venn diagrams, and ELK layouts. The theme parameter of MermaidDiagram and MermaidView is nullable; null follows these defaults.
  • MermaidDiagram, MermaidView and renderToPng take appearance and layout: MermaidAppearance.classic and MermaidLayout.dagre keep the mermaid.js 11 output.
  • Bundle the Recursive font (SIL Open Font License 1.1) that the redux-color theme uses, and paint drop shadows.
  • The fullscreen popup of MermaidView uses the view's appearance and layout. Before, it always used MermaidAppearance.standard and MermaidLayout.standard.
  • Breaking: rename MermaidViewController.focusNode to centerOnNode, MermaidViewController.fitAll to fit and MermaidView.padding to fitPadding.
  • package:mermaid_flutter/mermaid_flutter.dart exports the mermaid_core types that the widget and PNG API takes: MermaidTheme, MermaidAppearance, MermaidLayout, RenderScene, MermaidParseException, FlowNodePaintOverride and FlowLinkPaintOverride. An import of mermaid_core is necessary only for other core API, for example Color.
  • Breaking: follow the mermaid_core renames of the render scene types: Fill → SceneFill, Stroke → SceneStroke, TextAlignH → SceneTextAlign and TextStyleSpec → SceneTextStyle. textStyleFromSpec and FlutterTextMeasurer.measure take a core.SceneTextStyle.
  • Breaking: fontWeightFromCss, kMermaidTextHeightFactor, dashPath and parseCssFontFamily are no longer exported. They were internal helpers of the text measurer and the scene painter.
  • Add the typedefs MermaidErrorWidgetBuilder, MermaidNodeTapCallback and MermaidEdgeTapCallback. MermaidDiagram and MermaidView use them for errorBuilder, onNodeTap and onEdgeTap; the function types do not change.
  • MermaidDiagram paints the scene background once, with ScenePainter. Before, a second box painted it again, so a translucent theme background showed darker than its alpha. Opaque and transparent backgrounds do not change.

0.6.0 #

  • Require mermaid_core 0.6.0. Breaking: state diagram and mindmap layouts change (see the mermaid_core changelog): composite states that no transition crosses are laid out as one box, and mindmaps use a force-directed layout without overlaps. The widgets and their parameters did not change.
  • Fixes found with 57 real-world diagrams, among them a flowchart crash on edges to a subgraph nested in a direction subgraph, style/class on subgraphs, gantt charts in seconds, and architecture icons with :.
  • themeVariables.background no longer recolours the canvas behind the diagram.

0.5.0 #

  • Require mermaid_core 0.5.0. Breaking: the output of ELK layouts changes for flowcharts with layout: elk and for state diagrams with a nested composite state (see the mermaid_core changelog). The widgets and their parameters did not change.
  • ELK flowcharts paint rounded edge bends and line hops.
  • Flowchart edges into a subgraph no longer kink above its border, and labels break at </br> as in mermaid.js 12.

0.4.0 #

  • Require mermaid_core 0.4.0. Breaking for code that reads the diagram models: labels are LabelText, no longer String (see the mermaid_core changelog). The widgets and their parameters did not change.
  • Labels show entity codes as characters, as mermaid.js does: #quot;, #lt;, #35;, #9829; and the HTML forms &lt;, &#35;, &#x23;.

0.3.2 #

  • Require mermaid_core 0.3.2: subgraph members stay inside their subgraph box, <b>/<i> in labels render as bold and italic text in the diagrams that mermaid.js renders as HTML, and state names are painted at normal weight.

0.3.1 #

  • Require mermaid_core 0.3.1: about 9x faster rendering of large flowcharts, and fixes for crashes on class self relations and on edges to empty subgraphs.

0.3.0 #

  • Expose MermaidView.onSceneChanged, including fullscreen views, while retaining the existing geometry-only notification behavior for paint overrides.

  • Require mermaid_core 0.3.0 for the configuration and layout fixes.

0.2.1 #

  • Add rendered diagram examples to the README.

0.2.0 #

Behavior changes

  • onNodeTap now fires only for diagram nodes (SceneGroupRole.node). Sequence frames, class namespaces, composite states, C4 boundaries, journey sections, and pie legend entries are no longer tap targets.
  • Requires mermaid_core 0.2.0.

Changes

  • Preserve requested monospace fonts and add platform symbol-font fallbacks for Unicode diagram labels.
  • Add MermaidViewController with observable transforms, animated or immediate fit, and focus-by-node-id support.
  • Add MermaidDiagram.onSceneChanged for access to post-layout scene geometry.
  • Add onEdgeTap to MermaidDiagram and MermaidView, with precise stroke and label hit testing and stable Mermaid link indices.
  • Add paint-only flowchart node and link overrides to MermaidDiagram and MermaidView; override changes reuse the parsed and laid-out base scene.
  • Add desktop/web node hover callbacks, node-only cursors, and optional tooltip overlays to MermaidDiagram and MermaidView.
  • Add opt-in node semantics with human labels, stable identifiers, transformed bounds, deterministic traversal, and accessible tap actions.
  • Add headless renderToPng and renderSceneToPng APIs for Flutter runners.
  • Add MaterialMermaidTheme.fromTheme and fromColorScheme to map Material colors and text roles to a light or dark MermaidTheme.
  • Render gradient strokes and multiply-composited links consistently in ScenePainter and headless PNG output.
  • Keep node, edge, hover, semantics, and scene callbacks working when paint-only overrides change.
  • The built-in fullscreen popup uses the view's own padding, zoomStep, panStep, and showControls instead of falling back to the defaults.
  • Refresh the pub.dev screenshots for the corrected layouts.

0.1.2 #

  • Update mermaid_core to 0.1.2 for corrected flowchart, Event Modeling, Kanban, and C4 layouts.

0.1.1 #

  • Make arrow controls move the viewport in the direction shown.
  • Re-fit the diagram after viewport size changes, including when closing the fullscreen view.

0.1.0 #

Initial release.

  • MermaidDiagram widget: parses, lays out and paints any mermaid_core diagram natively (no SVG/WebView).
  • FlutterTextMeasurer (TextPainter-based) and ScenePainter (CustomPainter) for lower-level use.
  • Live-editing support: keeps the last good render with an error overlay.
  • Theme argument plus %%{init}%%/frontmatter overrides.
9
likes
150
points
17.6k
downloads
screenshot

Documentation

API reference

Publisher

verified publisherroszkowski.dev

Weekly Downloads

Native Flutter renderer for mermaid_core: TextPainter text measurement and a CustomPainter that paints the mermaid render scene directly. 28 diagram types.

Repository (GitHub)
View/report issues
Contributing

Topics

#mermaid #diagram #flutter #visualization

License

MIT (license)

Dependencies

flutter, mermaid_core

More

Packages that depend on mermaid_flutter