Some specific mobile devices are: Xiaomi redmi note 7 with Chrome browser and Xiaomi redmi note 7 pro with Firefox browser. When saving and switching screens and then hiding the application. When you reopen the application, you will be returned to the screen before switching the screen and the data saved with sharedpreferences will be returned to the previous screen. But when the application is turned off and on again, the data becomes saved when finished.
Some specific mobile devices are: Xiaomi redmi note 7 with Chrome browser and Xiaomi redmi note 7 pro with Firefox browser. When saving and switching screens and then hiding the application. When you reopen the application, you will be returned to the screen before switching the screen and the data saved with sharedpreferences will be returned to the previous screen. But when the application is turned off and on again, the data becomes saved when finished.
SharedPreferences pref = await SharedPreferences.getInstance(); pref.setBool('hasLogin', true); Navigator.pushReplacementNamed(context, '/navigation');