uniformMorphRadius function
- ShapeBorder shape,
- Size size
The single radius of a shape when it can be expressed by one (Circle, Stadium, rrect/superellipse with equal corners); null for exotic shapes.
Implementation
double? uniformMorphRadius(ShapeBorder shape, Size size) {
if (shape is CircleBorder || shape is StadiumBorder) {
return size.shortestSide / 2;
}
if (shape is RoundedRectangleBorder) {
return _uniformCorner(shape.borderRadius, size);
}
if (shape is RoundedSuperellipseBorder) {
return _uniformCorner(shape.borderRadius, size);
}
return null;
}