🪄 Swipe effect
A simple widget helps with adding an effect to your swipe actions.
You can use it by wrapping your widget with SwipeEffect and listen to the swipes.
✨ Usage
SwipeEffect(
direction: TextDirection.rtl,
color: Colors.green.withAlpha(70),
verticalTolerance: 1.0,
startDeltaPx: 30,
callbackDeltaRatio: 0.25,
callback: () {
// Navigator.pop(context);
},
child: ...,
);
🔮 Showcase
⚙️ Parameters
Parameter | Description |
---|---|
child * |
Your child widget. |
callback * |
A call back will be triggered after the swipe action. |
color |
Color of the effect curve. |
direction |
direction of the swipe TextDirection.ltr orTextDirection.rtl |
verticalTolerance |
Double value determines a ratio from the screen height that after swiping in vertical axis the effect will be dismissed. |
callbackDeltaRatio |
Double value determines a ratio from the screen width to trigger the callback after reaching it. |
startDeltaPx |
Determines where to start the effect from the beginning of the widget (in pixel) |