组件优化
This commit is contained in:
@@ -17,97 +17,108 @@ class UserTopBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: AppColors.white,
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
top: paddingTop,
|
||||
right: 24,
|
||||
bottom: paddingBottom,
|
||||
),
|
||||
height: avatarHeight + paddingTop + paddingBottom,
|
||||
child: GetX<AuthService>(builder: (_) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.info);
|
||||
},
|
||||
child: CustomAvatar(
|
||||
_.userInfo.value.avatar,
|
||||
size: avatarHeight,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.info);
|
||||
},
|
||||
child: Text(
|
||||
_.userInfo.value.nickname ?? '',
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w400,
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
color: AppColors.white,
|
||||
padding: EdgeInsets.only(
|
||||
left: 24,
|
||||
top: paddingTop,
|
||||
right: 24,
|
||||
bottom: paddingBottom,
|
||||
),
|
||||
height: avatarHeight + paddingTop + paddingBottom,
|
||||
child: GetX<AuthService>(
|
||||
builder: (_) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.info);
|
||||
},
|
||||
child: CustomAvatar(
|
||||
_.userInfo.value.avatar,
|
||||
size: avatarHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
Convert.hideCenterStr(_.userInfo.value.address ?? ''),
|
||||
style: const TextStyle(
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(
|
||||
text: _.userInfo.value.address,
|
||||
const SizedBox(width: 16),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.info);
|
||||
},
|
||||
child: Text(
|
||||
_.userInfo.value.nickname ?? '',
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
);
|
||||
UiTools.toast('地址复制成功');
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.copy,
|
||||
size: 12,
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Expanded(child: Container()),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.qrCode);
|
||||
},
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.qr_code,
|
||||
size: 18,
|
||||
color: AppColors.unactive,
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
Convert.hideCenterStr(
|
||||
_.userInfo.value.address ?? ''),
|
||||
style: const TextStyle(
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(
|
||||
text: _.userInfo.value.address,
|
||||
),
|
||||
);
|
||||
UiTools.toast('地址复制成功');
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.copy,
|
||||
size: 12,
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: AppColors.unactive,
|
||||
Expanded(child: Container()),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(UserRoutes.qrCode);
|
||||
},
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.qr_code,
|
||||
size: 18,
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: AppColors.unactive,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const Divider(
|
||||
height: 0,
|
||||
color: AppColors.border,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user