【发布时间】:2019-04-24 22:35:17
【问题描述】:
我正在尝试创建类别卡,并将图像设置为子容器小部件的背景,但图像未显示在容器上
Container job1category(String imgpath, String name, String nikename) {
return Container(
width: 170,
child: Card(
child: Wrap(
children: <Widget>[
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(imgpath),
fit: BoxFit.cover
)
),
child: null
),
ListTile(
title: Text(name),
subtitle: Text(nikename),
),
],
),
),
);
}
【问题讨论】: