padded method
Adds a Padding widget around the current widget. Priority of padding is as follows:
top
andbottom
/left
andright
vertical
andhorizontal
all
Implementation
Widget padded({
double? all,
double? horizontal,
double? vertical,
double? top,
double? bottom,
double? left,
double? right,
Key? key,
}) {
return Padding(
key: key,
padding: EdgeInsets.only(
top: top ?? vertical ?? all ?? 0,
bottom: bottom ?? vertical ?? all ?? 0,
left: left ?? horizontal ?? all ?? 0,
right: right ?? horizontal ?? all ?? 0,
),
child: this,
);
}