cornerRadiusWithClipRRectOnly method
Adds rounded corners to the widget using ClipRRect
with custom radii.
Container().cornerRadiusWithClipRRectOnly(topLeft: 10, bottomRight: 20);
Implementation
ClipRRect cornerRadiusWithClipRRectOnly({
int bottomLeft = 0,
int bottomRight = 0,
int topLeft = 0,
int topRight = 0,
}) {
return ClipRRect(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(bottomLeft.toDouble()),
bottomRight: Radius.circular(bottomRight.toDouble()),
topLeft: Radius.circular(topLeft.toDouble()),
topRight: Radius.circular(topRight.toDouble()),
),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: this,
);
}