You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
205 lines
6.7 KiB
205 lines
6.7 KiB
import 'package:flutter/material.dart'; |
|
import 'package:huixiang/generated/l10n.dart'; |
|
import 'package:huixiang/utils/font_weight.dart'; |
|
import 'package:huixiang/view_widget/login_tips_dialog.dart'; |
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
class MineItem extends StatefulWidget { |
|
@override |
|
State<StatefulWidget> createState() { |
|
return _MineItem(); |
|
} |
|
} |
|
|
|
class _MineItem extends State<MineItem> { |
|
@override |
|
Widget build(BuildContext context) { |
|
return Container( |
|
margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 28.h), |
|
// padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), |
|
decoration: BoxDecoration( |
|
color: Colors.white, |
|
borderRadius: BorderRadius.circular(8), |
|
boxShadow: [ |
|
BoxShadow( |
|
color: Colors.black.withAlpha(12), |
|
offset: Offset(0, 3), |
|
blurRadius: 14, |
|
spreadRadius: 0, |
|
) |
|
], |
|
), |
|
child: Column( |
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
children: [ |
|
// InkWell( |
|
// onTap: () { |
|
// SharedPreferences.getInstance().then((value) { |
|
// if (value.getString("token") == null || |
|
// value.getString("token") == "") { |
|
// LoginTipsDialog().show(context); |
|
// return; |
|
// } |
|
// Navigator.of(context).pushNamed('/router/mine_wallet'); |
|
// }); |
|
// }, |
|
// child: mineItem( |
|
// S.of(context).wodeqianbao, |
|
// "assets/image/icon_mine_wallet.png", |
|
// ), |
|
// ), |
|
Container( |
|
padding: EdgeInsets.only(left: 16,top:16,bottom:4), |
|
child: Text( |
|
S.of(context).wodegongju, |
|
style: TextStyle( |
|
color: Color(0xFF353535), |
|
fontWeight: MyFontWeight.semi_bold, |
|
fontSize: 16.sp, |
|
), |
|
), |
|
), |
|
Row( |
|
children: [ |
|
///我的动态 |
|
// Expanded(child: |
|
// InkWell( |
|
// onTap: () { |
|
// SharedPreferences.getInstance().then((value) { |
|
// if (value.getString("token") == null || |
|
// value.getString("token") == "") { |
|
// LoginTipsDialog().show(context); |
|
// return; |
|
// } |
|
// Navigator.of(context) |
|
// .pushNamed('/router/releasePage', |
|
// arguments: {}); |
|
// }); |
|
// }, |
|
// child: mineItem( |
|
// S.of(context).wodedongtai, |
|
// "assets/image/dynamic.png", |
|
// ), |
|
// ), |
|
// ), |
|
Expanded(child: InkWell( |
|
onTap: () { |
|
SharedPreferences.getInstance().then((value) { |
|
if (value.getString("token") == null || |
|
value.getString("token") == "") { |
|
LoginTipsDialog().show(context); |
|
return; |
|
} |
|
Navigator.of(context) |
|
.pushNamed('/router/exchange_history_page'); |
|
}); |
|
}, |
|
child: mineItem( |
|
S.of(context).duihuanlishi, |
|
"assets/image/icon_mine_records_of_consumption.png", |
|
), |
|
),), |
|
Expanded(child: InkWell( |
|
onTap: () { |
|
SharedPreferences.getInstance().then((value) { |
|
if (value.getString("token") == null || |
|
value.getString("token") == "") { |
|
LoginTipsDialog().show(context); |
|
return; |
|
} |
|
Navigator.of(context).pushNamed('/router/mine_card'); |
|
}); |
|
}, |
|
child: mineItem( |
|
S.of(context).wodekaquan, |
|
"assets/image/icon_mine_card.png", |
|
), |
|
),), |
|
Expanded(child: InkWell( |
|
onTap: () { |
|
SharedPreferences.getInstance().then((value) { |
|
if (value.getString("token") == null || |
|
value.getString("token") == "") { |
|
LoginTipsDialog().show(context); |
|
return; |
|
} |
|
Navigator.of(context).pushNamed('/router/manage_address_page'); |
|
}); |
|
}, |
|
child: mineItem( |
|
S.of(context).guanlidizhi, |
|
"assets/image/icon_location_address.png", |
|
), |
|
),), |
|
Expanded(child:InkWell( |
|
onTap: () { |
|
Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); |
|
}, |
|
child: mineItem( |
|
S.of(context).tuiguangma, |
|
"assets/image/icon_mine_promotion_code.png", |
|
), |
|
),), |
|
], |
|
), |
|
Row( |
|
children: [ |
|
Expanded(child:InkWell( |
|
onTap: () { |
|
Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); |
|
}, |
|
child: mineItem( |
|
"邀请记录", |
|
"assets/image/yao_q.png", |
|
), |
|
),), |
|
Expanded(child:Container()), |
|
Expanded(child:Container()), |
|
Expanded(child:Container()) |
|
], |
|
), |
|
// mineItem( |
|
// S.of(context).bangzhuyufankui, |
|
// "assets/image/icon_mine_feedback.png", |
|
// ), |
|
], |
|
), |
|
); |
|
} |
|
|
|
///我的页面下面条目 |
|
Widget mineItem(text, icon) { |
|
return Container( |
|
color: Colors.white, |
|
margin: EdgeInsets.symmetric(vertical: 6.h), |
|
child: Column( |
|
mainAxisAlignment: MainAxisAlignment.center, |
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
children: [ |
|
Image.asset( |
|
icon, |
|
width: 32.w, |
|
height: 32.w, |
|
), |
|
SizedBox( |
|
height: 2.h, |
|
), |
|
Text( |
|
text, |
|
style: TextStyle( |
|
fontWeight: MyFontWeight.medium, |
|
fontSize: 12.sp, |
|
color: Color(0xFF353535), |
|
), |
|
), |
|
// Icon( |
|
// Icons.keyboard_arrow_right, |
|
// size: 20, |
|
// color: Colors.black, |
|
// ) |
|
], |
|
), |
|
); |
|
} |
|
}
|
|
|