double centerVertically(double maxHeight, Size s) { if (maxHeight == double.infinity) { return 0; } return (maxHeight - s.height) / 2; }