Skip to content
pubscout

swipe_to_action

0.3.0, released 2 years ago by inex.dev

Widget to trigger callbacks on horizontal swipe gestures.

WASM-ready
$ flutter pub add swipe_to_action

What it does

Provides a Swipeable widget that detects horizontal drags or flings on its child. It can call different callbacks, show different backgrounds, and optionally confirm the swipe before executing the action.

AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a simple swipe‑to‑action UI like dismissing list items
  • You want different actions for left‑to‑right and right‑to‑left swipes
  • You need a confirmation step before the action is performed

Skip it when

  • You require vertical swipe handling
  • You need complex gesture choreography or multi‑direction gestures
  • You need a full‑featured swipe‑list library with built‑in animations

Strengths

  • Easy to integrate with a single widget
  • Supports multiple pointer kinds (touch, mouse, stylus)
  • Allows custom backgrounds per swipe direction
  • Optional async confirmation callback

Weaknesses

  • Only works for horizontal swipes
  • Limited built‑in animations or visual feedback
  • No support for vertical or multi‑direction gestures

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
Swipeable(
  key: ValueKey('item'),
  onSwipe: (dir) {
    // handle swipe
  },
  background: Container(color: Colors.green),
  secondaryBackground: Container(color: Colors.red),
  child: ListTile(title: Text('Swipe me')),
);

Alternatives

Packages that do the same job and could replace swipe_to_action.

  • load_switch

    A toggle switch widget with an integrated loading state for asynchronous actions.

  • extended_tabs

    An extension library for Flutter Tabs, TabBar, and TabView with advanced scrolling support.

  • blur

    A wrapper widget and extension to blur children and images or apply frosted glass effects.

  • future_progress_dialog

    Shows a simple progress dialog that auto‑dismisses when a Future completes.