Skip to content
pubscout

polygon

0.1.0, released 4 years ago by an unverified publisher

Easily draw and clip polygon shapes in Flutter.

WASM-ready
$ flutter pub add polygon
Source repository

What it does

Provides a simple way to draw regular, convex, and star polygons or clip widgets with polygon shapes. It includes a dedicated PolygonBorder for ShapeDecoration and a computePath method for custom painters.

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

Use it when

  • You need to draw custom polygon shapes or star shapes.
  • You want to clip widgets using a custom polygon shape or border.

Skip it when

  • You need complex 3D polygon rendering or physics engines.

Strengths

  • Easy to create regular convex and star polygons.
  • Includes a dedicated PolygonBorder for ShapeDecoration and clipping.

Weaknesses

  • Very narrow and specialized scope.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
const polygon = Polygon([
  Offset(0.25, -1),
  Offset(0, -0.25),
  Offset(0.5, 0),
  Offset(-0.25, 1),
  Offset(0, 0.25),
  Offset(-0.5, 0),
]);

Alternatives

Packages that do the same job and could replace polygon.

Works with

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