InteractiveViewer(
constrained: false,
boundaryMargin: const EdgeInsets.all(20),
child: Container(
child: GraphView(
graph: graph,
algorithm:
BuchheimWalkerAlgorithm(builder, TreeEdgeRenderer(builder)),
paint: Paint()
..color = Colors.black
..strokeWidth = 1.5
..style = PaintingStyle.stroke,
builder: (Node node) {
var a = node.key?.value as int;
var nodeValue =
_nodeData.firstWhere((element) => element.id == a);
//print('node Value : $nodeValue');
var _eid = (nodeValue.id).toString();
var _id = (nodeValue.uid).toString();
var _name = (nodeValue.name).toString();
return Center(child: rectangleWidget(_id, _name, _eid));
},
),
),
),
我想将上面的 GraphView 小部件居中。我尝试过列、行居中,甚至容器和中心小部件......