How is _onTappedItem parameter passed?

In section 2 chapter 3 (basic widgets) the _onTappedItem function has a Parameter that is taking in an int index, but when we call the _onTappedItem in the bottomNavigationBar we aren’t passing in any parameters to the function. How does the function know what the index is?

void _onTappedItem(int index) {
    setState(() {
      _selectedIndex = index;

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
      body: pages[_selectedIndex],
      bottomNavigationBar: BottomNavigationBar(
        currentIndex: _selectedIndex,
        onTap: _onTappedItem,
        selectedItemColor: Theme.of(context).textSelectionTheme.selectionColor,
        items: <BottomNavigationBarItem>[

Think of _onTappedItem the function you trigger when someone taps on a tab bar item! onTap will return the index to _onTappedItem