Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No loaded items after updating to 3.0 #30

Closed
nohli opened this issue Oct 26, 2019 · 11 comments
Closed

No loaded items after updating to 3.0 #30

nohli opened this issue Oct 26, 2019 · 11 comments

Comments

@nohli
Copy link
Contributor

nohli commented Oct 26, 2019

Thanks for this package, I really like localstorage and never had issues before.

After updating to 3.0.0+2 my app did not load any items with the following code:

final LocalStorage storage = LocalStorage('filename');

  Widget build(BuildContext context) => FutureBuilder(
        future: storage.ready,
        builder: (BuildContext context, snapshot) {
          if (snapshot.hasData) {
            storage.getItem('listname');
            ...

Does loading have to be async now - and how do I implement it?

@lesnitsky
Copy link
Owner

@nohli are you using this plugin on desktop or mobile?

@nohli
Copy link
Contributor Author

nohli commented Oct 26, 2019

On mobile, only tried on iOS 13.1.3 actually.

Latest Flutter stable.

@lesnitsky
Copy link
Owner

lesnitsky commented Oct 26, 2019 via email

@nohli
Copy link
Contributor Author

nohli commented Oct 26, 2019

Latter

I downgraded to 2.0.0 and it loaded the lists.
Upgraded again and it didn‘t load.

@lesnitsky
Copy link
Owner

lesnitsky commented Oct 26, 2019 via email

@nohli
Copy link
Contributor Author

nohli commented Oct 26, 2019

Yeah of course, just wanted to let you know.
(the readme says breaking change for desktop only)

Maybe there is an option for my users not to lose all their data and updating.

I‘m really fine with 2.0 which works great.

Thanks for the plugin and replying!

@tehort
Copy link

tehort commented Oct 29, 2019

I also have the same problem, iOS 13.2, had to roll-back to version 2.0.0
Doesn`t happen with Android and 3.0.0

@nohli
Copy link
Contributor Author

nohli commented Nov 3, 2019

Any news?

It seems like you've changed the path or something.

If I upgrade, the old lists are gone. I can save new lists.
If I then downgrade, the new lists are gone, and the old lists appear.
So I have two localstorages, depending on the version (2 or 3).

Any chance to easily migrate through your package?

@lesnitsky
Copy link
Owner

@nohli I found the root cause, v3.0 doesn't add .json extension, so if you want to use data saved using v2 you need to add .json extension on your own

so if v2 code was final storage = new LocalStorage('my_data')
v3 equivalent would be new LocalStorage('my_data.json')

I'm adding this to readme

@lesnitsky
Copy link
Owner

@nohli
Copy link
Contributor Author

nohli commented Nov 3, 2019

That's great, thanks!!
Easy fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants