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.
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.
- material_new_shapes
Provides Material 3 shape definitions (e.g., RoundedPolygon, Cubic) for Flutter UI.
48Compare - fdottedline
Create dotted lines, dashed shapes, and dotted borders for widgets.
65Compare - gestures
Custom gesture detector widget for Flutter
50Compare - app_tutorial
A lightweight widget for creating onboarding flows with customizable highlights and callbacks.
49Compare
Works with
Packages commonly used together with one_dollar_unistroke_recognizer: ones it builds on, ones built on it, and its own family.