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

When the network is lost the message "Reading image file ..." is printed but the image is not loaded #17

Closed
r-shahpasand opened this issue Aug 11, 2020 · 8 comments

Comments

@r-shahpasand
Copy link

When network is lost the message "Reading image file ..." is printed but the image doesn't load. With a network connection, the image is read from file and displayed properly.

@marcglasberg
Copy link
Owner

You mean, without internet it doesn't load from file? It tries to load from file before trying the internet, so that's strange. Or I didn't understand what you mean. Could you give me more detail?

@r-shahpasand
Copy link
Author

Thanks for your reply. Yes you get it right. As you said it read saved file but without internet it doesn't show the image, while with the Internet connection this problem doesn't exist. I'm using the code you provided in example section.

@marcglasberg
Copy link
Owner

Ok, that's really strange. I'll have a look at it.

@marcglasberg
Copy link
Owner

Are you using Flutter 1.20? Could you please post your flutter doctor?

@r-shahpasand
Copy link
Author

G:\Projects\Learn>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.3, on Microsoft Windows [Version 10.0.18362.720], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 4.0)
[!] VS Code (version 1.45.1)
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)

! Doctor found issues in 1 category.

@marcglasberg
Copy link
Owner

marcglasberg commented Aug 11, 2020

I have upgraded the package to Flutter 1.20. There were indeed some changes I needed to make in the ImageForCanvas class, but not for the NetworkToFileImage class. In any case you are not using Flutter 1.20.

I can't reproduce the problem you describe. What I did was this:

  1. Run once the example from https://github.com/marcglasberg/network_to_file_image/blob/master/example/lib/main.dart
    This would download the image and save it to file.

  2. Turn off the internet, by putting the emulator into airplane mode.

  3. Run again the example. The image is displayed.

@luciano01
Copy link

Is it possible to upload an image through Assets?
My app receives an image from the network, but when the image is null, I would like to load some of the Assets.

@marcglasberg
Copy link
Owner

@luciano01 I don't understand your question, you have to explain better what you want. But, please, open a new issue, since it has nothing to do with this question. I am going to close this issue since I got no more replies.

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