Baseflow / flutter_swipe_detector

A Flutter package to detect your swipe directions and provides you with callbacks to handle them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter Swipe Detector

A package to detect your swipe directions and provides you with callbacks to handle them.

Usage

SwipeDetector(
  onSwipe: (direction, offset) {
    _addSwipe(direction);
  },
  onSwipeUp: (offset) {
    _addSwipe(SwipeDirection.up);
  },
  onSwipeDown: (offset) {
    _addSwipe(SwipeDirection.down);
  },
  onSwipeLeft: (offset) {
    _addSwipe(SwipeDirection.left);
  },
  onSwipeRight: (offset) {
    _addSwipe(SwipeDirection.right);
  },
  child: const Container(
    padding: EdgeInsets.all(16),
    child: Text(
      'Swipe me!',
      style: TextStyle(
        fontWeight: FontWeight.bold,
      ),
    ),
  ),
),

About

A Flutter package to detect your swipe directions and provides you with callbacks to handle them.

License:MIT License


Languages

Language:Dart 70.3%Language:HTML 25.5%Language:Swift 2.7%Language:Kotlin 0.8%Language:Shell 0.4%Language:Objective-C 0.3%