Skip to content
pubscout

slide_action

0.0.2, released 4 years ago by freedee.me

A highly customizable slide-to-perform-action widget for Flutter.

WASM-ready
$ flutter pub add slide_action
Source repository

What it does

Provides a slide action widget allowing users to swipe or slide to execute a callback action. It supports smooth thumb movement, RTL layouts, and asynchronous operations with loading indicators.

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

Use it when

  • You need a slide-to-unlock or slide-to-confirm pattern in your UI.
  • You want to handle asynchronous operations triggered by a sliding gesture with loading states.

Skip it when

  • You need standard buttons or switches rather than a swipe gesture.
  • You are looking for complex navigation or state management solutions.

Strengths

  • Highly customizable track and thumb builders
  • Built-in support for async operations and loading states
  • RTL and multi-platform support

Weaknesses

  • The disabledColorTint property does not work properly on web due to color blend mode bugs
  • Very niche widget with limited scope

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
SlideAction(
    trackBuilder: (context, state) {
        return Container(
            decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(16),
                color: Colors.white,
            ),
            child: Center(
                child: Text("Slide me"),
            );
        );
    },
    thumbBuilder: (context, state) {
        return Container(
            margin: const EdgeInsets.all(4),
            decoration: BoxDecoration(
                color: Colors.orange,
                borderRadius: BorderRadius.circular(16),
            ),
            child: const Icon(Icons.chevron_right, color: Colors.white),
        );
    },
    action: () {
        debugPrint("Action performed");
    },
)

Alternatives

Packages that do the same job and could replace slide_action.