Description
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 :
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 :
- Any tab is pressed (All TABS get rebuilt regardless of which tab is pressed)
- Testing in a Tablet, Orientation changes causes ALL Tabs to get rebuilt.
- Keyboard input on 1 tab causes ALL tabs to get rebuilt
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?