RoundedPolygon class final
A closed polygonal shape, with optional rounding at its vertices.
A polygon can be built from a number of vertices, or from an ordered list of vertices.
- Annotations
Constructors
-
RoundedPolygon(int numVertices, {double radius = 1, Offset center = Offset.zero, CornerRounding rounding = CornerRounding.unrounded, List<
CornerRounding> ? perVertexRounding}) -
Creates a regular polygon with
numVerticesvertices, equally spaced around a circle of the givenradiusaboutcenter.factory - RoundedPolygon.circle({int numVertices = 8, double radius = 1, Offset center = Offset.zero})
-
Creates a circle of the given
radiusaboutcenter, approximated by rounding a polygon ofnumVerticesvertices.factory -
RoundedPolygon.fromVertices(List<
Offset> vertices, {CornerRounding rounding = CornerRounding.unrounded, List<CornerRounding> ? perVertexRounding, Offset? center}) -
Creates a polygon with the given
vertices.factory - RoundedPolygon.pill({double width = 2, double height = 1, double smoothing = 0, Offset center = Offset.zero})
-
Creates a pill about
center,widthwide andheighthigh: a rectangle capped by a semicircle at either end of its longer dimension.factory -
RoundedPolygon.pillStar({double width = 2, double height = 1, int numVerticesPerRadius = 8, double innerRadiusRatio = 0.5, CornerRounding rounding = CornerRounding.unrounded, CornerRounding? innerRounding, List<
CornerRounding> ? perVertexRounding, double vertexSpacing = 0.5, double startLocation = 0, Offset center = Offset.zero}) -
Creates a pill star about
center,widthwide andheighthigh: a RoundedPolygon.pill with inner and outer radii along its outline, the way a RoundedPolygon.star has them along a circle, withnumVerticesPerRadiusvertices on each.factory -
RoundedPolygon.rectangle({double width = 2, double height = 2, CornerRounding rounding = CornerRounding.unrounded, List<
CornerRounding> ? perVertexRounding, Offset center = Offset.zero}) -
Creates a rectangle
widthwide andheighthigh aboutcenter, with optional rounding at its four corners.factory -
RoundedPolygon.star({required int numVerticesPerRadius, double radius = 1, double innerRadius = 0.5, CornerRounding rounding = CornerRounding.unrounded, CornerRounding? innerRounding, List<
CornerRounding> ? perVertexRounding, Offset center = Offset.zero}) -
Creates a star about
center, withnumVerticesPerRadiusvertices on the outerradiusalternating with as many on theinnerRadius.factory
Properties
- hashCode → int
-
The hash code for this object.
latefinal
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
normalized(
) → RoundedPolygon - Returns a new RoundedPolygon, moving and resizing this one, so it's completely inside the (0, 0) -> (1, 1) square, centered if there is extra space in one direction.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override