头像对接

hmxc
小赖 4 years ago
parent 37b9334fda
commit 5d65480cd5

@ -73,33 +73,29 @@ class _PersonalDrawState extends State<PersonalDraw> {
children: [ children: [
SizedBox(width: 32.w), SizedBox(width: 32.w),
// //
AkuRoundButton( Material(
height: 72.w, borderRadius: BorderRadius.circular(36.w),
onPressed: () {}, clipBehavior: Clip.antiAlias,
child: Material( color: Colors.grey,
borderRadius: BorderRadius.circular(36.w), child: userProvider.isLogin
clipBehavior: Clip.antiAlias, ? FadeInImage.assetNetwork(
color: Colors.grey, placeholder: R.ASSETS_PLACEHOLDER_WEBP,
child: userProvider.isLogin image: API.image(
? FadeInImage.assetNetwork( userProvider.profileModel.firstImg?.url ?? '',
placeholder: R.ASSETS_PLACEHOLDER_WEBP, ),
image: API.image( height: 72.w,
userProvider.profileModel.firstImg?.url ?? '', width: 72.w,
), )
height: 72.w, : Icon(Icons.person),
width: 72.w,
)
: Icon(Icons.person),
),
), ),
SizedBox(width: 24.w), SizedBox(width: 24.w),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// //
userProvider.isSigned userProvider.isLogin
? Text( ? Text(
userProvider.userInfoModel.nickName, userProvider.infoModel.nickName,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 28.sp,

@ -1,7 +1,10 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart'; import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -30,26 +33,31 @@ class _UserInfoPageState extends State<UserInfoPage> {
}, },
title: Text('头像'), title: Text('头像'),
height: 168.w, height: 168.w,
suffix: CircleAvatar( suffix: Material(
radius: 60.w, color: Colors.grey,
backgroundColor: Colors.white, borderRadius: BorderRadius.circular(36.w),
backgroundImage: userProvider.userInfoModel.avatar == null clipBehavior: Clip.antiAlias,
? null child: userProvider.isLogin
: FileImage(userProvider.userInfoModel.avatar), ? FadeInImage.assetNetwork(
child: userProvider.userInfoModel.avatar == null placeholder: R.ASSETS_PLACEHOLDER_WEBP,
? Icon(Icons.person_outline) image: API.image(
: null, userProvider.profileModel.firstImg?.url ?? '',
),
height: 72.w,
width: 72.w,
)
: Icon(Icons.person),
), ),
), ),
AkuTile( AkuTile(
onTap: () {}, onTap: () {},
title: Text('昵称'), title: Text('昵称'),
suffix: Text(userProvider.userInfoModel.nickName), suffix: Text(userProvider.infoModel.nickName),
), ),
AkuTile( AkuTile(
onTap: () {}, onTap: () {},
title: Text('手机'), title: Text('手机'),
suffix: Text(userProvider.userInfoModel.securePhone), suffix: Text(TextUtil.hideNumber(userProvider.infoModel.tel)),
), ),
], ],
), ),

Loading…
Cancel
Save