build method
Widget
Implementation
@override
Widget build(BuildContext context) {
return Container(
width: width,
height: height,
padding: padding,
margin: margin,
decoration: BoxDecoration(
shape: isCircle ? BoxShape.circle : BoxShape.rectangle,
color: color,
borderRadius: isCircle ? null : radius,
border: border,
boxShadow: boxShadows,
gradient: gradient,
),
constraints: constraints,
clipBehavior: clipBehavior, // 设置Clip行为
child: child,
);
}