swipe_widget 0.0.1+5 copy "swipe_widget: ^0.0.1+5" to clipboard
swipe_widget: ^0.0.1+5 copied to clipboard

outdated

Make a Widget swipe to the sides, adding different funcionalities.

example/README.md

It's as simple as:

SwipeWidget(
    child: <your_widget>
);

If you want to add funcionalities you can add Functions:

SwipeWidget(
    onSwipe: () => print('Swiped!'),
    onSwipeLeft: () => print('Swiped left! I feel rejected...'),
    onSwipeRight: () => print('Swiped right!'),
    onUpdate: (distance) => print('The distance of the swipe is $distance (from 0 to 1)'),
    child: <your_widget>
);

You can change how the swipe should react:

SwipeWidget(
    distance: 0.5,
    angle: 0.4,
    rotation: 25,
    scale: 1,
    dragResistance: 0.5,
    child: <your_widget>
);
  • These properties are related to how far the widget is being dragged.
  • Distance is the threshold needed to take action when dropping. (Example: If it was 0.5, you would only need to drag half way and let it go, it would act like a full swipe)
  • Angle is in radians, while rotation is in degrees. (Angle has priority)
10
likes
0
points
6
downloads

Publisher

verified publisherdrafakiller.com

Weekly Downloads

Make a Widget swipe to the sides, adding different funcionalities.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on swipe_widget