提交 d8d34c31 authored 作者: maodou's avatar maodou

1:我的页面和个人信息页面超长昵称显示问题

上级 448adb05
......@@ -44,7 +44,6 @@ class _MinePageState extends State<MinePage> {
GestureDetector(
onTap: () async{
final result = await context.pushNamed(Routes.msgs);
print('---------------------------------1111$result');
if (result == true){
controller.getNums();
......
......@@ -2,23 +2,18 @@ part of mine;
/// 用户信息
class BuildUser extends StatelessWidget {
final void Function()? onTap;
final UserInfoModel userInfo;
const BuildUser ({
super.key,
this.onTap,
required this.userInfo
});
const BuildUser({super.key, this.onTap, required this.userInfo});
@override
Widget build(BuildContext context) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:onTap,
onTap: onTap,
child: Container(
margin: EdgeInsets.only(left: 10.w,right: 10.w),
margin: EdgeInsets.only(left: 10.w, right: 10.w),
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
......@@ -33,7 +28,10 @@ class BuildUser extends StatelessWidget {
color: Colors.cyan,
),
// color: Colors.cyan,
child: CustomImage.network(url: userInfo.headImg??'',radius: 22.5.w,),
child: CustomImage.network(
url: userInfo.headImg ?? '',
radius: 22.5.w,
),
),
Gaps.hGaps10,
Column(
......@@ -42,22 +40,34 @@ class BuildUser extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(userInfo.name??'',style: TextStyle(
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: 150.w, // 设置最大宽度
),
child: Text(
userInfo.name ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colours.c3,
fontSize: 15.w,
fontWeight: Fonts.medium,
height: 1.6.w
),),
height: 1.6.w),
),
),
Gaps.hGaps20,
Stack(
children: [
Container(
padding: EdgeInsets.only(right:8.w,left: 8.w),
padding: EdgeInsets.only(right: 8.w, left: 8.w),
height: 20.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21.w),
gradient: LinearGradient(
colors: [AppTheme.primary.withOpacity(0.03),AppTheme.primary.withOpacity(0.1)] , // 不可点击时的颜色,透明度为0.7
colors: [
AppTheme.primary.withOpacity(0.03),
AppTheme.primary.withOpacity(0.1)
], // 不可点击时的颜色,透明度为0.7
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
......@@ -68,26 +78,32 @@ class BuildUser extends StatelessWidget {
width: 16.w,
height: 17.w,
),
Text(userInfo.gradeName??'',style: TextStyle(fontSize: 11.w,color: AppTheme.primary),)
Text(
userInfo.gradeName ?? '',
style: TextStyle(
fontSize: 11.w,
color: AppTheme.primary),
)
],
),
),
Positioned(
left: 8,
child: SizedBox(
width: 16.w, height:17.w,
child: Image.asset('assets/images/grade.png')
),
width: 16.w,
height: 17.w,
child:
Image.asset('assets/images/grade.png')),
)
],
)
],
),
Gaps.vGaps5,
Text(userInfo.phone??'',style: TextStyle(
fontSize: 12.w,
color: Colours.c6
),)
Text(
userInfo.phone ?? '',
style: TextStyle(fontSize: 12.w, color: Colours.c6),
)
],
),
Gaps.hGaps20,
......
......@@ -287,15 +287,18 @@ class _UserInfoPageState extends State<UserInfoPage> {
color: Colours.c3,
),
),
SizedBox(width: 10.w,),
Row(
children: [
Text(
Container(width: 240.w, alignment: Alignment.centerRight,
child: Text(
value,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 14.w,
color: Colours.c9,
),
),
),),
Gaps.hGaps10,
SizedBox(
width: 5.w,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论