Flutter Widget - BoxDecoration (Flutter Series)

Опубликовано: 18 Май 2026
на канале: FixBug Dev
1,315
52

An immutable description of how to paint a box.
The BoxDecoration class provides a variety of ways to draw a box.
The box has a border, a body, and may cast a boxShadow.
The shape of the box can be a circle or a rectangle. If it is a rectangle, then the borderRadius property controls the roundness of the corners.
The body of the box is painted in layers. The bottom-most layer is the color, which fills the box. Above that is the gradient, which also fills the box. Finally there is the image, the precise alignment of which is controlled by the DecorationImage class.
The border paints over the body; the boxShadow, naturally, paints below it.