Wrapper widget for attaining velocity from a scroll view as the scroll changes
Wrap the target scroll view with a ScrollVelocityListener widget and you will receive velocity updates via the onVelocity
callback. The unit returned is pixels per millisecond
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(),
],
),
);
}
}