isFirstButton function
Determines if this is the first child that is being laid out.
Implementation
bool isFirstButton(int index, int length, TextDirection textDirection) {
return (index == 0 && textDirection == TextDirection.ltr) ||
(index == length - 1 && textDirection == TextDirection.rtl);
}