padded method

Widget padded({
  1. double? all,
  2. double? horizontal,
  3. double? vertical,
  4. double? top,
  5. double? bottom,
  6. double? left,
  7. double? right,
  8. Key? key,
})

Adds a Padding widget around the current widget. Priority of padding is as follows:

  1. top and bottom / left and right
  2. vertical and horizontal
  3. 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,
  );
}