How do I stretch an image to fit the whole background (100% height x 100% width) in Flutter?
- 阅读更多 关于 How do I stretch an image to fit the whole background (100% height x 100% width) in Flutter?
问题 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 part of the image. CSS has the concept of percentages, so I could just set height and width to 100%. But it doesn't seem like Flutter has that concept, and it's bad to just hard code the height and width, so I'm stuck. Here's what I have (I'm using a Stack since I have something in the foreground of the image): Widget background