import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:ysairplane2/base/YSBase.dart'; import 'package:ysairplane2/tools/YSTools.dart'; class YSOrderTwo extends StatefulWidget { final confirmDict,orderDict; const YSOrderTwo({Key key, this.confirmDict, this.orderDict}) : super(key: key); @override _YSOrderTwoState createState() => _YSOrderTwoState(); } class _YSOrderTwoState extends State { bool _isShow = false; bool _isDetail = false; List _chooses = [{'title':'接机鲜花','isTips':0,'amount':'188','isChoose':0},{'title':'接机鲜花','isTips':1,'amount':'188','isChoose':0},{'title':'接机鲜花','isTips':1,'amount':'188','isChoose':1}, {'title':'接机鲜花','isTips':0,'amount':'188','isChoose':1},{'title':'接机鲜花','isTips':1,'amount':'188','isChoose':0}]; @override Widget build(BuildContext context) { return Scaffold( body: YSBase( ystitle: '订单确认', yschild: Column( children: [ Stack( children: [ Container( height: MediaQuery.of(context).size.height-hsp(120)-MediaQuery.of(context).padding.top-44, width: MediaQuery.of(context).size.width, color: Color(0xFFF1F2F4), child: SingleChildScrollView( child: Stack( children: [ Container( height: MediaQuery.of(context).padding.top+hsp(800), width: MediaQuery.of(context).size.width, decoration: BoxDecoration( gradient: const LinearGradient(colors: [Color(0xFF007EFF),Color(0x00007EFF)],begin: Alignment.topCenter,end: Alignment.bottomCenter), ), ), Column( children: [ Container( margin: EdgeInsets.all(hsp(30)), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5)) ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( child: Text('出发时间',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),), padding: EdgeInsets.only(left: wsp(40),right: wsp(40)), height: hsp(80), width: MediaQuery.of(context).size.width, alignment: Alignment.centerLeft, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topRight: Radius.circular(5),topLeft: Radius.circular(5)) ), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),), Container( child: Text('${widget.confirmDict['00']}',style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434),fontWeight: FontWeight.bold),), padding: EdgeInsets.only(left: wsp(40),right: wsp(40)), height: hsp(100), width: MediaQuery.of(context).size.width, alignment: Alignment.centerLeft, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(bottomRight: Radius.circular(5),bottomLeft: Radius.circular(5)) ), ) ], ), ), Container( margin: EdgeInsets.only(left: hsp(30),right: hsp(30),bottom: hsp(30)), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(5)) ), child: Column( children: [ ListView.builder( itemBuilder: (context,index){ return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( children: [ Container( height: hsp(30), width: hsp(30), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(50)), border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6)) ), margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)), ), if(index<1)Container( height: hsp(30), width: hsp(5), color: Color(0xFFCACAD4), ) ], ), Container( child: Text(index==0?'西安市长安区樱花广场一路执行樱花园4号楼':'西安市新城区208号',style: TextStyle(fontSize: zsp(28),color: Color(0xFF000000)),), margin: EdgeInsets.only(left: wsp(10)), ) ], ); }, itemCount: 2, padding: EdgeInsets.only(left: wsp(40),right: wsp(40),top: hsp(30),bottom: hsp(30)), shrinkWrap: true, physics: NeverScrollableScrollPhysics(), ), Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),), Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( text: '出行人数', style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434),fontWeight: FontWeight.bold), children: [ TextSpan( text: ' 10 ', style: TextStyle(color: Color(0xFF348AE1)) ), TextSpan( text: '人' ) ] ), ), RichText( text: TextSpan( text: '预订须知', style: TextStyle(fontSize: zsp(28),color: Color(0xFF348AE1)), children: [ TextSpan( text: ' >', style: TextStyle(color: Color(0xFF000000)) ), ] ), ), ], ), padding: EdgeInsets.only(left: wsp(40),right: wsp(40)), height: hsp(100), width: MediaQuery.of(context).size.width, alignment: Alignment.centerLeft, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(bottomRight: Radius.circular(5),bottomLeft: Radius.circular(5)) ), ) ], ), ), GestureDetector( onTap: (){ setState(() { _isShow = !_isShow; }); }, behavior: HitTestBehavior.opaque, child: Container( padding: EdgeInsets.all(wsp(32)), margin: EdgeInsets.only(left: hsp(30),right: hsp(30)), decoration: BoxDecoration( color: Colors.white, borderRadius: _isShow==true?BorderRadius.only(topRight: Radius.circular(5),topLeft: Radius.circular(5)):BorderRadius.all(Radius.circular(5)) ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('更多服务',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),), Icon(Icons.keyboard_arrow_down,size: hsp(50),color: Color(0xFFC1C1C1),) ], ) ), ), if(_isShow==true)Container( padding: EdgeInsets.all(wsp(32)), margin: EdgeInsets.only(left: hsp(30),right: hsp(30),bottom: hsp(30)), decoration: BoxDecoration( color: Color(0xFFFAFAFA), borderRadius: BorderRadius.only(bottomRight: Radius.circular(10),bottomLeft: Radius.circular(10)) ), child: ListView.builder( shrinkWrap: true, itemBuilder: (context,index){ return Container( padding: EdgeInsets.only(left: wsp(30),right: wsp(30),bottom: wsp(30)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Text('${_chooses[index]['title']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF999999)),), Container( width: wsp(50), child: GestureDetector( child: Icon(Icons.error_outline,size: hsp(40),color: _chooses[index]['isTips']==1?Color(0xFF999999):Colors.transparent), ), ), Text('${_chooses[index]['amount']}元',style: TextStyle(fontSize: zsp(28),color: Colors.black),), ], ), GestureDetector( child: Container( height: hsp(60), width: hsp(100), child: Image.asset(_chooses[index]['isChoose']==1?'lib/images/kaiguankai.png':'lib/images/kaiguanguan.png'), ), onTap: (){ setState(() { _chooses[index]['isChoose']==1?_chooses[index]['isChoose'] = 0:_chooses[index]['isChoose'] = 1; }); }, ) ], ), ); }, itemCount: _chooses.length, padding: EdgeInsets.all(0), ), ) ], ) ], ), ), ), if(_isDetail==true)Stack( children: [ GestureDetector( onTap: (){ setState(() { _isDetail = false; }); }, child: Container( height: MediaQuery.of(context).size.height-hsp(120)-MediaQuery.of(context).padding.top-44, color: Colors.black45, ), ), Container( margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-hsp(120)-MediaQuery.of(context).padding.top-44-hsp(370)), height: hsp(370), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10)) ), child: Column( children: [ Container( height: hsp(100), padding: EdgeInsets.only(left: 15,right: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ GestureDetector( child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),), onTap: (){ Navigator.pop(context); }, ), Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),), Container(), ], ), ), Container( height: hsp(100), color: Color(0xFFF7F8F9), padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('VIP尊享座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),), Text('¥ 780x 10人',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),), ], ), ), Container( color: Color(0xFFF7F8F9), height: hsp(170), child: ListView.builder( padding: EdgeInsets.all(0), itemBuilder: (context,index){ return Container( padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('票价',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),), Text('¥ 770x 10人',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),), ], ), ); }, itemCount: 3, ), ) ], ), ) ], ) ], ), Container( height: hsp(120), width: MediaQuery.of(context).size.width, color: Colors.white, padding: EdgeInsets.only(left: wsp(30),right: wsp(30)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ RichText( text: TextSpan( text: '参考价(¥)', style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)), children: [ TextSpan( text: ' 7800.00', style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)), ) ] ), ), GestureDetector( child: Row( children: [ Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),), Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),), ], ), onTap: (){ setState(() { _isDetail = !_isDetail; }); }, ), Container( height: hsp(70), padding: EdgeInsets.only(left: wsp(50),right: wsp(50)), decoration: BoxDecoration( color: Color(0xFF007EFF), borderRadius: BorderRadius.all(Radius.circular(50)) ), alignment: Alignment.center, child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),), ) ], ), ) ], ), ), ); } }