I want to init store with value from localstorage, but it always return null there.
Then I tried to getItem from localstorage in widget with this code:
print('from local storage: '+localStorage.getItem('user').toString());
And i get next output:
Performing hot restart...
Syncing files to device sdk gphone x86 arm...
Restarted application in 936ms.
I/flutter ( 4982): from local storage: null
I/flutter ( 4982): from local storage: {socialAccounts: [], culture: {key: en}, currency: {key: RUB}, id: 6, email: ..... }
So, it is being called two times, where first returns null and second - actual value.
What's the problem?
I want to init store with value from localstorage, but it always return null there. Then I tried to getItem from localstorage in widget with this code:
print('from local storage: '+localStorage.getItem('user').toString());
And i get next output:So, it is being called two times, where first returns null and second - actual value. What's the problem?