bizz84 / nested-navigation-demo-flutter

Nested navigation with BottomNavigationBar
https://codewithandrea.com/
MIT License
616 stars 139 forks source link

Solution is not performant #27

Open lAleksia opened 1 year ago

lAleksia commented 1 year ago

Hi there Andrea - it would be great to get your view on the questions I am raising.

I see that this example is an updated version based on what you originally wrote in Medium in 2018 :

https://medium.com/coding-with-flutter/flutter-case-study-multiple-navigators-with-bottomnavigationbar-90eb6caa6dbf.

The new updated version has been changed to accommodate GoRouter etc. I also notice that you have further explained this (and performance issues with your original approach) here :

https://codewithandrea.com/articles/flutter-bottom-navigation-bar-nested-routes-gorouter-beamer/

However, both approaches still cause unnecessary rebuilds for the entire widget tree. This happens when :

Furthermore, I have noticed considerable performance issues using OffStage - presumably this is because when the widget comes back 'onstage' based on it being the current tab selected, it gets completely rebuilt.

I see no reason why selecting 1 tab should rebuild ALL tabs so consequently - is a limitation of your use of GoRouter/Beamer or Flutter itself?