Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/salkuadrat/swipe
The easy way to detect swipe up, down, left and right in Flutter.
https://github.com/salkuadrat/swipe
flutter swipe
Last synced: 7 days ago
JSON representation
The easy way to detect swipe up, down, left and right in Flutter.
- Host: GitHub
- URL: https://github.com/salkuadrat/swipe
- Owner: salkuadrat
- License: mit
- Created: 2021-06-04T18:39:46.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-06T19:30:00.000Z (about 3 years ago)
- Last Synced: 2024-10-12T09:06:20.392Z (29 days ago)
- Topics: flutter, swipe
- Language: Dart
- Homepage: https://pub.dev/packages/swipe
- Size: 67.4 KB
- Stars: 9
- Watchers: 1
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```yaml
dependencies:
swipe: ^0.0.1
```or
```yaml
dependencies:
swipe:
git:
url: git://github.com/salkuadrat/swipe.git
```Then run `flutter pub get`.
## Usage
Here is a simple way of using `Swipe`.
```dart
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.
```dart
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](example).