build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Override this method to build widgets that depend on the state of the listenable (e.g., the current value of the animation).

Implementation

@override
Widget build(BuildContext context) {
  return Container(
    constraints: BoxConstraints.expand(),
    child: Listener(
      onPointerHover: _pointerLocation,
      onPointerDown: (PointerDownEvent details) {
        _cursor.hovering = true;
        print(_cursor.hovering);
        _pointerLocation(details);
        print(details);
      },
      onPointerMove: _pointerLocation,
      onPointerUp: (PointerUpEvent details) {
        _cursor.hovering = false;
        print(_cursor.hovering);
        print(details);

        // _pointerLocation(details);
      },
      child: Stack(children: [
        Container(
          constraints: BoxConstraints.expand(),
          child: CustomPaint(
            painter: CanvasNestPainter(
                nestConfig, nodeInfoList, screenSize, _cursor),
          ),
        ),
        Center(
          child: Container(
            height: screenSize.height * 0.9,
            width: screenSize.width * 0.9,
            // color: Colors.grey,
            child: MouseRegion(
              onEnter: (PointerEnterEvent details) {
                _cursor.hovering = true;
              },
              onExit: (PointerExitEvent details) {
                _cursor.hovering = false;
              },
            ),
          ),
        ),
      ]),
    ),
  );
}