RoundedPolygon class final
The RoundedPolygon class allows simple construction of polygonal shapes with optional rounding at the vertices. Polygons can be constructed with either the number of vertices desired or an ordered list of vertices.
- Available extensions
Constructors
- RoundedPolygon.circle({int numVertices = 8, double radius = 1.0, double centerX = 0.0, double centerY = 0.0})
-
factory
-
RoundedPolygon.fromFeatures({required List<
Feature> features, double centerX = .nan, double centerY = .nan}) -
factory
- RoundedPolygon.fromPolygon(RoundedPolygon source)
-
factory
-
RoundedPolygon.fromVertices({required List<
double> vertices, CornerRounding rounding = .unrounded, List<CornerRounding> ? perVertexRounding, double centerX = .minPositive, double centerY = .minPositive}) -
factory
- RoundedPolygon.pill({double width = 2.0, double height = 1.0, double smoothing = 0.0, double centerX = 0.0, double centerY = 0.0})
-
factory
-
RoundedPolygon.pillStar({double width = 2.0, double height = 1.0, int numVerticesPerRadius = 8, double innerRadiusRatio = 0.5, CornerRounding rounding = .unrounded, CornerRounding? innerRounding, List<
CornerRounding> ? perVertexRounding, double vertexSpacing = 0.5, double startLocation = 0.0, double centerX = 0.0, double centerY = 0.0}) -
factory
-
RoundedPolygon.rectangle({double width = 2.0, double height = 2.0, CornerRounding rounding = .unrounded, List<
CornerRounding> ? perVertexRounding, double centerX = 0.0, double centerY = 0.0}) -
factory
-
RoundedPolygon.regular({required int numVertices, double radius = 1.0, double centerX = 0.0, double centerY = 0.0, CornerRounding rounding = .unrounded, List<
CornerRounding> ? perVertexRounding}) -
This constructor takes the number of vertices in the resulting polygon.
These vertices are positioned on a virtual circle around a given center
with each vertex positioned
radiusdistance from that center, equally spaced (with equal angles between them). If no radius is supplied, the shape will be created with a default radius of 1, resulting in a shape whose vertices lie on a unit circle, with width/height of 2. That default polygon will probably need to be rescaled using transformed into the appropriate size for the UI in which it will be drawn.factory -
RoundedPolygon.star({required int numVerticesPerRadius, double radius = 1.0, double innerRadius = 0.5, CornerRounding rounding = .unrounded, CornerRounding? innerRounding, List<
CornerRounding> ? perVertexRounding, double centerX = 0.0, double centerY = 0.0}) -
factory
Properties
Methods
-
calculateBounds(
{bool approximate = true}) → Rect -
calculateMaxBounds(
) → Rect -
normalized(
{bool approximate = true}) → RoundedPolygon -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toPath(
{double startAngle = 0.0}) → Path -
Available on RoundedPolygon, provided by the RoundedPolygonExtension extension
-
toString(
) → String -
A string representation of this object.
override
-
transformed(
PointTransformer f) → RoundedPolygon
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override