onChanged property

ValueChanged<int>? onChanged
final

Called when the current index should be changed. If null, the bottom navigation items are considered disabled.

{@tool snippet}


int index = 0;

BottomNavigation(
  index: index,
  onChanged: (i) => setState(() => index = i),
)

{@end-tool}

Implementation

final ValueChanged<int>? onChanged;