box method
容器控件 >>>
Implementation
Container box(
{double? width,
double? height,
Color? color,
EdgeInsets? padding,
double borderSize = 1,
Color borderColor = Colors.black,
double? cornerRadius}) {
BoxDecoration decoration = BoxDecoration(
color: color,
borderRadius:
cornerRadius != null ? BorderRadius.circular(cornerRadius) : null,
border: Border.all(width: borderSize, color: borderColor),
);
return Container(
child: this,
width: width,
height: height,
padding: padding,
decoration: decoration,
);
}