【发布时间】:2021-03-31 12:35:31
【问题描述】:
我想在我的颤振应用程序中显示图像而不更改其属性。鉴于我有一些图像的宽度比高度长,反之亦然。我试过不使用高度和宽度属性,但它仍然会影响一些图像。
这是我的代码
child: Column(
children: <Widget>[
Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
Image.network(
widget.post.imageUrls[0],
height: MediaQuery.of(context).size.height*0.3,
fit: BoxFit.cover,
),
Container(
width: screenWidth(context)*0.2,
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
borderRadius:BorderRadius.circular(10),
color:Color.fromRGBO(0, 0, 0, 0.4),
),
child: CountDownTimer(
secondsRemaining: secs,
whenTimeExpires: () {
setState(() {
hasTimerStopped = true;
});
},
countDownTimerStyle: TextStyle(
color: Colors.redAccent,
fontSize: 14.0,
),
),
),
]
),
...other elements in my column below ...
我可以使用什么小部件来安全地显示这些图像。
【问题讨论】:
标签: flutter user-interface widget