π¦ EasySwipeWidget
A customizable Flutter widget that allows users to swipe left or right with optional removal and smooth animations.
π¬ Demo

β¨ Features
βοΈ Swipe left or right
βοΈ Remove widget on swipe (optional)
βοΈ Smooth scale animation (optional)
βοΈ Customizable swipe threshold
βοΈ Highly flexible & lightweight
π Installation
1οΈβ£ Add dependency
dependencies:
easy_swipe_widget: ^0.0.1
2οΈβ£ Import package
import 'package:easy_swipe_widget/easy_swipe_widget.dart';
π― Usage Basic Example
EasySwipeWidget(
removeAfterSwipe: false,
enableScaleAnimation: true,
onSwipe: (direction) {
print("Swiped ${direction == SwipeDirection.left ? 'Left' : 'Right'}");
},
child: Container(
padding: EdgeInsets.all(20),
color: Colors.blue,
child: Text(
"Swipe me left or right!",
style: TextStyle(color: Colors.white),
),
),
);
βοΈ Customization
Property | Type | Default | Description |
---|---|---|---|
child | Widget | - | The content inside the swipeable area. |
onSwipe | Function(SwipeDirection) | null | Callback when the widget is swiped. |
removeAfterSwipe | bool | false | Whether the widget should be removed after a successful swipe. |
swipeThreshold | double | 0.3 | Swipe threshold as a fraction of screen width. |
enableScaleAnimation | bool | true | Enables scale animation when dragging. |
π‘ Example App | |||
A full working example is available in the example/ folder. |
π οΈ Contributing If you find any issues or want to add new features, feel free to open an issue or submit a PR!
π License This project is licensed under the MIT License. See the LICENSE file for details.