YSHomeMsg.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter/cupertino.dart';
  3. import 'package:ysairplane/base/YSBase.dart';
  4. import 'package:ysairplane/code/YSHomeMsgDetail.dart';
  5. import 'package:ysairplane/code/YSHomeMsgSetting.dart';
  6. import 'package:ysairplane/tools/YSTools.dart';
  7. class YSHomeMsg extends StatefulWidget {
  8. @override
  9. _YSHomeMsgState createState() => _YSHomeMsgState();
  10. }
  11. class _YSHomeMsgState extends State<YSHomeMsg> {
  12. @override
  13. Widget build(BuildContext context) {
  14. return YSBase(
  15. ystitle: '消息',
  16. ysright: GestureDetector(
  17. child: Icon(Icons.settings,size: hsp(40),color: Color(0xFF444444),),
  18. onTap: (){
  19. Navigator.of(context).push(
  20. CupertinoPageRoute(
  21. builder: (context){
  22. return YSHomeMsgSetting();
  23. }
  24. )
  25. );
  26. },
  27. ),
  28. yschild: Container(
  29. width: MediaQuery.of(context).size.width,
  30. height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44,
  31. color: Color(0xFFF1F2F3),
  32. child: ListView.separated(
  33. padding: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
  34. shrinkWrap: true,
  35. itemBuilder: (context,index){
  36. return GestureDetector(
  37. onTap: (){
  38. Navigator.of(context).push(
  39. CupertinoPageRoute(
  40. builder: (context){
  41. return YSHomeMsgDetail();
  42. }
  43. )
  44. );
  45. },
  46. child: Container(
  47. color: Color(0xFFFAFAFA),
  48. padding: EdgeInsets.all(hsp(30)),
  49. child: Row(
  50. children: [
  51. Stack(
  52. children: [
  53. Container(
  54. height: hsp(100),
  55. width: hsp(100),
  56. margin: EdgeInsets.only(top: hsp(5),right: wsp(20)),
  57. decoration: BoxDecoration(
  58. color: Color(0xFF3E81D0),
  59. borderRadius: BorderRadius.all(Radius.circular(5))
  60. ),
  61. ),
  62. Container(
  63. height: hsp(20),
  64. width: hsp(20),
  65. margin: EdgeInsets.only(left: hsp(85)),
  66. decoration: BoxDecoration(
  67. color: Color(0xFFE95D58),
  68. borderRadius: BorderRadius.all(Radius.circular(hsp(10)))
  69. ),
  70. )
  71. ],
  72. ),
  73. Column(
  74. crossAxisAlignment: CrossAxisAlignment.start,
  75. children: [
  76. Container(
  77. width: MediaQuery.of(context).size.width-hsp(160)-wsp(20),
  78. margin: EdgeInsets.only(bottom: hsp(10)),
  79. child: Row(
  80. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  81. children: [
  82. Container(
  83. child: Text('订单生成成功',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000)),maxLines: 1,overflow: TextOverflow.ellipsis,),
  84. width: (MediaQuery.of(context).size.width-hsp(160)-wsp(20))*0.65,
  85. ),
  86. Text('下午 3:44',style: TextStyle(fontSize: zsp(22),color: Color(0xFFCCCCCC)),),
  87. ],
  88. ),
  89. ),
  90. Container(
  91. child: Text('订单编号:23140000,上海到西安,请及时支付',style: TextStyle(fontSize: zsp(28),color: Color(0xFF999999)),maxLines: 1,overflow: TextOverflow.ellipsis,),
  92. width: MediaQuery.of(context).size.width-hsp(160)-wsp(20),
  93. )
  94. ],
  95. )
  96. ],
  97. ),
  98. ),
  99. );
  100. },
  101. separatorBuilder: (context,index){
  102. return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFF1F2F3),);
  103. },
  104. itemCount: 5
  105. ),
  106. ),
  107. );
  108. }
  109. }