item_home_last_trans.dart 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import 'package:cpt_main/modules/feedback/feedback_page.dart';
  2. import 'package:cs_resources/theme/app_colors_theme.dart';
  3. import 'package:domain/entity/home_list_entity.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:shared/utils/util.dart';
  6. import 'package:widgets/ext/ex_widget.dart';
  7. import 'package:widgets/my_load_image.dart';
  8. import 'package:widgets/my_text_view.dart';
  9. class LastTransItem extends StatelessWidget {
  10. HomeListLatestTransactions lastTrans;
  11. LastTransItem({required this.lastTrans});
  12. @override
  13. Widget build(BuildContext context) {
  14. return Row(
  15. mainAxisSize: MainAxisSize.max,
  16. crossAxisAlignment: CrossAxisAlignment.center,
  17. mainAxisAlignment: MainAxisAlignment.start,
  18. children: [
  19. Column(
  20. crossAxisAlignment: CrossAxisAlignment.start,
  21. children: [
  22. MyTextView(
  23. lastTrans.title ?? "",
  24. fontSize: 15,
  25. textColor: context.appColors.textBlack,
  26. isFontMedium: true,
  27. ),
  28. MyTextView(
  29. lastTrans.price ?? "",
  30. fontSize: 15,
  31. marginTop: 5,
  32. textColor: context.appColors.textBlack,
  33. isFontMedium: true,
  34. ),
  35. ],
  36. ).expanded(),
  37. Container(
  38. margin: const EdgeInsets.only(left: 10),
  39. padding: const EdgeInsets.symmetric(horizontal: 5),
  40. height: 45,
  41. decoration: BoxDecoration(
  42. color: context.appColors.lightPurpleBg,
  43. borderRadius: BorderRadius.circular(5.0), // 5个圆角
  44. ),
  45. child: Column(
  46. crossAxisAlignment: CrossAxisAlignment.center,
  47. mainAxisAlignment: MainAxisAlignment.center,
  48. children: [
  49. MyTextView(
  50. "\$${lastTrans.price ?? "-"}",
  51. fontSize: 17,
  52. textColor: context.appColors.textBlack,
  53. isFontMedium: true,
  54. ),
  55. //单元,每个月或者没有单元
  56. // Visibility(
  57. // visible: Utils.isNotEmpty(lastTrans['unit']),
  58. // child: MyTextView(
  59. // lastTrans['unit'],
  60. // fontSize: 12,
  61. // textColor: context.appColors.textBlack,
  62. // isFontRegular: true,
  63. // ))
  64. ],
  65. ),
  66. ).constrained(minWidth: 92),
  67. ],
  68. );
  69. }
  70. }