import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:ysairplane/base/YSBase.dart'; import 'package:ysairplane/tools/YSTools.dart'; class YSBill extends StatefulWidget { @override _YSBillState createState() => _YSBillState(); } class _YSBillState extends State { List array = ['','','','','','','','','','','','','','','','']; @override Widget build(BuildContext context) { return YSBase( ystitle: '账单', yschild: Column( children: [ Container( height: hsp(155), padding: EdgeInsets.only(left: wsp(44),right: wsp(44),top: hsp(25),bottom: hsp(25)), color: Color(0xFFF5F5F5), child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ GestureDetector( onTap: (){ showModalBottomSheet( context: context, builder: (context){ return YSDatePicker( choose: (value){ print(value); }, ); } ); }, child: Row( children: [ Text('2020年8月',style: TextStyle(fontSize: zsp(34),color: Color(0xFF131318),fontWeight: FontWeight.bold),), Icon(Icons.keyboard_arrow_down,size: 20,color: Color(0xFF131318),) ], ), ), Text('支出¥28987.87',style: TextStyle(fontSize: zsp(30),color: Color(0xFF898989)),), ], ), ), Container( height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(155), child: ListView.builder( itemBuilder: (context,index){ return Dismissible( key: Key(UniqueKey().toString()), onDismissed: (direction) async{ }, secondaryBackground: Container( color: Color(0xFFDE4242), height: hsp(159), padding: EdgeInsets.only(right: wsp(36)), alignment: Alignment.centerRight, child: Text('删除',style: TextStyle(color: Colors.white,fontWeight: FontWeight.bold,fontSize: zsp(37)),), ), background: Container(color: Colors.transparent,), direction: DismissDirection.endToStart, child: Container( height: hsp(159), padding: EdgeInsets.only(left: wsp(36),right: wsp(36),top: hsp(25)), child: Column( children: [ Row( children: [ Container( height: hsp(100), width: hsp(100), decoration: BoxDecoration( color: Color(0xFFF5F5F5), borderRadius: BorderRadius.all(Radius.circular(hsp(50))) ), child: Image.asset('lib/images/wallet.png'), ), Container( height: hsp(100), width: MediaQuery.of(context).size.width/2-15, margin: EdgeInsets.only(left: wsp(30),right: wsp(30)), child: Column( children: [ Text('支付订单-9863865386',style: TextStyle(fontSize: zsp(32),color: Color(0xFF131318)),maxLines: 1,), Text('8月26日 13:02',style: TextStyle(fontSize: zsp(24),color: Color(0xFFA7A7A7)),) ], crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, ), ), Container( width: MediaQuery.of(context).size.width/2-103, child: Text('-5800.00',style: TextStyle(fontSize: zsp(35),color: Color(0xFF000000),fontWeight: FontWeight.bold),maxLines: 1,overflow: TextOverflow.ellipsis,), alignment: Alignment.centerRight, ) ], ), Container( margin: EdgeInsets.only(left: wsp(147),top: hsp(24)), height: hsp(1), color: Color(0xFFF5F5F5), ) ], ), ), ); }, itemCount: array.length ), ) ], ), ); } }