提交 feb8d22d authored 作者: yueweilu's avatar yueweilu

修改头像后 回到我的界面请求我的信息

上级 f5087672
......@@ -67,8 +67,11 @@ class _MinePageState extends State<MinePage> {
child: SingleChildScrollView(
child: Column(
children: [
BuildUser(userInfo:controller.userInfo,onTap: (){
context.pushNamed(Routes.userInfo,extra: controller.userInfo);
BuildUser(userInfo:controller.userInfo,onTap: () async{
final result = await context.pushNamed(Routes.userInfo,extra: controller.userInfo);
if (result == true){
controller.getInfo();
}
},),
Gaps.vGaps10,
BuildRead(items: controller.reads,onTap: (ReadModel model) async{
......
......@@ -14,90 +14,96 @@ class UserInfoPage extends StatefulWidget {
class _UserInfoPageState extends State<UserInfoPage> {
@override
Widget build(BuildContext context) {
return GetBuilder<UserInfoController>(
init: UserInfoController(widget.userInfo),
builder: (controller) =>Scaffold(
appBar: AppBar(
title: const Text('个人信息'),
centerTitle: true,
),
body: Container(
margin: const EdgeInsets.symmetric(horizontal: AppTheme.margin,vertical: AppTheme.margin),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color(0xFFC7C7C7).withOpacity(0.5),
offset: const Offset(3, 0),
blurRadius: 10.w,
spreadRadius: 0.w,
),
],
return WillPopScope(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserInfoController>(
init: UserInfoController(widget.userInfo),
builder: (controller) =>Scaffold(
appBar: AppBar(
title: const Text('个人信息'),
centerTitle: true,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
/// 头像
Container(
height: 52,
padding: const EdgeInsets.only(left: 18,right: 15),
child: GestureDetector(
onTap: () async {
final assets = await AssetsPicker.image(
context: context,
source: ImageSource.gallery,
maxWidth: 512,
maxHeight: 512,
);
controller.upload(path: assets!.path);
body: Container(
margin: const EdgeInsets.symmetric(horizontal: AppTheme.margin,vertical: AppTheme.margin),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color(0xFFC7C7C7).withOpacity(0.5),
offset: const Offset(3, 0),
blurRadius: 10.w,
spreadRadius: 0.w,
),
],
),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
/// 头像
Container(
height: 52,
padding: const EdgeInsets.only(left: 18,right: 15),
child: GestureDetector(
onTap: () async {
final assets = await AssetsPicker.image(
context: context,
source: ImageSource.gallery,
maxWidth: 512,
maxHeight: 512,
);
controller.upload(path: assets!.path);
},
child: Container(
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('头像',style: TextStyle(color: Colours.c3,fontSize: 14,height: 1.6),),
Row(
children: [
Container(
width: 33.w,
height: 33.w,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.cyan,
},
child: Container(
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text('头像',style: TextStyle(color: Colours.c3,fontSize: 14,height: 1.6),),
Row(
children: [
Container(
width: 33.w,
height: 33.w,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Colors.cyan,
),
child: CustomImage.network(url: controller.userInfo.headImg??'',radius: 16.5,),
),
child: CustomImage.network(url: controller.userInfo.headImg??'',radius: 16.5,),
),
Gaps.hGaps10,
SizedBox(
width: 5,
height: 8,
child: Image.asset('assets/images/right_arrow.png'),
)
],
)
],
Gaps.hGaps10,
SizedBox(
width: 5,
height: 8,
child: Image.asset('assets/images/right_arrow.png'),
)
],
)
],
),
),
),
),
),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
GestureDetector(
onTap: (){
context.pushNamed(Routes.nike);
},
child: _buildItem('昵称', widget.userInfo.name??'', )
),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
_buildItem('性别', widget.userInfo.sex ==1?'男':'女',),
],
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
GestureDetector(
onTap: (){
context.pushNamed(Routes.nike);
},
child: _buildItem('昵称', widget.userInfo.name??'', )
),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
_buildItem('性别', widget.userInfo.sex ==1?'男':'女',),
],
),
),
),
)
)
),
),
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论