From f2dcc4d1937dd18a1b655b14eabf63aa1198a81e Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 18 Aug 2020 13:35:33 +0200 Subject: [PATCH] GraphView: Highlight the edges of the selected node --- lib/main_graph.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/main_graph.dart b/lib/main_graph.dart index ff0f1ae2..93a257f5 100644 --- a/lib/main_graph.dart +++ b/lib/main_graph.dart @@ -62,12 +62,17 @@ class MyPainter extends CustomPainter { void paint(Canvas canvas, Size size) { // Draw all the edges for (var edge in graph.edges) { + var strokeWitdth = 2.5; + if (edge.a.pressed || edge.b.pressed) { + strokeWitdth *= 2; + } + canvas.drawLine( Offset(edge.a.x, edge.a.y), Offset(edge.b.x, edge.b.y), Paint() ..color = Colors.grey - ..strokeWidth = 2.5, + ..strokeWidth = strokeWitdth, /*onPanUpdate: (detail) { print('Edge ${edge.a.label} -> ${edge.b.label} Swiped'); },*/