gpt4 book ai didi

android - ListView.builder底部由抖动中的像素溢出

转载 作者:行者123 更新时间:2023-12-03 03:05:31 24 4
gpt4 key购买 nike

这就是我使用ListView.builder的方式,它是通过Column小部件在Expanded中使用的。我已经尝试了一些解决方案,但是它们不起作用,这是一个动态列表。

return Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
headingContainer(width,order_response),
Expanded(
child: ListView.builder(
shrinkWrap: true,
controller: _scrollController,
itemCount:order_response.orderDetails.length,
itemBuilder: (context, position) {return orderListItemTile(width,height,order_response,position);},
),
),

],
),
);

enter image description here
这是我的物品
 Column orderListItemTile(double width,double height, Order order_response, int position){
return Column(
children: <Widget>[
GestureDetector(
onTap: (){
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new OrderDetails(payload:order_response.orderDetails[position].orderRowId)),
);
},
child: new Container(
decoration: BoxDecoration(color: MyColors.backgroundColor),
padding: EdgeInsets.only(left:width*0.05,right: width*0.05,top:width*0.03,bottom: width*0.03),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(order_response.orderDetails[position].orderDateTime,style: TextStyle(color: Colors.grey,fontSize: 14.0,fontWeight: FontWeight.w800)),
SizedBox(height: height*0.01),
new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(order_response.orderDetails[position].productName,style: TextStyle(color: MyColors.colorPrimaryDark,fontSize: 18.0,fontWeight: FontWeight.w700)),
SizedBox(
height: 26.0,
width: 26.0,
child: RawMaterialButton(
onPressed: () {

},
child: new Icon(
Icons.arrow_forward_ios,
color: Colors.white,
size: 16.0,
),
shape: new CircleBorder(),
elevation: 2.0,
fillColor: Colors.grey[400],
padding: const EdgeInsets.all(5.0),
),
),
],
),
SizedBox(height: height*0.01),
Text(order_response.orderDetails[position].customerName,style: TextStyle(color: Colors.grey,fontSize: 14.0,fontWeight: FontWeight.w800)),
],
),
),),
Container(
decoration: BoxDecoration(color: Colors.grey[350]),
padding: EdgeInsets.only(left:width*0.05,right: width*0.05),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
children: <Widget>[
SizedBox(
height: 36.0,
width: 36.0,
child: IconButton(
padding: EdgeInsets.only(top:4.0,bottom: 4.0),
icon: Image.asset(order_response.orderDetails[position].orderStatus.contains('accepted')?'assets/images/right.png':'assets/images/wrong.png'),
onPressed: (){Navigator.pop(context,true);}
)),
SizedBox(
height: 36.0,
width: 36.0,
child: IconButton(
padding: EdgeInsets.only(top:4.0,bottom: 4.0,left: 5.0),
icon: Image.asset('assets/images/cart.png'),
onPressed: (){Navigator.pop(context,true);}
)),
],),
Text('Total ${order_response.orderDetails[position].orderAmount}',style: TextStyle(color: Colors.black87,fontSize: 16.0,fontWeight: FontWeight.w700)),

],),)

],
);
}

最佳答案

尝试使用SingleChildScrollView包装容器

关于android - ListView.builder底部由抖动中的像素溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54688080/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com