How to fitWidth for an image in flutter while only showing the bottom of the image?


I want to fit the image width into the screen as shown on the red box in the photo. However, when I use fitWidth, it crops out both the top and bottom of the image. How can I make it such that it only crops out the top and shows more of the bottom of the image?

Current code is as shown

   fit: BoxFit.fitWidth

Thanks in advance
enter image description here


Use alignment: Alignment.bottomCenter,

            height: 100,
            width: 400,
            child: Image.asset(
              fit: BoxFit.fitWidth,
              alignment: Alignment.bottomCenter,

enter image description here

Answered By – Yeasin Sheikh

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published