item_visitor.dart 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import 'package:cs_resources/theme/app_colors_theme.dart';
  2. import 'package:domain/entity/visitor_page_entity.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_text_view.dart';
  7. class VisitorItem extends StatelessWidget {
  8. final int index;
  9. final VisitorPageList item;
  10. const VisitorItem({
  11. required this.index,
  12. required this.item,
  13. });
  14. @override
  15. Widget build(BuildContext context) {
  16. return Container(
  17. margin: const EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
  18. padding: const EdgeInsets.symmetric(vertical: 19, horizontal: 18.5),
  19. decoration: BoxDecoration(
  20. color: context.appColors.whiteBG,
  21. borderRadius: BorderRadius.circular(6.0), // 圆角
  22. boxShadow: [
  23. BoxShadow(
  24. color: const Color(0xFFB8BFD9).withOpacity(0.3), // 阴影颜色
  25. offset: const Offset(0, 3), // 阴影的偏移量
  26. blurRadius: 8.0, // 模糊半径
  27. spreadRadius: 3.0, // 扩散半径
  28. ),
  29. ],
  30. ),
  31. child: Column(
  32. crossAxisAlignment: CrossAxisAlignment.start,
  33. children: [
  34. //姓名
  35. MyTextView(
  36. item.name ?? "",
  37. fontSize: 16,
  38. marginBottom: 5,
  39. textColor: context.appColors.textBlack,
  40. isFontMedium: true,
  41. ),
  42. //电话/身份证
  43. Row(
  44. children: [
  45. MyTextView(
  46. item.phone ?? "",
  47. fontSize: 14,
  48. textColor: context.appColors.textBlack,
  49. isFontRegular: true,
  50. ),
  51. const Spacer(),
  52. MyTextView(
  53. Utils.maskString(item.nric ?? ""),
  54. fontSize: 14,
  55. textColor: context.appColors.textBlack,
  56. isFontRegular: true,
  57. ),
  58. ],
  59. ),
  60. //车牌号/访问日期
  61. Row(
  62. children: [
  63. MyTextView(
  64. item.vehicleNumber ?? "",
  65. fontSize: 14,
  66. textColor: context.appColors.textBlack,
  67. isFontRegular: true,
  68. ),
  69. const Spacer(),
  70. MyTextView(
  71. item.createdAt ?? "",
  72. fontSize: 14,
  73. textColor: context.appColors.textBlack,
  74. isFontRegular: true,
  75. ),
  76. ],
  77. ).marginOnly(top: 5),
  78. //备注
  79. MyTextView(
  80. item.note ?? "",
  81. fontSize: 14,
  82. marginTop: 6,
  83. textColor: context.appColors.textDarkGray,
  84. isFontRegular: true,
  85. fontWeight: FontWeight.w500,
  86. ),
  87. ],
  88. ),
  89. );
  90. }
  91. }