item_notification.dart 3.2 KB

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