newfeed_card_header.dart 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import 'package:cs_resources/theme/app_colors_theme.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:flutter/widgets.dart';
  4. import 'package:shared/utils/color_utils.dart';
  5. import 'package:widgets/ext/ex_widget.dart';
  6. import 'package:widgets/my_load_image.dart';
  7. import 'package:widgets/my_text_view.dart';
  8. // 'id':1,
  9. // 'avator': Assets.communityCamera,
  10. // 'title': 'William Jefferson',
  11. // 'isFollow': false,
  12. // 'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
  13. // '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'],
  14. // 'time': 'June 17,2016 at 7:23 p.m.',
  15. // 'likeno': 12
  16. class NewsFeedCardHeader extends StatelessWidget {
  17. final String title;
  18. final String avator;
  19. final String time;
  20. final VoidCallback? onTap;
  21. const NewsFeedCardHeader({
  22. Key? key,
  23. required this.title,
  24. required this.avator,
  25. required this.time,
  26. this.onTap,
  27. }) : super(key: key);
  28. @override
  29. Widget build(BuildContext context) {
  30. return Container(
  31. padding: const EdgeInsets.only(left: 16,right: 60,),
  32. child: Row(
  33. mainAxisAlignment: MainAxisAlignment.start,
  34. crossAxisAlignment: CrossAxisAlignment.start,
  35. children: [
  36. MyLoadImage(
  37. avator,
  38. width: 45,
  39. height: 45,
  40. isCircle: true,
  41. fit: BoxFit.cover,
  42. ).onTap(() {
  43. // 点击头像
  44. onTap?.call();
  45. }),
  46. Expanded(
  47. child: Container(
  48. padding: const EdgeInsets.only(left:15, right: 40),
  49. // color: Colors.red,
  50. child: Column(
  51. mainAxisAlignment: MainAxisAlignment.start,
  52. crossAxisAlignment: CrossAxisAlignment.start,
  53. children: [
  54. MyTextView(
  55. title,
  56. isFontMedium: true,
  57. fontSize: 18,
  58. textColor: context.appColors.textBlack,
  59. maxLines: 1,
  60. isTextEllipsis: true,
  61. ),
  62. MyTextView(
  63. time,
  64. isFontRegular: true,
  65. fontSize: 13,
  66. marginTop: 8,
  67. textColor: ColorUtils.string2Color('#767676'),
  68. maxLines: 1,
  69. isTextEllipsis: true,
  70. ),
  71. ],
  72. ),
  73. ),
  74. ),
  75. ],
  76. ),
  77. );
  78. }
  79. }