Home > Back-end >  Is there a way to make a separate navigation inside a stream builder - Flutter
Is there a way to make a separate navigation inside a stream builder - Flutter

Time:09-07

Basically I have a streambuilder as my “home” in main.dart that returns AuthGate (another stream builder) if there’s a network connection or a separate screen if there’s no connection. This works most of the time but when I use Navigator.of(context).push or showModalBottomSheet, the Navigator leaves the stream builder so I can’t observe network changes until the screen is popped. I can make a variable inside AuthGate that decides which screen to return instead of automatically returning TabBarView but that seems messy and complicated. Is there a “native” way to keep all the navigation inside a stream builder in Flutter?

CodePudding user response:

So when you navigate to new page, all of pervious codes went to background (especially navigate) so one solution is show message based on "Not your internet connection" with listing and using a state management package like provider, bloc or ...

  • Related