I have to use IndexedStack to maintain the state of my widgets for my BottomNavigationBar. Now i want to use AnimatedSwitcher (or an alternative) to create an animation when
Try to add key to your IndexedStack so your code will look like:
body: AnimatedSwitcher(
duration: Duration(milliseconds: 200),
child: IndexedStack(
key: ValueKey(_currentIndex),
children: _tabs.map((t) => t.widget).toList(),
index: _currentIndex,
),
)
The key is changed so AnimatedSwitcher will know that it's child is need to rebuild.