RoundedPolygon.rectangle constructor
RoundedPolygon.rectangle({
- double width = 2,
- double height = 2,
- CornerRounding rounding = CornerRounding.unrounded,
- List<
CornerRounding> ? perVertexRounding, - double centerX = 0,
- double centerY = 0,
Implementation
factory RoundedPolygon.rectangle({
double width = 2,
double height = 2,
CornerRounding rounding = CornerRounding.unrounded,
List<CornerRounding>? perVertexRounding,
double centerX = 0,
double centerY = 0,
}) {
final left = centerX - width / 2;
final top = centerY - height / 2;
final right = centerX + width / 2;
final bottom = centerY + height / 2;
return RoundedPolygon.fromVertices(
[right, bottom, left, bottom, left, top, right, top],
rounding: rounding,
perVertexRounding: perVertexRounding,
centerX: centerX,
centerY: centerY,
);
}