scroll_velocity_listener 0.0.7 copy "scroll_velocity_listener: ^0.0.7" to clipboard
scroll_velocity_listener: ^0.0.7 copied to clipboard

A widget that wraps scroll views and outputs velocity

scroll_velocity_listener #

Wrapper widget for attaining velocity from a scroll view as the scroll changes

Usage #

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(),
        ],
      ),
    );
  }
}
2
likes
20
pub points
0%
popularity

Publisher

unverified uploader

A widget that wraps scroll views and outputs velocity

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on scroll_velocity_listener