item_feedback.dart 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import 'package:cs_resources/generated/assets.dart';
  2. import 'package:cs_resources/generated/l10n.dart';
  3. import 'package:cs_resources/theme/app_colors_theme.dart';
  4. import 'package:domain/entity/feedback_list_entity.dart';
  5. import 'package:flutter/material.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 FeedbackItem extends StatelessWidget {
  10. final int index;
  11. final FeedbackItemEntity item;
  12. const FeedbackItem({
  13. required this.index,
  14. required this.item,
  15. });
  16. @override
  17. Widget build(BuildContext context) {
  18. return Container(
  19. margin: const EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
  20. padding: const EdgeInsets.symmetric(vertical: 19, horizontal: 18.5),
  21. decoration: BoxDecoration(
  22. color: context.appColors.whiteBG,
  23. borderRadius: BorderRadius.circular(6.0), // 圆角
  24. boxShadow: [
  25. BoxShadow(
  26. color: const Color(0xFFB8BFD9).withOpacity(0.3), // 阴影颜色
  27. offset: const Offset(0, 3), // 阴影的偏移量
  28. blurRadius: 8.0, // 模糊半径
  29. spreadRadius: 3.0, // 扩散半径
  30. ),
  31. ],
  32. ),
  33. child: Column(
  34. crossAxisAlignment: CrossAxisAlignment.start,
  35. children: [
  36. Row(
  37. children: [
  38. const MyAssetImage(Assets.mainFeedbackItemIcon, width: 42.5, height: 44),
  39. Column(
  40. crossAxisAlignment: CrossAxisAlignment.start,
  41. children: [
  42. MyTextView(
  43. item.title ?? "",
  44. fontSize: 16,
  45. textColor: context.appColors.textBlack,
  46. isFontMedium: true,
  47. ),
  48. MyTextView(
  49. item.content ?? "",
  50. fontSize: 14,
  51. maxLines: 2,
  52. marginTop: 5,
  53. textColor: context.appColors.textBlack,
  54. isFontRegular: true,
  55. ),
  56. ],
  57. ).marginOnly(left: 11).expanded(),
  58. ],
  59. ),
  60. //备注
  61. MyTextView(
  62. "${item.createdAt} | ${item.category?.name ?? ""} | ${item.status == 1 ? S.current.in_progress : S.current.replied}",
  63. fontSize: 12,
  64. marginTop: 10,
  65. textColor: context.appColors.textDarkGray,
  66. isFontRegular: true,
  67. ),
  68. ],
  69. ),
  70. );
  71. }
  72. }