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