roundedRect static method

Path roundedRect(
  1. Rect rect, {
  2. double radius = 0,
  3. double? topLeft,
  4. double? topRight,
  5. double? bottomLeft,
  6. double? bottomRight,
})

Creates a rounded rectangle clip path.

Implementation

static Path roundedRect(
  Rect rect, {
  double radius = 0,
  double? topLeft,
  double? topRight,
  double? bottomLeft,
  double? bottomRight,
}) {
  return Path()
    ..addRRect(RRect.fromRectAndCorners(
      rect,
      topLeft: Radius.circular(topLeft ?? radius),
      topRight: Radius.circular(topRight ?? radius),
      bottomLeft: Radius.circular(bottomLeft ?? radius),
      bottomRight: Radius.circular(bottomRight ?? radius),
    ));
}