benyaminbeyzaie / circular_bottom_navigation

Circular bottom navigation is a bottom navigation library for flutter with circular indicator and cool animations.
BSD 3-Clause "New" or "Revised" License
659 stars 97 forks source link

Library is not working #15

Closed bdairy closed 2 years ago

bdairy commented 5 years ago

Used the same exact setup in the documentation..

image

Had this error

image

Added the controller... the index of the call back always returns 0.... ???

raegartargarian commented 5 years ago

this is my problem too, any suggestions?

tedchuang commented 5 years ago

I can't see your code but i think you're using a CircularBottomNavigation in each of your subsequent widgets called up by the bottom nav. If not, just ignore this post LOL

Ideally, you would set up a home page scaffold with a container widget on the top and the CircularBottomNavigation at the bottom. Each tap of the bottom navigation will change the said container widget only. The same bottom nav bar is visible throughout the tab choices, unless you push to another page route.

Don't include another instance of the CircularBottomNavigation in the container widgets. Ideally you should only have call the CircularBottomNavigation once in your entire app.

harshbarnwal commented 4 years ago

@bdairy I have same problem, it arises because you are not providing CircularBottomNavigationController. Just declare and initialize CircularBottomNavigationController with the index of item you want to open application like... int selectedPos = 0; var _navigationController = new CircularBottomNavigationController(selectedPos); pass this controller to CircularBottomNavigation and in selectedCallback method save do like selectedCallback: (int selectedPos) { this.selectedPos = selectedPos; } adding these resolved my problem.

benyaminbeyzaie commented 2 years ago

Closing this issue cause it is not active for years, If the issue persists please open another one and describe with details. Adding your code as an attachments maybe helpful! Thanks!