withGap method
Adds a gap between each child.
Implementation
Column withGap(double space) {
assert(space >= 0, 'Space should be a non-negative value.');
List<Widget> newChildren = [];
for (int i = 0; i < children.length; i++) {
newChildren.add(children[i]);
if (i < children.length - 1) {
newChildren.add(SizedBox(height: space));
}
}
return Column(
key: key,
mainAxisAlignment: mainAxisAlignment,
mainAxisSize: mainAxisSize,
crossAxisAlignment: crossAxisAlignment,
textDirection: textDirection,
verticalDirection: verticalDirection,
textBaseline: textBaseline,
children: newChildren,
);
}