multi_tap_detector 1.0.0 copy "multi_tap_detector: ^1.0.0" to clipboard
multi_tap_detector: ^1.0.0 copied to clipboard

A package to handle multiple taps on a widget.

multi_tap_detector #

A widget to handle multiple taps on its child.

Features #

  • Define callback after a certain number of taps.
  • Define the maximum duration which can be passed between two taps.
  • Define callback on each tap to detect the progress.
  • Define callback on taps counter reset.

Getting started #

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  multi_tap_detector: ^1.0.0
copied to clipboard

To use the MultiTapDetector widget add the following import:

import 'package:multi_tap_detector/multi_tap_detector.dart';
copied to clipboard

Usage #

return MultiTapDetector(
    taps: 5,
    onMultiTap: () {
      print('The widget was tapped 5 times!');
    },
    onTap: (tapCount) {
      print('You have tapped the widget $tapCount times!');
    },
    onTapsReset: () {
      print('The taps have been reset!');
    },
    maxDurationBetweenTaps: const Duration(milliseconds: 1379),
    child: YourWidget(),
);
copied to clipboard

Checkout a full example at https://github.com/Dix206/flutter_multi_tap_detector/blob/master/example/lib/main.dart

5
likes
150
points
752
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

A package to handle multiple taps on a widget.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on multi_tap_detector