Reputation: 81
I use method getApplicationDocumentsDirectory()
in path_provider
to get the image path.
However, when I flutter run
or update my app in AppStore, the path got by getApplicationDocumentDirectory()
will change and I can't get the image by the path stored before.
Upvotes: 4
Views: 2082
Reputation: 81
Actually, it's easy to solve it.
I used the absolute path of the image so every time I rerun the app, the container id will change, so I cannot get the image with the previous path.
To solve it, you need to use relative path.
Relative Resource: https://github.com/flutter/flutter/issues/23957
Upvotes: 2