Skip to content
pubscout

bezier

1.2.0, released 6 years ago by dartographer.com

A 2D Bézier curve math library supporting quadratic and cubic curves.

WASM-ready
$ flutter pub add bezier
Source repository

What it does

Provides mathematical operations and algorithms for 2D Bézier curves, such as calculating points at parameter values, finding tangents and normals, computing arc lengths, bounding boxes, and finding intersections.

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

Use it when

  • You need to calculate Bézier curve coordinates, lengths, or normals in your application
  • You are building custom graphics, animations, or drawing tools requiring curve math

Skip it when

  • You only need standard UI layout widgets without custom curve calculation requirements
  • You require 3D curve calculations instead of 2D

Strengths

  • Supports both quadratic and cubic 2D Bézier curves
  • Platform-independent and context-independent pure Dart library
  • Includes robust features like offset curves, arc length approximations, and intersection calculations

Weaknesses

  • Limited strictly to 2D math (no 3D curve support)
  • Requires manual integration with vector_math and rendering code

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

Add the dependency to pubspec.yaml and import vector_math alongside bezier.

import 'package:vector_math/vector_math.dart';
import 'package:bezier/bezier.dart';

void main() {
  final quadraticCurve = QuadraticBezier([
    Vector2(-40.0, -40.0),
    Vector2(30.0, 10.0),
    Vector2(55.0, 25.0)
  ]);
  final computedPoint = quadraticCurve.pointAt(0.75);
}

Alternatives

Packages that do the same job and could replace bezier.

Works with

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