使用List.generate 来生成widget

List.generate(images.length, (i){
  return Container(
    margin: EdgeInsets.only(left:20.0),
      child: 
        Image.network("${images[i]}",
          width: 375.0,
          fit: BoxFit.fitWidth,
        ),
   );
}),
posted @ 2020-04-12 00:20  康水生  阅读(2086)  评论(0编辑  收藏  举报