Skip to content
pubscout

one_dollar_unistroke_recognizer

1.3.5, released 3 months ago by adil.hanney.org

A 2D single-stroke gesture and shape recognizer for Dart and Flutter.

WASM-ready
$ flutter pub add one_dollar_unistroke_recognizer
Source repository

What it does

Recognizes 2D single-stroke gestures and shapes using the $1 Unistroke Recognizer algorithm and Protractor enhancement. It can match default shapes like lines, circles, rectangles, triangles, and stars, or custom unistrokes. It also provides methods to convert user strokes into canonical shapes.

AI-written summary of version 1.3.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to recognize handwritten shapes or gestures in a Flutter application.
  • You are building a drawing, note-taking, or whiteboard app and want to clean up user shapes.

Skip it when

  • You need multi-stroke handwriting or complex gesture recognition.
  • You require heavy machine learning classification beyond geometric template matching.

Strengths

  • Lightweight and requires very few templates to perform well.
  • Includes helpful helpers to convert user input into canonical geometric shapes.
  • Supports both default and custom unistrokes with type safety.

Weaknesses

  • Limited to single-stroke gestures (unistrokes).
  • Relies entirely on geometric matching, which may struggle with erratic or inconsistent strokes.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
final points = <Offset>[...];
final recognized = recognizeUnistroke(points);
if (recognized == null) {
  print('No match found');
} else {
  print('Stroke recognized as ${recognized.name}');
}

Alternatives

Packages that do the same job and could replace one_dollar_unistroke_recognizer.

Works with

Packages commonly used together with one_dollar_unistroke_recognizer: ones it builds on, ones built on it, and its own family.