1
GestureDetector(
                child: SizedBox(
                  width: double.infinity,
                  height: MediaQuery.of(context).size.height,
                  child: InteractiveViewer(
                    transformationController: viewTransformationController,
                    minScale: 0.2,
                    maxScale: 200.2,
                    child: Plotkhan(
                      recognizer: tapGestureRecognizer,
                      indexofitem: indexofitems,
                      height: 400.0,
                      data: _items
                          .map((e) => Point(num.parse(e['x'].toString()),
                              num.parse(e['y'].toString())))
                          .toList(),
                      gridSize: const Offset(1.0, 1.0),
                      style: PlotStyles(
                        pointRadius: 3.0,
                        trace: true,
                        outlineRadius: 1.0,
                        primary: Colors.white,
                        secondary: Colors.orange,
                        textStyle: const TextStyle(
                          fontSize: 8.0,
                          color: Colors.blueGrey,
                        ),
                      ),
                      padding:
                          const EdgeInsets.fromLTRB(40.0, 12.0, 12.0, 40.0),
                    ),
                  ),
                ),
              ),


its a dot connecting app which I have a list of diagram with offset that implements canvas.drawcircle from list. I researched so didn't find any thing related GestureDetector with canvas.drawcircle. the rest of function is working well if I set function on any button, but don't know how to achieve function with canvas.drawcircle.

Amirali Eric Janani
  • 1,477
  • 3
  • 10
  • 20
Arbaz Khan
  • 11
  • 2
  • if user click next index of(canvas.drawCircle) it should draw line with the previous one circle, for now i am doing this with manually int variable and calling function from button its working well, but i want to do it with gesture detector of canvas.draw circle, – Arbaz Khan Mar 08 '23 at 09:29
  • for (var i = 0; i < points.length; i++) { int ins = i + 1; Offset point = _scalePoint(points[i], size); // canvas.drawCircle(point, style.pointRadius, circlePaint); canvas.drawCircle(point, style.pointRadius, circlePaint); if (style.outlineRadius > 0.0) { canvas.drawCircle( point, style.pointRadius, outlinePaint, ); } – Arbaz Khan Mar 08 '23 at 09:32
  • for (int i = 0; i < indexofitem; i++) { bool isLastPoint = (i + 1) == points.length; var firstPoint = _scalePoint(points[i], size); if (!isLastPoint) { var secondPoint = _scalePoint(points[i + 1], size); canvas.drawLine( firstPoint, secondPoint, traceLinePaint, ); } if (isLastPoint && style.traceClose && points.length > 2) { var secondPoint = _scalePoint(points[0], size); canvas.drawLine( firstPoint, secondPoint, – Arbaz Khan Mar 08 '23 at 09:34
  • your code must be in code style and please read your full sentence to correct your grammar. – Amirali Eric Janani Mar 08 '23 at 14:40
  • my grammar isnot good – Arbaz Khan Mar 09 '23 at 10:49
  • I edited your post bro. – Amirali Eric Janani Mar 09 '23 at 12:30
  • thanks for help, it is my first post, did you have any solution of my problem – Arbaz Khan Mar 11 '23 at 03:20

0 Answers0