container method

Widget container({
  1. Color? color,
  2. DecorationImage? image,
  3. BoxBorder? border,
  4. BorderRadiusGeometry? borderRadius,
  5. List<BoxShadow>? boxShadow,
  6. Gradient? gradient,
  7. BlendMode? backgroundBlendMode,
  8. BoxShape shape = BoxShape.rectangle,
  9. EdgeInsetsGeometry? padding,
  10. EdgeInsetsGeometry? margin,
  11. double? width,
  12. double? height,
  13. BoxConstraints? constraints,
  14. AlignmentGeometry? alignment,
})

Wraps this widget in a Container with the given decoration parameters.

Implementation

Widget container({
  Color? color,
  DecorationImage? image,
  BoxBorder? border,
  BorderRadiusGeometry? borderRadius,
  List<BoxShadow>? boxShadow,
  Gradient? gradient,
  BlendMode? backgroundBlendMode,
  BoxShape shape = BoxShape.rectangle,
  EdgeInsetsGeometry? padding,
  EdgeInsetsGeometry? margin,
  double? width,
  double? height,
  BoxConstraints? constraints,
  AlignmentGeometry? alignment,
}) {
  return Container(
    decoration: BoxDecoration(
      color: color,
      image: image,
      border: border,
      borderRadius: borderRadius,
      boxShadow: boxShadow,
      gradient: gradient,
      backgroundBlendMode: backgroundBlendMode,
      shape: shape,
    ),
    padding: padding,
    margin: margin,
    width: width,
    height: height,
    constraints: constraints,
    alignment: alignment,
    child: this,
  );
}