提交 4b8b09ce authored 作者: yueweilu's avatar yueweilu

我的界面主页 调整布局

上级 9731fd18
......@@ -13,107 +13,113 @@ class _MinePageState extends State<MinePage> {
Widget build(BuildContext context) {
return GetBuilder<MineController>(
init: MineController(),
builder:(controller) => Scaffold(
backgroundColor:Colours.cF9,
appBar: CustomAppBar(
backgroundColor: Colors.transparent,
actions: [
CustomButton.icon(
padding: EdgeInsets.zero,
backgroundColor: Colors.transparent,
icon: Image.asset(
'assets/images/read_history.png',
),
onPressed: () => context.pushNamed(Routes.studyHistory),
),
CustomButton.icon(
padding: EdgeInsets.zero,
builder:(controller) => Stack(
children: [
Image.asset('assets/images/mine_bg.png'),
Scaffold(
backgroundColor:Colors.transparent,
appBar: CustomAppBar(
backgroundColor: Colors.transparent,
icon: Image.asset(
'assets/images/set.png',
),
onPressed: () => context.pushNamed(Routes.msgs),
),
GestureDetector(
onTap: (){
context.pushNamed(Routes.msgs);
// controller.logout(context);
},
child: badges.Badge(
position: badges.BadgePosition.topEnd(top: -5, end: 0),
showBadge: controller.num == 0?false:true,
badgeContent: Text(controller.num.toString(),style: const TextStyle(fontSize: 7,color: Colors.white),),
badgeStyle: const badges.BadgeStyle(
badgeColor: AppTheme.primary,
shape: badges.BadgeShape.circle
actions: [
CustomButton.icon(
padding: EdgeInsets.zero,
backgroundColor: Colors.transparent,
icon: Image.asset(
'assets/images/read_history.png',
),
onPressed: () => context.pushNamed(Routes.studyHistory),
),
child: CustomButton.icon(
CustomButton.icon(
padding: EdgeInsets.zero,
backgroundColor: Colors.transparent,
icon: Image.asset(
'assets/images/msg_black.png',
'assets/images/set.png',
),
// onPressed: () => context.pushNamed(Routes.msgs),
onPressed: () => context.pushNamed(Routes.msgs),
),
),
)
],
),
body: Container(
color: Colours.cF9,
child: SingleChildScrollView(
child: Container(
margin: const EdgeInsets.symmetric(horizontal: AppTheme.margin),
child: Column(
children: [
BuildUser(userInfo:controller.userInfo,onTap: (){
context.pushNamed(Routes.userInfo);
},),
Gaps.vGaps10,
BuildRead(items: controller.reads,onTap: (ReadModel model) async{
final result = await context.pushNamed(model.link??'');
if (result == true){
controller.getInfo();
}
}),
controller.ads.isNotEmpty?Gaps.vGaps10:const SizedBox(),
controller.ads.isNotEmpty?
Container(
color: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 10),
child: BuildBanner(items:controller.ads),
):const SizedBox(),
Gaps.vGaps10,
BuildAccount(items:controller.accounts,),
Gaps.vGaps10,
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: const Color(0xFFF9F9F9),
boxShadow: [
BoxShadow(
color: const Color(0xFFC7C7C7).withOpacity(0.5),
offset: const Offset(3, 0),
blurRadius: 10.w,
spreadRadius: 0.w,
),
],
GestureDetector(
onTap: (){
context.pushNamed(Routes.msgs);
// controller.logout(context);
},
child: badges.Badge(
position: badges.BadgePosition.topEnd(top: -5, end: 0),
showBadge: controller.num == 0?false:true,
badgeContent: Text(controller.num.toString(),style: const TextStyle(fontSize: 7,color: Colors.white),),
badgeStyle: const badges.BadgeStyle(
badgeColor: AppTheme.primary,
shape: badges.BadgeShape.circle
),
child: Column(
children: [
_buildItem('账户安全', ''),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
_buildItem('意见反馈', ''),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
_buildItem('关于我们', Routes.about),
],
child: CustomButton.icon(
padding: EdgeInsets.zero,
backgroundColor: Colors.transparent,
icon: Image.asset(
'assets/images/msg_black.png',
),
// onPressed: () => context.pushNamed(Routes.msgs),
),
),
],
)
],
),
body: Container(
color: Colors.transparent,
child: SingleChildScrollView(
child: Container(
// margin: const EdgeInsets.symmetric(horizontal: AppTheme.margin),
child: Column(
children: [
BuildUser(userInfo:controller.userInfo,onTap: (){
context.pushNamed(Routes.userInfo);
},),
Gaps.vGaps10,
BuildRead(items: controller.reads,onTap: (ReadModel model) async{
final result = await context.pushNamed(model.link??'');
if (result == true){
controller.getInfo();
}
}),
controller.ads.isNotEmpty?Gaps.vGaps10:const SizedBox(),
controller.ads.isNotEmpty?
Container(
color: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 10),
child: BuildBanner(items:controller.ads),
):const SizedBox(),
Gaps.vGaps5,
BuildAccount(items:controller.accounts,),
Gaps.vGaps10,
Container(
margin: const EdgeInsets.symmetric(horizontal: 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: Column(
children: [
_buildItem('账户安全', ''),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
_buildItem('意见反馈', ''),
Container(color: Colours.cLine,margin: const EdgeInsets.symmetric(horizontal: 15),height: 1,),
_buildItem('关于我们', Routes.about),
],
),
),
],
),
),
),
),
),
),
)
],
),
);
}
......@@ -135,10 +141,10 @@ class _MinePageState extends State<MinePage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(title,style: const TextStyle(fontSize: 14,color: Colours.c3,),),
Container(
SizedBox(
width: 5,
height: 8,
color: Colors.cyan,
child: Image.asset('assets/images/right_arrow.png'),
)
],
),
......
......@@ -12,9 +12,10 @@ class BuildAccount extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: AppTheme.margin),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: const Color(0xFFF9F9F9),
color:Colors.white,
boxShadow: [
BoxShadow(
color: const Color(0xFFC7C7C7).withOpacity(0.5),
......
......@@ -14,45 +14,54 @@ class BuildRead extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 16.5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: const Color(0xFFF9F9F9),
boxShadow: [
BoxShadow(
color: const Color(0xFFC7C7C7).withOpacity(0.5),
offset: const Offset(3, 0),
blurRadius: 10.w,
spreadRadius: 0.w,
child: Stack(
children: [
Container(
width: double.infinity,
child: Image.asset('assets/images/read_bg.png',fit: BoxFit.cover,)
),
Container(
padding: const EdgeInsets.symmetric(vertical: 16.5),
color: Colors.transparent,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Colors.transparent,
// boxShadow: [
// BoxShadow(
// color: const Color(0xFFC7C7C7).withOpacity(0.5),
// offset: const Offset(3, 0),
// blurRadius: 10.w,
// spreadRadius: 0.w,
// ),
// ],
// ),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: items.map((model){
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
if (model.link != null){
if (model.link != Routes.love){
context.pushNamed(model.link!);
}
else{
if (onTap !=null) onTap!(model);
}
}
},
child: Column(
children: [
Text(model.value,style: const TextStyle(fontSize: 18,height: 1.6,fontWeight: Fonts.medium,color: Colours.c3),),
Gaps.vGaps5,
Text(model.name,style: const TextStyle(fontSize: 13,height:1.6,color: Colours.c6))
],
),
);
}).toList(),
),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: items.map((model){
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
if (model.link != null){
if (model.link != Routes.love){
context.pushNamed(model.link!);
}
else{
if (onTap !=null) onTap!(model);
}
}
},
child: Column(
children: [
Text(model.value,style: const TextStyle(fontSize: 18,height: 1.6,fontWeight: Fonts.medium,color: Colours.c3),),
Gaps.vGaps5,
Text(model.name,style: const TextStyle(fontSize: 13,height:1.6,color: Colours.c6))
],
),
);
}).toList(),
),
)
],
),
);
}
......
......@@ -17,42 +17,89 @@ class BuildUser extends StatelessWidget {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap:onTap,
child: Row(
children: [
Container(
width: 45.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22.5),
color: Colors.cyan,
child: Container(
margin: EdgeInsets.only(left: 10,right: 10),
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
width: 45.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(22.5),
color: Colors.cyan,
),
// color: Colors.cyan,
child: CustomImage.network(url: userInfo.containsKey('head_img')?userInfo['head_img']:'',radius: 22.5,),
),
Gaps.hGaps10,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(userInfo.containsKey('name')?userInfo['name']:'',style: TextStyle(
color: Colours.c3,
fontSize: 15.w,
fontWeight: Fonts.medium,
height: 1.6.w
),),
Gaps.hGaps20,
Stack(
children: [
Container(
padding: EdgeInsets.only(right:8,left: 8),
height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(21),
gradient: LinearGradient(
colors: [AppTheme.primary.withOpacity(0.03),AppTheme.primary.withOpacity(0.1)] , // 不可点击时的颜色,透明度为0.7
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
),
child: Row(
children: [
Container(
width: 16,
height: 17,
),
const Text('初级学者',style: TextStyle(fontSize: 11,color: AppTheme.primary),)
],
),
),
Positioned(
left: 8,
child: SizedBox(
width: 16, height:17,
child: Image.asset('assets/images/grade.png')
),
)
],
)
],
),
Gaps.vGaps5,
Text(userInfo.containsKey('phone')?userInfo['phone']:'',style: TextStyle(
fontSize: 12.w,
color: Colours.c6
),)
],
),
Gaps.hGaps20,
],
),
// color: Colors.cyan,
child: CustomImage.network(url: userInfo.containsKey('head_img')?userInfo['head_img']:''),
),
Gaps.hGaps10,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(userInfo.containsKey('name')?userInfo['name']:'',style: TextStyle(
color: Colours.c3,
fontSize: 15.w,
fontWeight: Fonts.medium,
height: 1.6.w
),),
Gaps.vGaps5,
Text(userInfo.containsKey('phone')?userInfo['phone']:'',style: TextStyle(
fontSize: 12.w,
color: Colours.c6
),)
],
),
Gaps.hGaps20,
Container(
width: 5,
height: 9,
color: Colors.cyan,
)
],
SizedBox(
width: 5,
height: 9,
child: Image.asset('assets/images/right_arrow.png'),
)
],
),
),
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论