flutter scroll view when draggable item reaches edge

The solution for “flutter scroll view when draggable item reaches edge” can be found here. The following code will assist you in solving the problem.

//Works fine, although it is no very smooth
Listener(
child: draggable,
onPointerMove: (PointerMoveEvent event) {
if (event.position.dy > MediaQuery.of(context).size.height – 100) {
// 120 is height of your draggable.
scrollController.scrollTo(scrollcontroller.offset + 120);
}
},
);

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in