newsfeed_card_footer.dart 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import 'package:cpt_community/components/newfeed_card_header.dart';
  2. import 'package:cs_resources/generated/assets.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:flutter/widgets.dart';
  5. import 'package:shared/utils/color_utils.dart';
  6. import 'package:shared/utils/log_utils.dart';
  7. import 'package:widgets/ext/ex_widget.dart';
  8. import 'package:widgets/my_load_image.dart';
  9. import 'package:widgets/my_text_view.dart';
  10. // 'id':1,
  11. // 'avator': Assets.communityCamera,
  12. // 'title': 'William Jefferson',
  13. // 'isFollow': false,
  14. // 'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
  15. // 'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
  16. // 'time': 'June 17,2016 at 7:23 p.m.',
  17. // 'likeno': 12
  18. class NewsFeedCardFooter extends StatelessWidget {
  19. final bool isLike;
  20. final VoidCallback? onLike;
  21. final VoidCallback? onComment;
  22. final VoidCallback? onShare;
  23. const NewsFeedCardFooter({
  24. Key? key,
  25. required this.isLike,
  26. this.onLike,
  27. this.onComment,
  28. this.onShare
  29. })
  30. : super(key: key);
  31. @override
  32. Widget build(BuildContext context) {
  33. return Container(
  34. height: 40,
  35. width: double.infinity,
  36. padding: const EdgeInsets.symmetric(horizontal: 16),
  37. // color: Colors.red,
  38. child: Row(
  39. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  40. children: [
  41. Container(
  42. height: 40,
  43. padding: const EdgeInsets.all(8),
  44. child: Row(
  45. children: [
  46. const MyAssetImage(Assets.communityLike, width: 16,height: 16,),
  47. MyTextView(
  48. 'Like',
  49. textColor: ColorUtils.string2Color('#767676'),
  50. fontSize: 14,
  51. isFontRegular: true,
  52. textAlign: TextAlign.left,
  53. marginLeft: 8,
  54. ),
  55. ],
  56. ),
  57. ).onTap((){
  58. Log.d("点击了like");
  59. onLike?.call();
  60. }),
  61. Container(
  62. height: 40,
  63. padding: const EdgeInsets.all(8),
  64. child: Row(
  65. children: [
  66. const MyAssetImage(Assets.communityComments, width: 16,height: 16,),
  67. MyTextView(
  68. 'Comments',
  69. textColor: ColorUtils.string2Color('#767676'),
  70. fontSize: 14,
  71. isFontRegular: true,
  72. textAlign: TextAlign.left,
  73. marginLeft: 8,
  74. ),
  75. ],
  76. ),
  77. ).onTap((){
  78. Log.d("点击了comments");
  79. onComment?.call();
  80. }),
  81. Container(
  82. height: 40,
  83. padding: const EdgeInsets.all(8),
  84. child: Row(
  85. children: [
  86. const MyAssetImage(Assets.communityShare, width: 16,height: 16,),
  87. MyTextView(
  88. 'Share',
  89. textColor: ColorUtils.string2Color('#767676'),
  90. fontSize: 14,
  91. isFontRegular: true,
  92. textAlign: TextAlign.left,
  93. marginLeft: 8,
  94. ),
  95. ],
  96. ),
  97. ).onTap((){
  98. Log.d("点击了share");
  99. onShare?.call();
  100. }),
  101. ]
  102. )
  103. );
  104. }
  105. }