如何解决如何从Flutter中的REST API制作水平Listview.builder?
我正在尝试使用REST API中的数据制作水平列表视图,我已经有了数据,问题被填满了屏幕 这是我的代码:
Positioned(
top: 270,bottom: 0,right: 0,left: 30,child: new Container(
height: 100,constraints: new BoxConstraints(
// minHeight: 40.0
),child: FutureBuilder(
future: getKategori('kelas'),builder: (BuildContext context,AsyncSnapshot snapshot){
if(snapshot.data==null){
}else{
return Container(
height: 100,child: ListView.builder(
itemCount: snapshot.data.length,scrollDirection: Axis.horizontal,// mainAxisSize: MainAxisSize.min,itemBuilder: (BuildContext context,int index){
return
new Container(
height: 10,child: Card(
child: new Text(snapshot.data[index].nama),)
);`
}
)
);
}
}
),),
有人可以帮助我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。