getShape function
OutlinedBorder
getShape({
- required CShapeBorder shape,
- required CornerRadius radius,
- ColorRGBA? borderColor,
- double? borderWidth,
Implementation
OutlinedBorder getShape({
required CShapeBorder shape,
required CornerRadius radius,
ColorRGBA? borderColor,
double? borderWidth,
}) {
final BorderSide side =
borderColor != null && borderWidth != null && borderWidth > 0
? BorderSide(
color: borderColor.toFlutterColor(),
width: borderWidth,
)
: BorderSide.none;
switch (shape) {
case CShapeBorder.rectangle:
return RoundedRectangleBorder(side: side);
case CShapeBorder.circle:
return CircleBorder(side: side);
case CShapeBorder.stadium:
return StadiumBorder(side: side);
case CShapeBorder.roundedRectangle:
return RoundedRectangleBorder(
borderRadius: radius.borderRadius,
side: side,
);
case CShapeBorder.continuousRectangle:
return ContinuousRectangleBorder(
borderRadius: radius.borderRadius,
side: side,
);
case CShapeBorder.beveledRectangle:
return BeveledRectangleBorder(
borderRadius: radius.borderRadius,
side: side,
);
}
}