我在flutter小部件中进行搜索,找到了与该小部件相同的小部件,但是我没有找到该怎么做的方法?image with text in bottom
答案 0 :(得分:1)
Center(
child: Stack(children: <Widget>[
Image.network(
'https://images.pexels.com/photos/433539/pexels-photo-433539.jpeg?cs=srgb&dl=bali-beautiful-beauty-433539.jpg&fm=jpg'),
Positioned(
right: 0,
left: 0,
bottom: 0,
child: Container(
alignment: Alignment.center,
child: Text(
'ImageText',
style: TextStyle(color: Colors.white),
),
color: Colors.black54,
height: 60,
),
),
]),
)
答案 1 :(得分:0)
您可以使用Stack Widget。看起来像这样:
Stack(
children: <Widget>[
Image.network('www.somesite.com/some_image_url.png'),
Container(
color: Colors.black12
alignment: Alignment.bottomCenter,
child: Text('ImageText'),
),
]
)