Skip to content
pubscout

draw_your_image

0.12.1, released 8 weeks ago by tsuyoshichujo.com

A Flutter widget for creating customizable drawing canvases with a declarative API.

WASM-ready
$ flutter pub add draw_your_image
Source repository

What it does

Provides a flexible drawing canvas widget that captures touch, stylus, and mouse inputs. It supports stroke management via state, custom smoothing algorithms, intersection detection, and custom painters.

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

Use it when

  • You want to allow users to draw freely with fingers or styluses on a canvas.
  • You need a controller-free, fully declarative drawing widget.
  • You require device-aware drawing behaviors like stylus-only input or pressure sensitivity.

Skip it when

  • You need built-in state management solutions like undo/redo out of the box (requires manual implementation).
  • You are building complex vector graphics editing software.

Strengths

  • Fully declarative API with no controllers required.
  • Device-aware input handling for distinguishing stylus, finger, and mouse.
  • Rich stroke data including pressure, tilt, and orientation.

Weaknesses

  • Features like undo/redo and zoom/pan must be implemented by the app developer.
  • Not documented for offline local persistence of canvas states.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
class MyDrawingPage extends StatefulWidget {
  @override
  _MyDrawingPageState createState() => _MyDrawingPageState();
}

class _MyDrawingPageState extends State<MyDrawingPage> {
  List<Stroke> _strokes = [];

  @override
  Widget build(BuildContext context) {
    return Draw(
      strokes: _strokes,
      onStrokeDrawn: (stroke) {
        setState(() {
          _strokes = [..._strokes, stroke];
        });
      },
    );
  }
}

Alternatives

Packages that do the same job and could replace draw_your_image.