πŸ“¦ EasySwipeWidget

pub package GitHub stars License

A customizable Flutter widget that allows users to swipe left or right with optional removal and smooth animations.


🎬 Demo

swipe_widget_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.

Libraries

easy_swipe_widget