wallet_detail_page.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import 'package:flutter/material.dart';
  2. import 'package:liftmanager/res/colors.dart';
  3. import 'package:liftmanager/widgets/app_bar.dart';
  4. import 'package:liftmanager/utils/time_format.dart';
  5. import 'package:liftmanager/internal/wode/model/wallet_model.dart';
  6. class WalletDetailPage extends StatefulWidget {
  7. WalletDetailPage(this.model, this.typeTitle);
  8. Records model;
  9. String typeTitle;
  10. // int id;
  11. @override
  12. State<StatefulWidget> createState() {
  13. return WalletDetailPageState();
  14. }
  15. }
  16. class WalletDetailPageState extends State<WalletDetailPage>
  17. with AutomaticKeepAliveClientMixin {
  18. @override
  19. void initState() {
  20. super.initState();
  21. }
  22. // getDetail() {
  23. // NewApiService().getMoneyDetail(widget.id, onSuccess: (res) {
  24. // detail = MoneyDetailModel.fromJson(res);
  25. // // getUserInfo();
  26. // setState(() {});
  27. // }, onError: (code, msg) {
  28. // toasts(msg);
  29. // });
  30. // }
  31. @override
  32. void dispose() {
  33. // provider.dispose();
  34. super.dispose();
  35. }
  36. @override
  37. Widget build(BuildContext context) {
  38. return Scaffold(
  39. resizeToAvoidBottomPadding: false,
  40. appBar: MyAppBar(
  41. centerTitle: "零钱明细",
  42. ),
  43. body: Container(
  44. // color: Colors.red,
  45. child: Column(
  46. children: [
  47. Column(
  48. children: [
  49. SizedBox(
  50. height: 35,
  51. ),
  52. Text(
  53. '${widget.typeTitle}',
  54. style: TextStyle(fontSize: 18),
  55. ),
  56. Text(
  57. '${widget.model.descr ?? ''}',
  58. style: TextStyle(fontSize: 13, color: Colours.text_gray),
  59. ),
  60. SizedBox(
  61. height: 35,
  62. ),
  63. Text(
  64. '¥${widget.model.amount ?? ''}',
  65. style: TextStyle(fontSize: 24, color: Colors.red),
  66. ),
  67. SizedBox(
  68. height: 35,
  69. ),
  70. ],
  71. ),
  72. Column(
  73. children: [
  74. cell('类型', '${widget.model.type == 1 ? '支出' : '收入'}'),
  75. cell('时间',
  76. '${DateUtils.instance.getFormartData(timeSamp: widget.model.createTime, format: "yyyy-MM-dd HH:mm")}'),
  77. cell('交易单号', '${widget.model.flowNum ?? ''}'),
  78. cell('余额', '${widget.model.balance ?? ''}'),
  79. cell('备注', '${widget.model.descr ?? ''}'),
  80. ],
  81. ),
  82. SizedBox(
  83. height: 30,
  84. ),
  85. Expanded(
  86. child: Container(
  87. color: Colours.bg_gray,
  88. ))
  89. ],
  90. )));
  91. }
  92. cell(title, value) {
  93. return Container(
  94. padding: EdgeInsets.fromLTRB(10, 5, 10, 5),
  95. child: Row(
  96. children: [
  97. Container(
  98. width: 70,
  99. child: Text(
  100. title,
  101. style: TextStyle(color: Colours.text_gray, fontSize: 13),
  102. ),
  103. ),
  104. SizedBox(
  105. width: 20,
  106. ),
  107. Text(
  108. value,
  109. style: TextStyle(color: Colours.text, fontSize: 13),
  110. )
  111. ],
  112. ),
  113. );
  114. }
  115. @override
  116. bool get wantKeepAlive => true;
  117. }