Flutter Shape Library
Copy-paste recipes for the custom shapes Flutter does not ship: borders, polygons, stars, hearts and curved headers. Each recipe has a live preview, sliders for its parameters, Dart code that updates as you move them, and a button to open the shape in the editor.
Shape recipes
Flutter Dashed Border
Dash, gap, stroke and corner radius, drawn with PathMetrics.
Flutter Triangle Shape
Four directions and optional rounded corners.
Flutter Half Circle (Semicircle) Shape
The top, bottom, left or right half of a circle.
Flutter Hexagon Shape & Hexagon Avatar
Hexagons and 5 to 8 sided polygons for avatars and cards.
Flutter Star Shape
Any number of points with an adjustable inner radius.
Flutter Heart Shape
Fill or outline, scaled to any box.
Flutter Diagonal Header
A slanted bottom edge for headers and cards.
Flutter Curved AppBar
A convex or concave bottom edge for an AppBar.
Recipes with their own tutorial
These shapes already have a full walkthrough on the blog. Read the tutorial, or open the shape in the editor and change it visually.
- Build a Ticket / Coupon Card with Notches in Flutter · Open in editor →
- Flutter Chat Bubble with a Tail: a Reusable ShapeBorder · Open in editor →
- Flutter Bottom Navigation Bar with a Curved FAB Notch · Open in editor →
- Build a Gradient Progress Ring in Flutter with CustomPainter and SweepGradient · Open in editor →
ClipPath, ShapeBorder or CustomPainter?
Most recipes give you two versions of the same path. A ClipPath with a CustomClipper cuts a widget (an image, a gradient container) to the shape. A ShapeBorder makes the shape the widget's own surface, so Container, Card, Material and AppBar can keep their shadow, border and ink ripple. A CustomPainter simply draws it, which suits standalone icons and outlines such as the dashed border.
The full comparison, with the same path in all three, is in CustomPainter vs ClipPath vs ShapeBorder.