RRect.fromRectAndCorners constructor

RRect.fromRectAndCorners(Rect rect, { Radius topLeft: Radius.zero, Radius topRight: Radius.zero, Radius bottomRight: Radius.zero, Radius bottomLeft: Radius.zero })

Construct a rounded rectangle from its bounding box and and topLeft, topRight, bottomRight, and bottomLeft radii.

The corner radii default to Radius.zero, i.e. right-angled corners

Implementation

RRect.fromRectAndCorners(
  Rect rect,
  {
    Radius topLeft: Radius.zero,
    Radius topRight: Radius.zero,
    Radius bottomRight: Radius.zero,
    Radius bottomLeft: Radius.zero
  }
) {
  _value
    ..[0] = rect.left
    ..[1] = rect.top
    ..[2] = rect.right
    ..[3] = rect.bottom
    ..[4] = topLeft.x
    ..[5] = topLeft.y
    ..[6] = topRight.x
    ..[7] = topRight.y
    ..[8] = bottomRight.x
    ..[9] = bottomRight.y
    ..[10] = bottomLeft.x
    ..[11] = bottomLeft.y;
}