nabil6391 / graphview

Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.
MIT License
420 stars 114 forks source link

BuchheimWalkerAlgorithm example not working. #26

Closed kzrfaisal closed 3 years ago

kzrfaisal commented 3 years ago

Throwing this error: The following assertion was thrown during performLayout(): RenderCustomLayoutBox does not meet its constraints.

Constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=Infinity) Size: Size(875.0, 654.0)

If you are not writing your own RenderBox subclass, then this is not your fault. Contact support: https://github.com/flutter/flutter/issues/new?template=BUG.md

The relevant error-causing widget was GraphView

nabil6391 commented 3 years ago

Try this:

Expanded( child: InteractiveViewer( constrained: false, boundaryMargin: EdgeInsets.all(100), minScale: 0.01, maxScale: 5.6, child: GraphView( graph: graph, algorithm: BuchheimWalkerAlgorithm(builder, TreeEdgeRenderer(builder)), paint: Paint() ..color = Colors.green ..strokeWidth = 1 ..style = PaintingStyle.stroke, )), ),

kzrfaisal commented 3 years ago

Great it worked.....Thanks a lot