hungps / flutter_pokedex

Pokedex app built with Flutter (with lots of animations) using Clean Architecture
https://hungps.com
Other
2.31k stars 562 forks source link

Images not fetching for web support. #70

Closed moulibheemaneti closed 1 year ago

moulibheemaneti commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

hungps commented 1 year ago

@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 commented 1 year ago

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

moulibheemaneti commented 1 year ago

@hungps Can I contact you through LinkedIn?

hungps commented 1 year ago

@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 commented 1 year ago

@moulibheemaneti

Can I contact you through LinkedIn?

Sure, just send me a request

hungps commented 1 year ago

@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