YSBill.dart 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:ysairplane/base/YSBase.dart';
  4. import 'package:ysairplane/tools/YSTools.dart';
  5. class YSBill extends StatefulWidget {
  6. @override
  7. _YSBillState createState() => _YSBillState();
  8. }
  9. class _YSBillState extends State<YSBill> {
  10. List array = ['','','','','','','','','','','','','','','',''];
  11. @override
  12. Widget build(BuildContext context) {
  13. return YSBase(
  14. ystitle: '账单',
  15. yschild: Column(
  16. children: [
  17. Container(
  18. height: hsp(155),
  19. padding: EdgeInsets.only(left: wsp(44),right: wsp(44),top: hsp(25),bottom: hsp(25)),
  20. color: Color(0xFFF5F5F5),
  21. child: Column(
  22. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  23. crossAxisAlignment: CrossAxisAlignment.start,
  24. children: [
  25. GestureDetector(
  26. onTap: (){
  27. showModalBottomSheet(
  28. context: context,
  29. builder: (context){
  30. return YSDatePicker(
  31. choose: (value){
  32. print(value);
  33. },
  34. );
  35. }
  36. );
  37. },
  38. child: Row(
  39. children: [
  40. Text('2020年8月',style: TextStyle(fontSize: zsp(34),color: Color(0xFF131318),fontWeight: FontWeight.bold),),
  41. Icon(Icons.keyboard_arrow_down,size: 20,color: Color(0xFF131318),)
  42. ],
  43. ),
  44. ),
  45. Text('支出¥28987.87',style: TextStyle(fontSize: zsp(30),color: Color(0xFF898989)),),
  46. ],
  47. ),
  48. ),
  49. Container(
  50. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(155),
  51. child: ListView.builder(
  52. itemBuilder: (context,index){
  53. return Dismissible(
  54. key: Key(UniqueKey().toString()),
  55. onDismissed: (direction) async{
  56. },
  57. secondaryBackground: Container(
  58. color: Color(0xFFDE4242),
  59. height: hsp(159),
  60. padding: EdgeInsets.only(right: wsp(36)),
  61. alignment: Alignment.centerRight,
  62. child: Text('删除',style: TextStyle(color: Colors.white,fontWeight: FontWeight.bold,fontSize: zsp(37)),),
  63. ),
  64. background: Container(color: Colors.transparent,),
  65. direction: DismissDirection.endToStart,
  66. child: Container(
  67. height: hsp(159),
  68. padding: EdgeInsets.only(left: wsp(36),right: wsp(36),top: hsp(25)),
  69. child: Column(
  70. children: [
  71. Row(
  72. children: [
  73. Container(
  74. height: hsp(100),
  75. width: hsp(100),
  76. decoration: BoxDecoration(
  77. color: Color(0xFFF5F5F5),
  78. borderRadius: BorderRadius.all(Radius.circular(hsp(50)))
  79. ),
  80. child: Image.asset('lib/images/wallet.png'),
  81. ),
  82. Container(
  83. height: hsp(100),
  84. width: MediaQuery.of(context).size.width/2-15,
  85. margin: EdgeInsets.only(left: wsp(30),right: wsp(30)),
  86. child: Column(
  87. children: [
  88. Text('支付订单-9863865386',style: TextStyle(fontSize: zsp(32),color: Color(0xFF131318)),maxLines: 1,),
  89. Text('8月26日 13:02',style: TextStyle(fontSize: zsp(24),color: Color(0xFFA7A7A7)),)
  90. ],
  91. crossAxisAlignment: CrossAxisAlignment.start,
  92. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  93. ),
  94. ),
  95. Container(
  96. width: MediaQuery.of(context).size.width/2-103,
  97. child: Text('-5800.00',style: TextStyle(fontSize: zsp(35),color: Color(0xFF000000),fontWeight: FontWeight.bold),maxLines: 1,overflow: TextOverflow.ellipsis,),
  98. alignment: Alignment.centerRight,
  99. )
  100. ],
  101. ),
  102. Container(
  103. margin: EdgeInsets.only(left: wsp(147),top: hsp(24)),
  104. height: hsp(1),
  105. color: Color(0xFFF5F5F5),
  106. )
  107. ],
  108. ),
  109. ),
  110. );
  111. },
  112. itemCount: array.length
  113. ),
  114. )
  115. ],
  116. ),
  117. );
  118. }
  119. }