polygon
0.1.0, released 4 years ago by an unverified publisher
Easily draw and clip polygon shapes in Flutter.
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.
- flutter_painter
A Flutter widget for drawing scribbles, text, shapes and images on a canvas.
74Compare - star_menu
Contextual popup menus with different shapes, animations, and custom widget entries.
70Compare - one_dollar_unistroke_recognizer
A 2D single-stroke gesture and shape recognizer for Dart and Flutter.
68Compare - material_new_shapes
Provides Material 3 shape definitions (e.g., RoundedPolygon, Cubic) for Flutter UI.
48Compare
Works with
Packages commonly used together with polygon: ones it builds on, ones built on it, and its own family.