item_notification.dart 3.3 KB

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