getMarginOrPadding function

EdgeInsetsGeometry getMarginOrPadding({
  1. double? all,
  2. double? left,
  3. double? top,
  4. double? right,
  5. double? bottom,
})

This method is used to get padding or margin responsively

Implementation

EdgeInsetsGeometry getMarginOrPadding({
  double? all,
  double? left,
  double? top,
  double? right,
  double? bottom,
}) {
  if (all != null) {
    left = all;
    top = all;
    right = all;
    bottom = all;
  }
  return EdgeInsets.only(
    left: getHorizontalSize(
      left ?? 0,
    ),
    top: getVerticalSize(
      top ?? 0,
    ),
    right: getHorizontalSize(
      right ?? 0,
    ),
    bottom: getVerticalSize(
      bottom ?? 0,
    ),
  );
}