CustomColumn function

Widget CustomColumn(
  1. List<Widget> children, [
  2. double spacing = 24,
  3. bool centerH = true,
  4. bool centerV = true,
])

Implementation

Widget CustomColumn(List<Widget> children, [double spacing = 24, bool centerH = true, bool centerV = true]) {
  List<Widget> content = [];

    for (int i = 0; i < children.length; i++) {
        content.add(children[i]);
        if (i < children.length - 1) {
            content.add(Spacing(spacing));
        }
    }
    return Column(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: centerH ? MainAxisAlignment.center : MainAxisAlignment.start,
        crossAxisAlignment: centerV ? CrossAxisAlignment.center : CrossAxisAlignment.start,
        children: content,
    );
}