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

Images not fetching for web support. #70

Closed
moulibheemaneti opened this issue Nov 1, 2022 · 8 comments
Closed

Images not fetching for web support. #70

moulibheemaneti opened this issue Nov 1, 2022 · 8 comments

Comments

@moulibheemaneti
Copy link

Hey @hungps,
I'm starting the web support for the app too. While doing so, we are not able to fetch images.

Screenshot 2022-11-01 at 12 22 07 PM

And the error in terminal is:
Screenshot 2022-11-01 at 12 22 47 PM

But the image url in terminal is getting redirected.

@hungps
Copy link
Owner

hungps commented Nov 1, 2022

Hi @moulibheemaneti,
Thank you for contributing. The host (pokemon.com) might prevent another website from using their images. I'm planning on cloning the image and hosting it in Github to solve this.

@moulibheemaneti
Copy link
Author

I guess that would solve the problem. But I guess there will some limit for storing right?

@hungps
Copy link
Owner

hungps commented Nov 1, 2022

@moulibheemaneti Actually PokéAPI has done this (even much more images than we need to use in our app). We might simply clone their repo and remove unnecessary things. You can see the sprites that we need to clone here

You can try something like this to get the image URL: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/{pokemon-number}.png

For example: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/1.png

@moulibheemaneti
Copy link
Author

@hungps woah. That's great. Let's do what you suggested.

@moulibheemaneti
Copy link
Author

@hungps Can I contact you through LinkedIn?

@hungps
Copy link
Owner

hungps commented Nov 1, 2022

@moulibheemaneti I will prepare another repository for storing the images (maybe this weekend) and give you the link when I'm finished. If you are currently working on it, you can use the PokeAPI URL temporarily for now.

@hungps
Copy link
Owner

hungps commented Nov 1, 2022

@moulibheemaneti

Can I contact you through LinkedIn?

Sure, just send me a request

@hungps
Copy link
Owner

hungps commented Nov 6, 2022

@moulibheemaneti I've forked the PokéAPI's sprites repository. You can now load the pokemon image by using this format:
https://raw.githubusercontent.com/hungps/flutter_pokedex_db/master/sprites/pokemon/other/official-artwork/{pokemon-number}.png

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

2 participants