Search packages, repositories and app categories

Package detailsv0.0.1

swipe

The easy way to detect swipe up, down, left and right in Flutter.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2.4K
Likes
46
Pub points
140

Install package

flutter pub add swipe

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The swipe package provides a simple and intuitive way to detect directional swipes—up, down, left, and right—in Flutter applications. It abstracts the complexity of gesture recognition, allowing developers to easily add swipe interactions to widgets with minimal code. Ideal for creating interactive UIs such as sliders, navigation panels, or game controls, it supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The package is lightweight and integrates seamlessly into existing Flutter projects.

Use cases

  • Implementing swipe-to-navigate interfaces
  • Creating gesture-based game controls
  • Building interactive sliders or carousels
  • Adding quick actions via swipe gestures
  • Designing responsive touch-based layouts

Key features

  • Simple API for detecting swipe directions
  • Supports all major platforms
  • Minimal boilerplate code
  • Built-in gesture recognition
  • Easy integration with existing widgets

Suitable for

  • Developers building touch-heavy apps
  • UI designers seeking gesture interactivity
  • Cross-platform mobile and web applications
  • Projects requiring intuitive swipe navigation

Considerations

  • May require tuning for sensitive gesture detection
  • Not suitable for complex multi-touch gestures
  • Limited to basic swipe directions
  • Performance impact on high-frequency gesture handling
  • Depends on Flutter's gesture system stability

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Swipe

The easy way to detect swipe up, down, left and right in Flutter.

Getting Started

Add dependency to your flutter project:

$ flutter pub add swipe

or

dependencies:
  swipe: ^0.0.1

or

dependencies:
  swipe:
    git: 
      url: git://github.com/salkuadrat/swipe.git

Then run flutter pub get.

Usage

Here is a simple way of using Swipe.

Swipe(
  child: ..., // your child widget
  onSwipeUp: () {
    // do something when swiping up
  },
  onSwipeDown: () {
    // do something when swiping down
  },
  onSwipeLeft: () {
    // do something when swiping left
  },
  onSwipeRight: () {
    // do something when swiping right
  },
)

Customization

Swipe widget comes with additional parameters to customize your swiping experience.

Swipe(
  child: ...,
  onSwipeUp: ...,
  onSwipeDown: ...,
  onSwipeLeft: ...,
  onSwipeRight: ...,
  verticalMaxWidthThreshold: 50,
  verticalMinDisplacement: 100,
  verticalMinVelocity: 300,
  horizontalMaxHeightThreshold: 50,
  horizontalMinDisplacement: 100,
  horizontalMinVelocity: 300,
)

Example

You can try a working example here.

Categories

Source repository

Projects using this package