flutter listView取消顶部空白
ListView头部有一段空白区域,是因为当ListView没有和AppBar一起使用时,头部会有一个padding,为了去掉padding,可以使用MediaQuery.removePadding:Widget _rubbishList(){return MediaQuery.removePadding(removeTop: true,con...
·
ListView头部有一段空白区域,是因为当ListView没有和AppBar一起使用时,头部会有一个padding,为了去掉padding,可以使用MediaQuery.removePadding:
Widget _rubbishList(){
return MediaQuery.removePadding(
removeTop: true,
context: context,
child: Container(
margin: EdgeInsets.only(left: 20,right: 20),
height: ScreenUtil().setHeight(700),
child: ListView.builder(
itemCount: rubbishList.length,
itemBuilder: (context,index){
return _cardItem(index);
}
)
)
);
}
更多推荐
已为社区贡献1条内容
所有评论(0)