简体   繁体   中英

Is there a way in Flutter to catch the “start-moving” event in a Dismissible Widget?

I am using the Dismissible widget to be able to remove certain screens/widgets from a flutter app by swiping them up.

What I need to achieve is to blur the image once the user starts swiping/dismissing them but the widget only has the "onDismissed" callback, but does not offer a way to catch the swiping event.

Any alternatives?

You can achieve That using the GestureDetector widget

// This is the sample
GestureDetector(onPanUpdate: (details) {
  if (details.delta.dx > 0) {
    // swiping in right direction
  }
});

You can check there are many events that you can trigger like onHorizontalDragUpdate, and many more you can check out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM