Animating CustomPainter with repaint whilst also retrieving Controller.value in flutter
问题 I've been looking around and it seems the most efficient and resource friendly way of animating a CustomPainter is to pass it an AnimationController as a repaint listenable, rather than using SetState(). I've tried this method, but unfortunately my CustomPaint object requires a variable that can be set both by the controller.value but also by the position of a user's pointer during a drag. class CustomScroller extends StatefulWidget { final double width; //Should be width of user's screen