嗨朋友们,我是颤振开发的新手,我正在使用列表视图,请找到这张图片盒子,但它给出的错误是 double.infinity 不能使用请找到下面的代码请帮助我的朋友
new SliverList(
delegate: new SliverChildBuilderDelegate(
(BuildContext context, int index) {
return new GestureDetector(
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (context) => new News_Details(
postid: latest_news_list[index]['id'],
)));
},
child: new Card(
elevation: 4.0,
margin: EdgeInsets.only(left: 10.0, right: 10.0, top: 5.0),
child: new Row(
children: <Widget>[
**new Container(
child: new Image.network(
latest_news_list[index]['image'],
width: 150.0,
fit: BoxFit.cover,
),
),**
new Flexible(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new Container(
child: new Text(latest_news_list[index]['title']),
margin: EdgeInsets.only(left: 10.0, top: 10.0),
),
new Container(
child: new Divider(
color: secondarycolor,
),
margin: EdgeInsets.only(right: 10.0, left: 10.0),
),
new Container(
child: new Text(
latest_news_list[index]['content'],
softWrap: true,
maxLines: 4,
),
margin: EdgeInsets.only(
left: 10.0, top: 5.0, bottom: 5.0),
),
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new Container(
child: new Text('VSB News'),
margin:
EdgeInsets.only(left: 10.0, top: 10.0,bottom: 10.0),
),
new Container(
child: new Text(
latest_news_list[index]['post_dt']),
margin:
EdgeInsets.only(left: 10.0, top: 10.0,right: 10.0,bottom: 10.0),
),
],
)
],
),
)
],
),
),
);
},
childCount: latest_news_list == null ? 0 : latest_news_list.length,
),
),