RoundedPolygon.rectangle constructor
RoundedPolygon.rectangle({
- double width = 2.0,
- double height = 2.0,
- CornerRounding rounding = .unrounded,
- List<
CornerRounding> ? perVertexRounding, - double centerX = 0.0,
- double centerY = 0.0,
Implementation
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,
}) {
final left = centerX - width / 2.0;
final top = centerY - height / 2.0;
final right = centerX + width / 2.0;
final bottom = centerY + height / 2.0;
return .fromVertices(
vertices: [right, bottom, left, bottom, left, top, right, top],
rounding: rounding,
perVertexRounding: perVertexRounding,
centerX: centerX,
centerY: centerY,
);
}