getPadding method

EdgeInsets getPadding({
  1. required bool toLeft,
  2. required TodayTableCellType type,
  3. bool large = false,
  4. bool isChild = false,
})

Implementation

EdgeInsets getPadding({
  required bool toLeft,
  required TodayTableCellType type,
  bool large = false,
  bool isChild = false,
}) {
  TodaySpacing baseSide = TodaySpacing.tdsSpace4;
  if (!large &&
      [
        TodayTableCellType.input,
        TodayTableCellType.more,
        TodayTableCellType.select,
      ].contains(type)) {
    baseSide = TodaySpacing.tdsSpace3;
  }

  if (toLeft && type == TodayTableCellType.more) {
    return EdgeInsets.only(
      right: baseSide.spacing,
      top: baseSide.spacing,
      bottom: baseSide.spacing,
    );
  }

  if (type == TodayTableCellType.more) {
    return EdgeInsets.only(
      left: TodaySpacing.tdsSpace1.spacing,
      right: baseSide.spacing,
      top: baseSide.spacing,
      bottom: baseSide.spacing,
    );
  }

  if (isChild) {
    return EdgeInsets.symmetric(
      horizontal: TodaySpacing.tdsSpace4.spacing,
      vertical: 0,
    );
  }

  return EdgeInsets.all(
    baseSide.spacing,
  );
}