Pad constructor

const Pad({
  1. double all = 0.0,
  2. double vertical = 0.0,
  3. double horizontal = 0.0,
  4. double left = 0.0,
  5. double top = 0.0,
  6. double right = 0.0,
  7. double bottom = 0.0,
})

Creates insets with the given values:

  • top, bottom, left and right pixels.
  • all pixels will be added to the top, bottom, left and right.
  • vertical pixels will be added to the top and bottom.
  • horizontal pixels 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:

const Pad(all: 40.0, top: 10);

Implementation

const Pad({
  double all = 0.0,
  double vertical = 0.0,
  double horizontal = 0.0,
  double left = 0.0,
  double top = 0.0,
  double right = 0.0,
  double bottom = 0.0,
}) : super.fromLTRB(
        all + left + horizontal,
        all + top + vertical,
        all + right + horizontal,
        all + bottom + vertical,
      );