width property
double
width
width of the group (sum of all BarChartRodData's width and spaces)
Implementation
double get width {
if (barRods.isEmpty) {
return 0;
}
if (groupVertically) {
return barRods.map((rodData) => rodData.width).reduce(max);
} else {
final sumWidth = barRods
.map((rodData) => rodData.width)
.reduce((first, second) => first + second);
final spaces = (barRods.length - 1) * barsSpace;
return sumWidth + spaces;
}
}