Pad constructor
const
Pad({})
Creates insets with the given values:
top,bottom,leftandrightpixels.allpixels will be added to the top, bottom, left and right.verticalpixels will be added to the top and bottom.horizontalpixels will be added to the left and right.
You can also compose paddings. For example, for all directions with 40 pixels of padding, except the top with 50 pixels:
Pad(all: 40, top: 10);
Note constructor parameters all, vertical and horizontal are used only to compose
the final padding value. The resulting Pad object contains only left/right/top/bottom.
For example:
Pad(all: 40, vertical: 5, top: 10).top == (40 + 5 + 10) == 55;
Implementation
const Pad({
double all = 0,
double vertical = 0,
double horizontal = 0,
double left = 0,
double top = 0,
double right = 0,
double bottom = 0,
}) : super.fromLTRB(
all + left + horizontal,
all + top + vertical,
all + right + horizontal,
all + bottom + vertical,
);