0

I have a need to manipulate curves(e.g:hover color change), but with MouseRegion and CustomPaint I can only interact with a piece of rectangle, It's not precise enough to manipulate a curve.

Just like that, I want the mouse to move over the curve and do something, like change the color or set some business properties.

image

Here's my current code:

return Positioned(
      top: dy,
      left: dx,
      width: 300,
      height: 50,
      child: ColoredBox(
        color: Colors.blue.withOpacity(0.3),
        child: SizedBox(
          width: 250.0,
          height: 250.0,
          child: MouseRegion(
            cursor: _cursor,
            onEnter: _onEnter,
            onExit: _onExit,
            child: CustomPaint(
              painter: CurvePainter(color: _color),
              child: Container(),
            ),
          ),
        ),
      ),
    );

0 Answers0