swipe 0.0.1 copy "swipe: ^0.0.1" to clipboard
swipe: ^0.0.1 copied to clipboard

The easy way to detect swipe up, down, left and right in Flutter.

Swipe #

The easy way to detect swipe up, down, left and right in Flutter.

Getting Started #

Add dependency to your flutter project:

$ flutter pub add swipe

or

dependencies:
  swipe: ^0.0.1

or

dependencies:
  swipe:
    git: 
      url: git://github.com/salkuadrat/swipe.git

Then run flutter pub get.

Usage #

Here is a simple way of using Swipe.

Swipe(
  child: ..., // your child widget
  onSwipeUp: () {
    // do something when swiping up
  },
  onSwipeDown: () {
    // do something when swiping down
  },
  onSwipeLeft: () {
    // do something when swiping left
  },
  onSwipeRight: () {
    // do something when swiping right
  },
)

Customization #

Swipe widget comes with additional parameters to customize your swiping experience.

Swipe(
  child: ...,
  onSwipeUp: ...,
  onSwipeDown: ...,
  onSwipeLeft: ...,
  onSwipeRight: ...,
  verticalMaxWidthThreshold: 50,
  verticalMinDisplacement: 100,
  verticalMinVelocity: 300,
  horizontalMaxHeightThreshold: 50,
  horizontalMinDisplacement: 100,
  horizontalMinVelocity: 300,
)

Example #

You can try a working example here.

46
likes
140
points
1.18k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The easy way to detect swipe up, down, left and right in Flutter.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on swipe