toNative method

RRect toNative(
  1. GRect rect
)

Returns a native Flutter RRect instance based on this GRectCornerRadius instance.

The RRect instance is built using the specified GRect instance as its bounding box and the corner radii for each of its corners.

Implementation

RRect toNative(GRect rect) {
  final tl = topLeft == 0 ? Radius.zero : Radius.circular(topLeft);
  final tr = topRight == 0 ? Radius.zero : Radius.circular(topRight);
  final br = bottomRight == 0 ? Radius.zero : Radius.circular(bottomRight);
  final bl = bottomLeft == 0 ? Radius.zero : Radius.circular(bottomLeft);
  return RRect.fromLTRBAndCorners(
    rect.left,
    rect.top,
    rect.right,
    rect.bottom,
    topLeft: tl,
    topRight: tr,
    bottomLeft: bl,
    bottomRight: br,
  );
}