ButtonGroupData.verticalIndex constructor
Creates group data for a button at index in a vertical group of length buttons.
Returns:
- verticalTop for the first button (index 0)
- zero for middle buttons
- verticalBottom for the last button
- none if group has only one button
Implementation
factory ButtonGroupData.verticalIndex(int index, int length) {
if (length <= 1) {
return none;
} else {
if (index == 0) {
return verticalTop;
} else if (index == length - 1) {
return verticalBottom;
} else {
return zero;
}
}
}