dollar_gesture_recognizer 0.0.2
dollar_gesture_recognizer: ^0.0.2 copied to clipboard

A one dollar gesture recognizer in dart which can be used in flutter.

One dollar gesture recognizer in Dart #

A one dollar gesture recognizer in dart. It can be very easily used in flutter.

Origin #

This project is a direct translation of the one dollar gesture recognizer that you can find here :

Things to know #

This recognizer :

  • detects gestures that are done with a single uninterrupted gesture,
  • needs to be given a set of gestures it can detect to work,
  • will always give an answer and returns the gesture detected to be the most similar to the gesture you analyze. The gesture detected is provided with a score indicating how similar it is.
  • can be given your own gestures to detect.

Example #

You can find a full example of use in this example project.. This example is initialized with a set of test gestures to detect. You can clear the drawing screen, draw a gesture and add it to the recognizer.

How to use it? #

To use it you need to :

Import the recognizer class.

import 'package:dollar_gesture_recognizer/dollar_gesture_recognizer.dart';

Import the math utils class to be able to use the Point class.

import 'package:dollar_gesture_recognizer/math_utils.dart';

If needed, import some test gestures.

import 'package:dollar_gesture_recognizer/gestures_examples.dart';

Init a recognizer.

var recognizer = new DollarRecognizer();

Init a recognizer with test data.

var recognizer = new DollarRecognizer.withGestures(getTestGestures());

To try recognize a gesture, provide a list of Point to the recognize methods.

List<Point> pointsToRecognize = new List<Point>();
//fill the list with points

//Launch recognition
Result result = await recognizer.recognize(pointsToRecognize, false);

Add a gesture to the recognizer.

List<Point> newGesture = new List<Point>();
//fill the list with points

recognizer.addGesture("my_gesture", newGesture);

Remove a gesture from the recognizer.


Test gestures : #

Test gestures

pub points



A one dollar gesture recognizer in dart which can be used in flutter.

Repository (GitHub)
View/report issues


API reference






Packages that depend on dollar_gesture_recognizer