How do I stretch an image to fit the whole background (100% height x 100% width) in Flutter?

后端 未结 12 1082
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 00:10

I have an image that doesn\'t match the aspect ratio of my device\'s screen. I want to stretch the image so that it fully fills the screen, and I don\'t want to crop any par

12条回答
  •  萌比男神i
    2020-12-01 00:21

    None of the above answers worked for me. And since there is no accepted answer, I found the following extended my image from horizontal edge to horizontal edge:

    Container ( width: MediaQuery
                        .of(context)
                        .size
                        .width,
                    child: 
                      Image.network(my_image_name, fit: BoxFit.fitWidth )
                  )
    

提交回复
热议问题