How to check ListView Scroll Speed in flutter using ScrollController

Viewed 190

I am having problem with Flutter List View scrolls speed. Need to get the scroll speed whenever user scrolls list faster or slower. I Want to check the List view scroll speed(Velocity), If user scroll a list faster or slower using scroll controller then it will notify user that scroll speed.

1 Answers

You can try ScrollVelocityListener from this lib

class ExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ScrollVelocityListener(
      onVelocity: (velocity) {
        // Velocity is in pixels per millisecond
      },
      child: ListView(
        children: [
          Container(),
          Container(),
          Container(),
          Container(),
        ],
      ),
    );
  }
}

Related