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

Show something in the photo carousel when no internet connection #1667

Closed
M123-dev opened this issue Apr 27, 2022 · 11 comments · Fixed by #1733
Closed

Show something in the photo carousel when no internet connection #1667

M123-dev opened this issue Apr 27, 2022 · 11 comments · Fixed by #1733
Assignees
Labels
Milestone

Comments

@M123-dev
Copy link
Member

What

  • Currently the images just dissapear on the product page
  • The first box is the nutrition add card which is shown because the product has no image of that, but the fron photo is missing completely
Screen_Recording_20220205-164506.mp4
@M123-dev
Copy link
Member Author

Screenshot_20220311-104602

@teolemon teolemon changed the title Show something in the photo carousel when no interntet connection Show something in the photo carousel when no internet connection Apr 27, 2022
@vik4114
Copy link
Contributor

vik4114 commented Apr 27, 2022

I will take this up

@teolemon
Copy link
Member

@vik4114 What do you have in mind ?

@vik4114
Copy link
Contributor

vik4114 commented Apr 28, 2022

@teolemon I was thinking to show an image from assets when there is no connection. What do you think?

@AshAman999
Copy link
Member

@vik4114 something with fadeInImage?

@vik4114
Copy link
Contributor

vik4114 commented Apr 29, 2022

@AshAman999 Yes, we can use that.

@vik4114
Copy link
Contributor

vik4114 commented May 1, 2022

@teolemon @M123-dev How it looks? for now I have used smoothie icon

WhatsApp.Video.2022-05-01.at.4.32.52.PM.mp4

@M123-dev
Copy link
Member Author

M123-dev commented May 1, 2022

Heyy @vik4114 looks great, of course the image has to be replaced with a clear no internet image. But looking at the images directly changing after turning off the internet without reloading I'm guessing, that you are doing some kind of connection state checking, am I right? Here it probably makes more sense not to listen to it, (photos should remain visible when they are already loaded) and, the cards for photo upload,should also remain visible, because there will probably be some kind of offline upload in the future. (Also this is also offline available data)

@AshAman999
Copy link
Member

FadeInImage.assetNetwork(
  placeholder: 'assets/loading.gif',
  image: 'https://picsum.photos/250?image=9',
),
//or 
FadeInImage(
  placeholder: MemoryImage(bytes),
  image:  NetworkImage('https://backend.example.com/image.png'),
)

I guess something like this will make more sense, @vik4114

@vik4114
Copy link
Contributor

vik4114 commented May 1, 2022

@M123-dev I thought the same to implement, but for the online one, it was not good so I did this.

@vik4114
Copy link
Contributor

vik4114 commented May 1, 2022

FadeInImage.assetNetwork(
  placeholder: 'assets/loading.gif',
  image: 'https://picsum.photos/250?image=9',
),
//or 
FadeInImage(
  placeholder: MemoryImage(bytes),
  image:  NetworkImage('https://backend.example.com/image.png'),
)

I guess something like this will make more sense, @vik4114

Its just for moment of loading.

@teolemon teolemon added this to the V1 milestone May 4, 2022
vik4114 added a commit to vik4114/smooth-app that referenced this issue May 9, 2022
M123-dev pushed a commit that referenced this issue May 10, 2022
* Added placeholder image

Added placeholder image when no internet

* Added wifi off icon
Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

4 participants