组件优化

This commit is contained in:
2022-10-31 16:12:06 +08:00
parent b7f0fe3ac8
commit 5d8dca73d1
12 changed files with 252 additions and 262 deletions

View File

@@ -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,
),
],
);
}
}