dynamic_signature_pad
Capture handwritten signatures as dynamic time-series data — vector strokes with velocity and optional pressure — not just a flat image. Lossless JSON and SVG export, plus PNG rendering. Pure Dart/Flutter, no native code and no third-party dependencies.
The data model is designed to map conceptually to ISO/IEC 19794-7 (signature/sign time series data), so a signature is preserved as the dynamics of how it was drawn — useful both for crisp reproduction and for behavioural (dynamic) signature analysis.
Features
- Dynamic capture: each point keeps
x, y, tand (when available) pressure; velocity is computed. - Velocity-based variable stroke width for realistic ink.
- Optional full-screen, orientation-locked capture screen
(
showDynamicSignature) for maximum signing width without fighting the OS auto-rotate; it restores the orientation on exit. - Lossless outputs: JSON (canonical), SVG (vector). PNG for embedding.
- Smooth & light: point decimation keeps capture cheap on mid-range devices.
- Finger and stylus;
clear/undo. - Tiny, stable public API; capture only — persistence is up to the host.
Install
dependencies:
dynamic_signature_pad: ^0.0.1
Usage
// Full-screen, landscape-locked capture (recommended for max signing space).
// Locks landscape while signing and restores orientation on exit.
final result = await showDynamicSignature(context, title: 'Sign here');
if (result != null) {
result.strokeJson; // lossless dynamic data (evidence)
result.svg; // vector
result.pngBytes; // raster (e.g. to embed in a PDF)
}
// Or embed the pad inline (give it a bounded box; ~2:1 is a good aspect):
final controller = DynamicSignatureController(
config: const DynamicSignaturePadConfig(showGuideLine: true),
);
AspectRatio(aspectRatio: 2, child: DynamicSignaturePad(controller: controller));
// Read the inline controller when done:
await controller.toResult(); // null if empty
controller.toJson();
controller.toSvg();
await controller.toPng(pixelRatio: 3.0);
controller.clear();
controller.undo();
Output formats
| Format | Method | Use |
|---|---|---|
| JSON (stroke data) | toJson() |
Canonical, lossless — the dynamic evidence |
| SVG | toSvg() |
Vector render, scales to any size |
| PNG | toPng() |
Raster, DPI-aware (embedding/compatibility) |
| All three | toResult() |
The standardized SignatureResult |
Performance
You capture a point model in memory; SVG/PNG are derived once at the end.
Capturing dynamic points costs about the same as capturing a plain point list;
the only extra live cost is drawing the realistic (variable-width) stroke, which
is bounded by signature length and kept cheap via point decimation and a
RepaintBoundary.
Roadmap
- ISO/IEC 19794-7 binary exporter.
- Quadratic-bezier smoothing; cached layer for committed strokes.
- Web/desktop validation; optional dynamic signature matching.
License
MIT — see LICENSE.
Libraries
- dynamic_signature_pad
- Capture handwritten signatures as dynamic time-series data (vector strokes with velocity and optional pressure), with lossless JSON/SVG export and PNG rendering.