2020年12月19日星期六

how to get flutter resolution-aware image assets working when wanting the image to scale

I followed all the information provided on the official documentation: https://flutter.dev/docs/development/ui/assets-and-images

The problem I am facing is that I'm trying to display an image full screen, using box fit: cover, and flutter is picking the lowest resolution that when scaled doesn't look good.

When I hard code my 3.0x version, it displays well, and I don't need to even add box fit: cover. I wonder what I'm missing?

here's how I declare my image: Image.asset('assets/onboarding/onboarding_1.png',),

this is what gets displayed:

enter image description here

when I put box fit cover, to get it full screen, it's pixelated. and if I hard code the 3.0x, I don't need the box fit cover anymore, and it displays well. but am not making use of the pixel awareness Image.asset('assets/onboarding/3.0x/onboarding_1.png',),



from Recent Questions - Stack Overflow https://stackoverflow.com/questions/65376926/how-to-get-flutter-resolution-aware-image-assets-working-when-wanting-the-image Frederick Mfinanga

没有评论:

发表评论