Protected against bots by Yandex SmartCaptcha. Data processing policy
Padding
Adds space around its child.
Type:
single-child
Padding
#padding all 16
Text "Padded text"
Nested structures
#padding
Defines the padding. The first positional argument sets the mode:
all
,
symmetric
,
only
,
fromLTRB
.
// Uniform padding
#padding all 16
// Symmetric
#padding symmetric horizontal:50 vertical:25
// Per side
#padding only left:10 top:15 right:20 bottom:25
// LTRB (positional arguments)
#padding fromLTRB 10 15 20 25
Examples
Horizontal padding
Padding
#padding symmetric horizontal:80
Text "Text with side padding"
Padding inside a decorated container
DecoratedBox
#decoration color:#36345E
#borderRadius circular 20
Padding
#padding all 24
Column spacing:8
Text "Title"
Text "Description"
See also
- SizedBox — fixed size without padding
- DecoratedBox — a decorative container, often used together with Padding