0 purchases
cupertino rrect
Rounded rectangle with smoother transition between straight and curved parts used in macOS and iOS.
Below is a cupertino rounded rectangle (squircle) in blue color overlayed on top of a regular rounded rectangle with the same corner radius (100) in red:
Path algorithm is based on this article.
Usage #
Creating "Cupertino" rounded rectangle path: #
import 'package:cupertino_rrect/cupertino_rrect.dart';
final path = Path();
path.addCupertinoRRect(rrect);
copied to clipboard
Using CupertinoRectangleBorder: #
import 'package:cupertino_rrect/cupertino_rrect.dart';
Container(
decoration: ShapeDecoration(
shape: CupertinoRectangleBorder(
borderRadius: BorderRadius.circular(radius),
),
),
),
copied to clipboard
Additional information #
Example app is located in example directory. Example is also available online.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.