offsetForVertical function

int offsetForVertical(
  1. VerticalAlign align,
  2. int containerHeight,
  3. int childHeight
)

Implementation

int offsetForVertical(
  VerticalAlign align,
  int containerHeight,
  int childHeight,
) {
  return switch (align) {
    VerticalAlign.top => 0,
    VerticalAlign.center => (containerHeight - childHeight) ~/ 2,
    VerticalAlign.bottom => containerHeight - childHeight,
  };
}