Container
Box container with styling
A box: background colour or gradient, padding, margin, corner radius, alignment and explicit size.
Methods
Container(options?)WidgetNodeA container with styling.
- options Any
- backgroundColor Color
A flat fill.
- backgroundGradient LinearGradient
A gradient fill. Wins over backgroundColor.
- padding EdgeInsets
Space inside the border.
- margin EdgeInsets
Space outside it.
- borderRadius Number
Rounds all four corners.
- alignment Alignment
Where the child sits when the box is larger than it.
- width Any
A number of points, or a Size.
- height Any
A number of points, or a Size.
- child WidgetNode
The node inside.
- backgroundColor Color
Examples
Styled card
Container({
backgroundColor: Color.hex("#1e1e1e"),
padding: EdgeInsets.all(16),
borderRadius: 12,
child: Text("Card content", {
color: Color.white()
})
})