boxDecoration method

Container boxDecoration({
  1. Color? color,
  2. DecorationImage? image,
  3. Border? border,
  4. BorderRadius? borderRadius,
  5. List<BoxShadow>? boxShadow,
  6. Gradient? gradient,
  7. BlendMode? backgroundBlendMode,
  8. BoxShape shape = BoxShape.rectangle,
})

设置复杂的 BoxDecoration,支持链式调用

Implementation

Container boxDecoration({
  Color? color,
  DecorationImage? image,
  Border? border,
  BorderRadius? borderRadius,
  List<BoxShadow>? boxShadow,
  Gradient? gradient,
  BlendMode? backgroundBlendMode,
  BoxShape shape = BoxShape.rectangle,
}) {
  return Container(
    decoration: BoxDecoration(
      color: color,
      image: image,
      border: border,
      borderRadius: borderRadius,
      boxShadow: boxShadow,
      gradient: gradient,
      backgroundBlendMode: backgroundBlendMode,
      shape: shape,
    ),
    child: this,
  );
}