applyRadius method
void
applyRadius(
- String style
)
Implementation
void applyRadius(String style) {
try {
final metric = style.split("-")[1];
if (metric == "none") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(0.0));
} else if (metric == "xs") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(1.0));
} else if (metric == "sm") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(2.0));
} else if (metric == "md") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(6.0));
} else if (metric == "lg") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(8.0));
} else if (metric == "xl") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(12.0));
} else if (metric == "2xl") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(16.0));
} else if (metric == "3xl") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(24.0));
} else if (metric == "full") {
boxDecoration =
boxDecoration.copyWith(borderRadius: BorderRadius.circular(9999.0));
}
} on RangeError catch (_) {
return;
}
}