import 'package:flutter/material.dart'; import 'package:ysairplane2/base/YSBase.dart'; import 'package:ysairplane2/tools/YSTools.dart'; class YSUnionOrderDetail extends StatefulWidget { final order; const YSUnionOrderDetail({Key key, this.order}) : super(key: key); @override _YSUnionOrderDetailState createState() => _YSUnionOrderDetailState(); } class _YSUnionOrderDetailState extends State { List _titleArray = [{'title':'','content':''},{'title':'订单编号','content':''},{'title':'订单状态','content':''},{'title':'订单金额','content':''} ,{'title':'用户','content':''},{'title':'佣金金额','content':''},{'title':'支付时间','content':''},{'title':'订单来源','content':''}]; @override void initState() { _titleArray[0]['title'] = widget.order['typeName']; _titleArray[1]['content'] = widget.order['orderSn']; _titleArray[2]['content'] = widget.order['orderStatus']==0?'已下单':widget.order['orderStatus']==1?'已核验':'已退款'; _titleArray[3]['content'] = '${widget.order['orderPrice']??'0.00'}'; _titleArray[4]['content'] = widget.order['nickName']; _titleArray[5]['content'] = '${widget.order['servantsPrice']??'0.00'}'; _titleArray[6]['content'] = widget.order['payTime']; _titleArray[7]['content'] = widget.order['type']??''; super.initState(); } @override Widget build(BuildContext context) { return YSBase( ystitle: '佣金订单详情', yscolor: Color(0xFFF5F6F8), yschild: Container( color: Colors.white, width: MediaQuery.of(context).size.width, child: ListView.separated( padding: EdgeInsets.only(left: hsp(30),right: hsp(30)), itemBuilder: (context,index){ Map item = _titleArray[index]; return Container( padding: EdgeInsets.only(top: hsp(30),bottom: hsp(30)), child: LayoutBuilder( builder: (context,listSize){ return Row( children: [ Container( width: hsp(200), child: Text(item['title'],style: TextStyle(fontSize: zsp(28),color: Colors.black,fontWeight: index==0?FontWeight.bold:FontWeight.normal),), ), Container( width: listSize.maxWidth-hsp(200), child: Text(item['content'],style: TextStyle(fontSize: zsp(28), color: Color(index==2?(item['content']=='冻结中'?0xFFFFAE00:0xFF999999):0xFF999999)),), alignment: Alignment.centerRight, ) ], ); }, ), ); }, separatorBuilder: (context,index){ return Divider(height: hsp(1),thickness: hsp(1),color: Color(0xFFF5F6F8),); }, itemCount: _titleArray.length, shrinkWrap: true, physics: NeverScrollableScrollPhysics(), ), ), ); } }