I encountered an interesting problem throgh a project, with many open issues on the Web, such as:
I demonstrate the ability of TabBarView to notify the view with the correct index without delay. ✅
Documentation in the the rows of the code. ✍️
The soul of the project:
// indexController.change() comes from IndexController, which is declared in main.dart.
var _ = DefaultTabController.of(context);
_?.animation!.addListener(() {
indexController.change(newValue:(_.indexIsChanging)?_.index:_.animation!.value.round());
});
🎥 Here is a preview GIF, where you can see, how it works: