Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a background image that fits screen sizes in Flutter?

I have a similar background image below, when I resize it to a larger screen the details in the 4 corners of the image get distorted. How can the 4 corners and surrounding borders scale to the size of the screen? Please tell me the solution. Thanks!

enter image description here

like image 204
An Tran Avatar asked Nov 27 '25 18:11

An Tran


1 Answers

Add this in your main Container

decoration: BoxDecoration(
            image: DecorationImage(
                colorFilter: new ColorFilter.mode(
                    Colors.green.withOpacity(0.8), BlendMode.dstATop),
                image: AssetImage(Utils().homebg),
                fit: BoxFit.fill))
like image 116
Adnan Bashir Avatar answered Nov 30 '25 06:11

Adnan Bashir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!