getPadding method

EdgeInsets getPadding(
  1. int index,
  2. int length
)

Implementation

EdgeInsets getPadding(int index, int length) {
  final space = spacing ?? flexSpacing;
  if (contentPadding) {
    return EdgeInsets.symmetric(horizontal: space / 2);
  }
  return EdgeInsets.fromLTRB(
    index == 0 ? 0 : space / 2,
    0,
    index == length - 1 ? 0 : space / 2,
    0,
  );
}