I've got into dart and flutter itself just a few days ago. I'm trying to achieve some basic functionality for the app so I started with navigation among certain views/pages/routes. I found several ways of doing so but none of these actually helped me to get to the point where everything is working as intended. I. e.
https://medium.com/flutter/getting-to-the-bottom-of-navigation-in-flutter-b3e440b9386 - this page is really helpful but lacks the preserve state if I may call it so - what I mean is that after minimizing the app and going back to it the previous state isn't saved - seems like the page is rebuilding itself once again. Here is the video with custom navigation:
https://www.youtube.com/watch?v=EcAwFpC9S8s - quite helpful but not really for my problem I guess. Nevertheless I'm not going to bore you with plain code I just want to ask if someone could write me the simple steps what to do to achieve what I'm looking for. Let's assume that I have MyApp class - which is a MaterialApp with defined routes and two pages - MainPage and SecondPage. MainPage is the starting page with a bottomNavigationBar included and the SecondPage can be accessed from this bottomNavigationBar. SecondPage has some textfield so when the user type something and either go back to the another page from the bottomNavigationBar or minimize the app - the SecondPage would stay the same without building itself once again. So is someone able to help me out with this? What to do from the top to the bottom what should be wrapped in what and should I use any Keys - if so then where and so on just to make this functionality working.
I guess I'm familiarized with the concept of Navigator, Keys, Stacks, pushing and popping routes the only thing I couldn't comprehend is the idea of using GlobalKey<NavigatorState> to push routes instead of using just Navigator. I went through this question on Stackoverflow but it didn't go well:
https://stackoverflow.com/questions/49681415/flutter-persistent-navigation-bar-with-named-routes - I mean it helped a little bit but after all it doesn't work as intended - surely the preserve state after minimizing does not work I suppose.