dollar_gesture_recognizer 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 48

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 : http://depts.washington.edu/acelab/proj/dollar/index.html.

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.

recognizer.deleteUserGesture("my_gesture");

Test gestures : #

Test gestures

[0.0.2] - 05/01/2020 #

  • Code cleaning. Better documentation.

[0.0.1] - 05/01/2020 #

example/lib/main.dart

import 'package:flutter/material.dart';

import 'draw_screen.dart';

void main() => runApp(DrawApp());

class DrawApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Draw(),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dollar_gesture_recognizer: ^0.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dollar_gesture_recognizer/dollar_gesture_recognizer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
88
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [dollar_gesture_recognizer] that is in a package requiring null.

Health suggestions

Format lib/dollar_gesture_recognizer.dart.

Run flutter format to format lib/dollar_gesture_recognizer.dart.

Format lib/math_utils.dart.

Run flutter format to format lib/math_utils.dart.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Update README.md. (-2 points)

1 image link is insecure (e.g. http://depts.washington.edu/acelab/proj/dollar/unistrokes.gif), use https URLs instead.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8