BoxDecoration
BoxDecoration is a class in Flutter that provides styling options for a container. It allows developers to add a background color, border, box shadow, gradient, and more to a container.
Example:
To add a red background color and a blue border to a container, the BoxDecoration code would be:
Container(
decoration: BoxDecoration(
color: Colors.red,
border: Border.all(
color: Colors.blue,
width: 2.0,
),
),
child: Text('BoxDecoration'),
)Parameters
color: The background color of the container.
border: The border around the container. It can be customized with a color, width, and style.
borderRadius: The roundedness of the container's corners.
boxShadow: The shadow cast by the container. It can be customized with a color, blur radius, and offset.
gradient: A gradient that can be applied to the background of the container. It can be a linear or radial gradient.