Skip to content
pubscout

perfect_freehand

2.5.2+1, released 10 months ago by an unverified publisher

Turns input points into a polygon of outline points for drawing pressure-sensitive freehand lines.

WASM-ready
$ flutter pub add perfect_freehand
Source repository

What it does

Generates points for a smooth polygon outline based on an array of input points and customizable options like size, thinning, and smoothing. It supports pressure sensitivity either via input point data or simulated based on distance.

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

Use it when

  • You need to build a drawing or signature-capture app in Flutter.
  • You want pressure-sensitive freehand strokes rendered via CustomPainter.

Skip it when

  • You are looking for a fully-featured pre-built canvas widget with built-in undo/redo and storage.
  • You are using Dart without Flutter (versions 1.x are required for non-Flutter).

Strengths

  • Port of a robust and popular JavaScript freehand stroke library.
  • Highly customizable options for stroke size, thinning, smoothing, streamline, and tapering.
  • Supports both real pressure data and simulated pressure.

Weaknesses

  • Does not include rendering widgets out of the box (requires CustomPainter implementation).
  • No built-in management for undo/redo stacks or drawing state.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Simply add the package dependency via pubspec.yaml or pub add.

import 'package:perfect_freehand/perfect_freehand.dart';

List<PointVector> myPoints = [
  PointVector(0, 0),
  PointVector(1, 2),
];

final stroke = getStroke(myPoints);

Alternatives

Packages that do the same job and could replace perfect_freehand.

Works with

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