The short answer is that just add currentIndex as one of the parameter inside your navBarSection . Inside home. dart , just pass the currentIndex of the page.
Read moreWhat is Valuelistenablebuilder in Flutter?
A widget whose content stays synced with a ValueListenable . Given a ValueListenable<T> and a builder which builds widgets from concrete values of T , this class will automatically register itself as a listener of the ValueListenable and call the builder with updated values when the value changes.
Read moreWhat is the alternative of setState in Flutter?
The short answer is that just add currentIndex as one of the parameter inside your navBarSection . Inside home. dart , just pass the currentIndex of the page.
Read moreWhat is change notifier in Flutter?
ChangeNotifier is a simple class included in the Flutter SDK which provides change notification to its listeners . In other words, if something is a ChangeNotifier , you can subscribe to its changes.
Read more