Flutter shared_preferences not persistent?
You can check this solution. As mentioned, you need to call the SharedPreference instance in initState.
You can check this solution. As mentioned, you need to call the SharedPreference instance in initState.