Skip to content

pstromberg98/scroll_velocity_listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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(),
        ],
      ),
    );
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages