v0.0.1
swipe
Flutterで上、下、左、右のスワイプを検出する簡単な方法。
46いいね 190030日間ダウンロード140Pub ポイント
AndroidiOSWebmacOSWindowsLinux
Flutterで上、下、左、右のスワイプを検出する簡単な方法。
{"sdk":"flutter"}{"sdk":"flutter"}以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。
The easy way to detect swipe up, down, left and right in Flutter.
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.
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
},
)
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,
)
You can try a working example here.