item_notification.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import 'package:cs_resources/generated/assets.dart';
  2. import 'package:cs_resources/theme/app_colors_theme.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:widgets/ext/ex_widget.dart';
  5. import 'package:widgets/my_load_image.dart';
  6. import 'package:widgets/my_text_view.dart';
  7. import 'package:widgets/utils/dark_theme_util.dart';
  8. class NotificationItem extends StatelessWidget {
  9. final String item;
  10. final int index;
  11. const NotificationItem({
  12. required this.item,
  13. required this.index,
  14. });
  15. @override
  16. Widget build(BuildContext context) {
  17. return Container(
  18. width: double.infinity,
  19. color: context.appColors.whiteBG,
  20. padding: const EdgeInsets.only(left: 11, right: 15, top: 10.5),
  21. child: Column(
  22. children: [
  23. Row(
  24. children: [
  25. const MyAssetImage(
  26. Assets.mainNotificationItemIcon,
  27. width: 42.5,
  28. height: 42.5,
  29. ).marginOnly(right: 16),
  30. Column(
  31. children: [
  32. //标题
  33. Row(
  34. crossAxisAlignment: CrossAxisAlignment.center,
  35. children: [
  36. //未读的小圆点
  37. Container(
  38. width: 6,
  39. height: 6,
  40. margin: const EdgeInsets.only(right: 8.5),
  41. decoration: BoxDecoration(
  42. shape: BoxShape.circle,
  43. color: context.appColors.tabBgSelectedPrimary,
  44. ),
  45. ),
  46. //消息标题
  47. MyTextView(
  48. "NEW ANNOUNCEMENT",
  49. fontSize: 16,
  50. isFontBold: true,
  51. textColor: context.appColors.textBlack,
  52. maxLines: 2,
  53. ).expanded(),
  54. //消息时间
  55. MyTextView(
  56. "10:19 AM",
  57. fontSize: 13,
  58. isFontRegular: true,
  59. textColor: context.appColors.textLightPurple,
  60. ),
  61. ],
  62. ),
  63. //内容
  64. Row(
  65. children: [
  66. //文本内容
  67. MyTextView(
  68. "Standard operating procedure for replacement vehicles andover night parking vehicles.",
  69. fontSize: 15,
  70. marginRight: 15,
  71. isFontRegular: true,
  72. textColor: context.appColors.textBlack,
  73. ).expanded(),
  74. //图片
  75. MyLoadImage(
  76. "https://img1.baidu.com/it/u=1656098746,3560654086&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800",
  77. width: 87.5,
  78. height: 60.5,
  79. ),
  80. ],
  81. ).marginOnly(top: 9),
  82. ],
  83. ).expanded(),
  84. ],
  85. ),
  86. const SizedBox(height: 17.5),
  87. Divider(
  88. height: 0.5,
  89. color: context.appColors.backgroundDark,
  90. ),
  91. ],
  92. ),
  93. );
  94. }
  95. }