padding method

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

Returns a new widget with the given padding.

Implementation

Widget padding({
  double? all,
  double? horizontal,
  double? vertical,
  double? left,
  double? top,
  double? right,
  double? bottom,
}) {
  return Padding(
    padding: all != null
        ? .all(all)
        : .only(
            left: left ?? (horizontal ?? 0),
            right: right ?? (horizontal ?? 0),
            top: top ?? (vertical ?? 0),
            bottom: bottom ?? (vertical ?? 0),
          ),
    child: this,
  );
}