fitWidth method
Implementation
int fitWidth() {
if (children.isEmpty) return 0;
int requiredWidth = 0;
if (direction == Axis.horizontal) {
requiredWidth += ((children.length - 1) * childGap);
}
for (var child in children) {
if (direction == Axis.horizontal) {
requiredWidth += child.fitWidth();
} else {
requiredWidth = max(child.fitWidth(), requiredWidth);
}
}
return requiredWidth + 20;
}