paddingOnly method

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

Implementation

Widget paddingOnly({
  double? all,
  double? padding,
  double? top,
  double? bottom,
  double? left,
  double? right,
}) {
  if (all != null) {
    return Padding(
      padding: EdgeInsets.all(all),
      child: this,
    );
  }

  return Padding(
    padding: EdgeInsets.only(
      left: left ?? padding ?? all ?? 0,
      right: right ?? padding ?? all ?? 0,
      top: top ?? padding ?? all ?? 0,
      bottom: bottom ?? padding ?? all ?? 0,
    ),
    child: this,
  );
}