I have a web site built with flutter for web and currently, am trying to save to web local storage or cookie but can\'t seem to find any plugin or way to ar
I ran into a similar issue where my preferences weren't being persisted across runs. I thought window.localStorage was broken. I discovered that Flutter was simply launching with a new port number every time by default, so window.localStorage was getting wiped out.
This ticket talks about setting an explicit port. This fixed my issue, and now window.localStorage persists across runs:
https://github.com/Dart-Code/Dart-Code/issues/1769
In VS Code, you can set the port number in your launch.json file:
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"args": ["--web-port", "8686"]
},