item_home_last_trans.dart 2.2 KB

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