newsfeed_card_footer.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. import '../modules/community/community_page.dart';
  11. // 'id':1,
  12. // 'avator': Assets.communityCamera,
  13. // 'title': 'William Jefferson',
  14. // 'isFollow': false,
  15. // 'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
  16. // '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'],
  17. // 'time': 'June 17,2016 at 7:23 p.m.',
  18. // 'likeno': 12
  19. class NewsFeedCardFooter extends StatelessWidget {
  20. final bool isLike;
  21. final VoidCallback? onLike;
  22. final VoidCallback? onComment;
  23. final VoidCallback? onShare;
  24. final bool showShare;
  25. const NewsFeedCardFooter({
  26. Key? key,
  27. required this.isLike,
  28. this.onLike,
  29. this.onComment,
  30. this.onShare,
  31. this.showShare = false,
  32. })
  33. : super(key: key);
  34. @override
  35. Widget build(BuildContext context) {
  36. return Container(
  37. height: 40,
  38. width: double.infinity,
  39. padding: const EdgeInsets.symmetric(horizontal: 16),
  40. // color: Colors.red,
  41. child: Row(
  42. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  43. crossAxisAlignment: CrossAxisAlignment.center,
  44. children: [
  45. Container(
  46. padding: const EdgeInsets.all(8),
  47. child: Row(
  48. children: [
  49. const MyAssetImage(Assets.communityLike, width: 16,height: 16,),
  50. MyTextView(
  51. 'Like',
  52. textColor: ColorUtils.string2Color('#767676'),
  53. fontSize: 14,
  54. isFontRegular: true,
  55. textAlign: TextAlign.left,
  56. marginLeft: 8,
  57. ),
  58. ],
  59. ),
  60. ).onTap((){
  61. Log.d("点击了like");
  62. onLike?.call();
  63. }),
  64. Container(
  65. padding: const EdgeInsets.all(8),
  66. child: Row(
  67. children: [
  68. const MyAssetImage(Assets.communityComments, width: 16,height: 16,),
  69. MyTextView(
  70. 'Comments',
  71. textColor: ColorUtils.string2Color('#767676'),
  72. fontSize: 14,
  73. isFontRegular: true,
  74. textAlign: TextAlign.left,
  75. marginLeft: 8,
  76. ),
  77. ],
  78. ),
  79. ).onTap((){
  80. // Log.d("点击了comments ${tabsRouterKey.currentState?.controller?.activeIndex}");
  81. // tabsRouterKey.currentState?.controller?.setActiveIndex(2);
  82. onComment?.call();
  83. }),
  84. if(showShare)
  85. Container(
  86. padding: const EdgeInsets.all(8),
  87. child: Row(
  88. children: [
  89. const MyAssetImage(Assets.communityShare, width: 16,height: 16,),
  90. MyTextView(
  91. 'Share',
  92. textColor: ColorUtils.string2Color('#767676'),
  93. fontSize: 14,
  94. isFontRegular: true,
  95. textAlign: TextAlign.left,
  96. marginLeft: 8,
  97. ),
  98. ],
  99. ),
  100. ).onTap((){
  101. Log.d("点击了share");
  102. onShare?.call();
  103. }),
  104. ]
  105. )
  106. );
  107. }
  108. }