SpringDescription( mass: 1.0, stiffness: 1.0, damping: 1.0, ), 0.0, // start value 1.0, // end value 0.0, // velocity ); @override Widget build(BuildContext context) { return GestureDetector( onPanStart: startDrag, onPanUpdate: onDrag, onPanEnd: endDrag, child: CustomPaint( // canvas on which to draw during the paint phase painter: BoxPainter( boxPosition: boxPosition, boxPositionOnStart: boxPositionOnStart ?? boxPosition, touchPoint: point, ), child: Container(), ), ); }