multi_tap_action 2.0.0 copy "multi_tap_action: ^2.0.0" to clipboard
multi_tap_action: ^2.0.0 copied to clipboard

A Flutter package to detect a specific number of taps on a widget and trigger custom actions. Perfect for implementing multi-tap gestures like double-tap, triple-tap, or more.

Multi Tap Action #

Pub Publisher

Features #

  • Customizable tap count: Define the exact number of taps required to trigger an action
  • Custom actions: Execute any desired action when the specified number of taps is reached
  • Haptic feedback: Optionally enable haptic feedback with different types (light, medium, heavy, or selection click)
  • Tap reset duration: Set a time window to reset the tap counter if no further taps are detected
  • Callback for every tap: Get the current tap count on every tap for additional control.

Getting started #

Install it using pub:

flutter pub add multi_tap_action

And import the package:

import 'package:multi_tap_action/multi_tap_action.dart';

Usage #

MultiTapAction(
  taps: 3, // Number of taps to detect
  onActionTriggered: (taps) {
    print('$taps taps detected!'); // Action to perform when the specified number of taps is reached
  },
  child: Container(
    color: Colors.yellow,
    width: 100,
    height: 100,
  ),
)

Constructor #

Parameters Type Description
taps int Number of taps required to trigger the action. Must be greater than 0.
onActionTriggered Function(int taps) Callback function to execute when the specified number of taps is reached.
child Widget The widget on which taps are detected.
onTap (optional) Function(int currentTapCount)? Callback function to execute on every tap. Returns the current tap count.
resetDuration (optional) Duration Time to reset if no further taps are detected.Defaults to 60seconds.
enableHapticFeedback (optional) bool Enable haptic feedback when the action is triggered. Defaults to false.
hapticFeedbackType (optional) HapticFeedbackType Type of haptic feedback to trigger. Defaults toHapticFeedbackType.lightImpact.

Author #

This package was developed by sawongam

License #

This project is licensed under the MIT License - see the LICENSE file for details.

2
likes
0
points
262
downloads

Publisher

verified publishersangamadhikari.com

Weekly Downloads

A Flutter package to detect a specific number of taps on a widget and trigger custom actions. Perfect for implementing multi-tap gestures like double-tap, triple-tap, or more.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on multi_tap_action