item_facility_active.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. import 'package:cpt_facility/modules/facility/active/facility_active_screen.dart';
  2. import 'package:cs_resources/generated/l10n.dart';
  3. import 'package:cs_resources/theme/app_colors_theme.dart';
  4. import 'package:domain/entity/facility_page_entity.dart';
  5. import 'package:flutter/material.dart';
  6. import 'package:widgets/ext/ex_widget.dart';
  7. import 'package:widgets/my_text_view.dart';
  8. /// 设施的Active的Item
  9. class FacilityActiveItem extends StatelessWidget {
  10. final int index;
  11. final FacilityDetail item;
  12. const FacilityActiveItem({
  13. required this.index,
  14. required this.item,
  15. });
  16. @override
  17. Widget build(BuildContext context) {
  18. return Container(
  19. width: double.infinity,
  20. margin: const EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
  21. padding: const EdgeInsets.only(left: 20, right: 15, top: 18, bottom: 23),
  22. decoration: BoxDecoration(
  23. color: context.appColors.whiteBG,
  24. borderRadius: BorderRadius.circular(6.0), // 圆角
  25. ),
  26. child: Row(
  27. mainAxisSize: MainAxisSize.max,
  28. crossAxisAlignment: CrossAxisAlignment.start,
  29. children: [
  30. Column(
  31. crossAxisAlignment: CrossAxisAlignment.start,
  32. children: [
  33. //设施
  34. MyTextView(
  35. item.facility?.type?.name ?? "",
  36. fontSize: 16,
  37. maxLines: 3,
  38. textColor: context.appColors.textBlack,
  39. isFontMedium: true,
  40. ),
  41. //分类
  42. MyTextView(
  43. item.facility?.name ?? "",
  44. fontSize: 14,
  45. marginTop: 3,
  46. textColor: context.appColors.textBlack,
  47. isFontRegular: true,
  48. ),
  49. //预订人
  50. MyTextView(
  51. S.current.booked_by_someone(item.account?.name ?? ""),
  52. fontSize: 14,
  53. marginTop: 3,
  54. textColor: context.appColors.textBlack,
  55. isFontRegular: true,
  56. ),
  57. //日期
  58. MyTextView(
  59. item.booking?.date ?? "",
  60. fontSize: 14,
  61. marginTop: 16,
  62. textColor: context.appColors.textBlack,
  63. isFontRegular: true,
  64. ),
  65. //时间
  66. MyTextView(
  67. "${item.booking?.start ?? ""}-${item.booking?.end ?? ""}",
  68. fontSize: 14,
  69. marginBottom: 7,
  70. marginTop: 3,
  71. textColor: context.appColors.textBlack,
  72. isFontRegular: true,
  73. ),
  74. //标签
  75. Row(
  76. children: [
  77. MyTextView(
  78. "Fee Paid",
  79. textColor: context.appColors.textPrimary,
  80. fontSize: 13,
  81. isFontRegular: true,
  82. backgroundColor: context.appColors.lightPurpleBg,
  83. cornerRadius: 3,
  84. paddingLeft: 7,
  85. marginRight: 6,
  86. paddingRight: 7,
  87. paddingTop: 3,
  88. paddingBottom: 3,
  89. ),
  90. MyTextView(
  91. "Deposit",
  92. textColor: context.appColors.textPrimary,
  93. fontSize: 13,
  94. isFontRegular: true,
  95. backgroundColor: context.appColors.lightPurpleBg,
  96. cornerRadius: 3,
  97. paddingLeft: 7,
  98. marginRight: 6,
  99. paddingRight: 7,
  100. paddingTop: 3,
  101. paddingBottom: 3,
  102. )
  103. ],
  104. )
  105. ],
  106. ).expanded(),
  107. Column(
  108. mainAxisSize: MainAxisSize.min,
  109. mainAxisAlignment: MainAxisAlignment.start,
  110. crossAxisAlignment: CrossAxisAlignment.start,
  111. children: [
  112. //查看按钮
  113. MyTextView(
  114. S.current.view,
  115. textColor: Colors.white,
  116. backgroundColor: context.appColors.btnBgDefault,
  117. cornerRadius: 7,
  118. paddingTop: 9,
  119. paddingBottom: 9,
  120. textAlign: TextAlign.center,
  121. boxWidth: 60,
  122. )
  123. ],
  124. )
  125. ],
  126. ),
  127. );
  128. }
  129. }