import 'package:dating_touchme_app/extension/ex_widget.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/pages/home/timeline_info.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; class TimelineItem extends StatefulWidget { const TimelineItem({super.key}); @override State createState() => _TimelineItemState(); } class _TimelineItemState extends State { @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(bottom: 15.w), child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Image.asset( Assets.imagesUserAvatar, width: 40.w, height: 40.w, ), SizedBox(width: 8.w,), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "刘美玲", style: TextStyle( fontSize: 13.w, fontWeight: FontWeight.w500 ), ), Text( "15:16", style: TextStyle( fontSize: 11.w, color: const Color.fromRGBO(51, 51, 51, .6), fontWeight: FontWeight.w500 ), ) ], ) ], ), PopupMenuButton( tooltip: "", padding: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), color: Colors.white, elevation: 8, offset: Offset(0, 32.w), // 相对按钮下移一点 itemBuilder: (context) => [ const PopupMenuItem(value: 'report', child: Text('举报')), ], onSelected: (v) { if (v == 'report') { print("举报"); } }, child: Icon( Icons.keyboard_control, size: 15.w, color: const Color.fromRGBO(51, 51, 51, 1), ), // 你的小圆按钮 ), ], ), Container( margin: EdgeInsets.symmetric(vertical: 11.w), child: Text( "你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。你总顾及别人,那谁来顾及你。" ), ), Image.asset( Assets.imagesRoseBanner, width: 375.w - 24, ), SizedBox(height: 14.w,), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Row( children: [ Image.asset( Assets.imagesLikeIcon, width: 14.w, height: 12.w, ), SizedBox(width: 6.w,), Text( "47", style: TextStyle( fontSize: 11.w, color: const Color.fromRGBO(144, 144, 144, .6) ), ) ], ), SizedBox(width: 33.w,), Row( children: [ Image.asset( Assets.imagesCommentIcon, width: 15.w, height: 15.w, ), SizedBox(width: 6.w,), Text( "23", style: TextStyle( fontSize: 11.w, color: const Color.fromRGBO(144, 144, 144, .6) ), ) ], ), ], ) ], ), ).onTap((){ Get.to(() => TimelineInfo()); }); } }