mermaid_flutter 0.7.0
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_core0.7.0. - Breaking: diagrams follow the mermaid.js 12 defaults (see the
mermaid_corechangelog): theredux-colortheme andneolook for flowchart, class, ER, requirement, sequence, state and venn diagrams, and ELK layouts. Thethemeparameter ofMermaidDiagramandMermaidViewis nullable; null follows these defaults. MermaidDiagram,MermaidViewandrenderToPngtakeappearanceandlayout:MermaidAppearance.classicandMermaidLayout.dagrekeep the mermaid.js 11 output.- Bundle the Recursive font (SIL Open Font License 1.1) that the
redux-colortheme uses, and paint drop shadows. - The fullscreen popup of
MermaidViewuses the view'sappearanceandlayout. Before, it always usedMermaidAppearance.standardandMermaidLayout.standard. - Breaking: rename
MermaidViewController.focusNodetocenterOnNode,MermaidViewController.fitAlltofitandMermaidView.paddingtofitPadding. package:mermaid_flutter/mermaid_flutter.dartexports themermaid_coretypes that the widget and PNG API takes:MermaidTheme,MermaidAppearance,MermaidLayout,RenderScene,MermaidParseException,FlowNodePaintOverrideandFlowLinkPaintOverride. An import ofmermaid_coreis necessary only for other core API, for exampleColor.- Breaking: follow the
mermaid_corerenames of the render scene types:Fill→SceneFill,Stroke→SceneStroke,TextAlignH→SceneTextAlignandTextStyleSpec→SceneTextStyle.textStyleFromSpecandFlutterTextMeasurer.measuretake acore.SceneTextStyle. - Breaking:
fontWeightFromCss,kMermaidTextHeightFactor,dashPathandparseCssFontFamilyare no longer exported. They were internal helpers of the text measurer and the scene painter. - Add the typedefs
MermaidErrorWidgetBuilder,MermaidNodeTapCallbackandMermaidEdgeTapCallback.MermaidDiagramandMermaidViewuse them forerrorBuilder,onNodeTapandonEdgeTap; the function types do not change. MermaidDiagrampaints the scene background once, withScenePainter. 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_core0.6.0. Breaking: state diagram and mindmap layouts change (see themermaid_corechangelog): 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
directionsubgraph,style/classon subgraphs, gantt charts in seconds, and architecture icons with:. themeVariables.backgroundno longer recolours the canvas behind the diagram.
0.5.0 #
- Require
mermaid_core0.5.0. Breaking: the output of ELK layouts changes for flowcharts withlayout: elkand for state diagrams with a nested composite state (see themermaid_corechangelog). 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_core0.4.0. Breaking for code that reads the diagram models: labels areLabelText, no longerString(see themermaid_corechangelog). 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<,#,#.
0.3.2 #
- Require
mermaid_core0.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_core0.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_core0.3.0 for the configuration and layout fixes.
0.2.1 #
- Add rendered diagram examples to the README.
0.2.0 #
Behavior changes
onNodeTapnow 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_core0.2.0.
Changes
- Preserve requested monospace fonts and add platform symbol-font fallbacks for Unicode diagram labels.
- Add
MermaidViewControllerwith observable transforms, animated or immediate fit, and focus-by-node-id support. - Add
MermaidDiagram.onSceneChangedfor access to post-layout scene geometry. - Add
onEdgeTaptoMermaidDiagramandMermaidView, with precise stroke and label hit testing and stable Mermaid link indices. - Add paint-only flowchart node and link overrides to
MermaidDiagramandMermaidView; override changes reuse the parsed and laid-out base scene. - Add desktop/web node hover callbacks, node-only cursors, and optional tooltip
overlays to
MermaidDiagramandMermaidView. - Add opt-in node semantics with human labels, stable identifiers, transformed bounds, deterministic traversal, and accessible tap actions.
- Add headless
renderToPngandrenderSceneToPngAPIs for Flutter runners. - Add
MaterialMermaidTheme.fromThemeandfromColorSchemeto map Material colors and text roles to a light or darkMermaidTheme. - Render gradient strokes and multiply-composited links consistently in
ScenePainterand 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, andshowControlsinstead of falling back to the defaults. - Refresh the pub.dev screenshots for the corrected layouts.
0.1.2 #
- Update
mermaid_coreto 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.
MermaidDiagramwidget: parses, lays out and paints anymermaid_corediagram natively (no SVG/WebView).FlutterTextMeasurer(TextPainter-based) andScenePainter(CustomPainter) for lower-level use.- Live-editing support: keeps the last good render with an error overlay.
- Theme argument plus
%%{init}%%/frontmatter overrides.
