How can I resize image in pub package "flutter_native_splash"?

Viewed 2259

I am using flutter_native_splash 1.3.1 package to add splash screen to the app.

The image size is getting displayed bigger than the desired size on the splash screen. What is right approach to decrease the size of the image on the splash screen?

3 Answers

It is stated in the documentation that the image will be stretched to fit the screen. I think the best solution is to make your image with an aspect ratio of 9x16 (portrait) so the proportions stay the same.

I was having issues with this. I tried a lot of different suggestions from stackoverflow, but nothing worked. I eventually just added padding within the image around the logo I wanted to display. So the logo was about 1/3 of the image, centered in the middle and then used center for gravity

<bitmap android:gravity="center" android:src="@drawable/splash" />

The images are all called splash.png.

The images sizes were all squares and had the dimensions:

hdpi 192X192, 
xhdpi 288X288, 
xxhdpi 384X384, 
xxxhdpi 1024X1024
Related