item_comment.dart 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import 'package:cached_network_image/cached_network_image.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:jmrh/constant/styles.dart';
  4. class ItemComment extends StatelessWidget {
  5. @override
  6. Widget build(BuildContext context) {
  7. return Container(
  8. padding: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
  9. child: Row(
  10. crossAxisAlignment: CrossAxisAlignment.start,
  11. children: [
  12. ClipOval(
  13. child: CachedNetworkImage(
  14. width: 28,
  15. height: 28,
  16. imageUrl: 'https://zhumj.oss-cn-hangzhou.aliyuncs.com/image/user.jpg',
  17. ),
  18. ),
  19. Expanded(
  20. child: Container(
  21. margin: EdgeInsets.only(left: 6),
  22. child: Column(
  23. crossAxisAlignment: CrossAxisAlignment.start,
  24. children: [
  25. Text(
  26. '唐丛茸',
  27. style: TextStyle(color: COLOR_USERNAME, fontSize: 13, fontWeight: FontWeight.bold),
  28. ),
  29. Container(
  30. margin: EdgeInsets.only(top: 4),
  31. child: Text(
  32. '评论内容评论内容,评论内容评论内容评论,内容评论内容评论内容评论内容',
  33. style: TextStyle(color: COLOR_TEXT_1, fontSize: 14),
  34. ),
  35. ),
  36. Container(
  37. margin: EdgeInsets.only(top: 4),
  38. child: Row(
  39. children: [
  40. Text(
  41. '15分钟前',
  42. style: TextStyle(fontSize: 12, color: COLOR_TEXT_2),
  43. ),
  44. Container(
  45. margin: EdgeInsets.only(left: 15),
  46. child: Text(
  47. '回复Ta',
  48. style: TextStyle(fontSize: 12, color: COLOR_TEXT_2),
  49. ),
  50. )
  51. ],
  52. ),
  53. ),
  54. Container(
  55. width: double.infinity,
  56. margin: EdgeInsets.only(top: 10),
  57. decoration: BoxDecoration(
  58. color: COLOR_BORDER,
  59. borderRadius: BorderRadius.all(
  60. Radius.circular(2),
  61. ),
  62. ),
  63. padding: EdgeInsets.symmetric(horizontal: 8, vertical: 10),
  64. child: Column(
  65. crossAxisAlignment: CrossAxisAlignment.start,
  66. children: [
  67. RichText(
  68. text: TextSpan(children: [
  69. TextSpan(text: '夏秋雨', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
  70. TextSpan(text: ':评论内容评论内容评论内容评论内容', style: TextStyle(color: COLOR_TEXT_1, fontSize: 13)),
  71. ]),
  72. ),
  73. RichText(
  74. text: TextSpan(children: [
  75. TextSpan(text: '唐丛茸', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
  76. TextSpan(text: ' 回复 ', style: TextStyle(color: COLOR_TEXT_1, fontSize: 13)),
  77. TextSpan(text: '夏秋雨', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
  78. TextSpan(
  79. text: ':评论内容评论内容评论内容评论内容评论内容', style: TextStyle(color: COLOR_TEXT_1, fontSize: 13)),
  80. ]),
  81. ),
  82. RichText(
  83. text: TextSpan(children: [
  84. TextSpan(text: '查看全部5条回复', style: TextStyle(color: COLOR_USERNAME, fontSize: 13)),
  85. ]),
  86. ),
  87. ],
  88. ),
  89. )
  90. ],
  91. ),
  92. ),
  93. )
  94. ],
  95. ),
  96. );
  97. }
  98. }