6

The scenario which I want to implement is a node graph editor. Nodes should be connected with lines and also be draggable.

enter image description here

In my imagination I want something like a canvas, where I can render my controls and lines all together in one place. As far as I know flutter, I can't draw controls on the canvas. So my best guess currently to achieve what I want is:

  1. Draw my controls on a Stack and place them with the Align widget.
  2. Draw lines with a CustomPainter which is also placed on the stack. This CustomPainter needs access to the control positions on the Stack to connect them together.

This answer Drawing a line Between Widgets basically provides exactly this approach. But this approach feels not good to me since I have to sync the custom painter and my node widgets. I'm looking for alternatives.

TobiasW
  • 861
  • 3
  • 13
  • 36

0 Answers0