我正在尝试使用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),
)
);`
}
)
);
}
}
),
),
),
有人可以帮助我吗?