scribble
0.10.0+1, released 3 years ago by whynotmake.it
A lightweight Flutter library for freehand drawing with pressure support and variable line width.
WASM-ready
What it does
Scribble provides a drawing surface widget and a notifier to handle freehand sketches in Flutter. It supports pen and touch pressure, variable line widths, image export to PNG, JSON serialization, and full undo/redo capabilities.
AI-written summary of version 0.10.0+1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to implement freehand drawing or signature capture in your Flutter app.
- You need pressure-sensitive drawing with variable line widths.
- You want to serialize sketches to JSON and export them to PNG images.
Skip it when
- You are building a complex vector graphics editor or a full-featured digital painting application requiring layer management and advanced brushes.
- You only need to display static graphics without drawing input.
Strengths
- Supports pressure and variable line width for smooth freehand drawing.
- Built-in undo/redo history support.
- Sketches are fully serializable to JSON and exportable to PNG.
Weaknesses
- Limited to freehand drawing and basic sketching use cases.
- Relies on specific internal value notifier tools which may limit deep customization.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 3
Install via `dart pub add scribble` and add the Scribble widget with a ScribbleNotifier to your widget tree.
Scaffold(
body: Scribble(
notifier: notifier,
),
)Works with
Packages commonly used together with scribble: ones it builds on, ones built on it, and its own family.
- freezed_annotationscribble depends on itAnnotations for the freezed code-generator.
- value_notifier_toolsscribble depends on itLightweight tools like undo/redo, select, and where for ValueNotifiers
- perfect_freehandscribble depends on itTurns input points into a polygon of outline points for drawing pressure-sensitive freehand lines.