Skip to content

I demonstrate the ability of TabBarView to notify the view with the correct index without delay. Documentation in the rows of the code.

Notifications You must be signed in to change notification settings

vellt/TabBarView-Notifies-The-View-Without-Delay

Repository files navigation

TabBarView notifies the View without delay⏱️

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:

https://github.com/vellt/TabBarView-Notifies-The-View-Without-Delay/blob/main/1675099977893.gif?raw=true

About

I demonstrate the ability of TabBarView to notify the view with the correct index without delay. Documentation in the rows of the code.

Topics

Resources

Stars

Watchers

Forks