parameter animationDuration let's you control the Duration of the animation, when switching the section.
warning in stateful Widget, that all variables must be immutable fixed, because selectedIndex is now final and passed to the State, where it can be modified.