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.
159 lines
4.6 KiB
159 lines
4.6 KiB
3 years ago
|
import 'package:flutter/material.dart';
|
||
|
import 'package:huixiang/generated/l10n.dart';
|
||
|
import 'package:huixiang/utils/flutter_utils.dart';
|
||
|
import 'package:huixiang/utils/font_weight.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(
|
||
|
children: [
|
||
|
InkWell(
|
||
|
onTap: () {
|
||
|
SharedPreferences.getInstance().then((value) {
|
||
|
if (value.getString("token") == null ||
|
||
|
value.getString("token") == "") {
|
||
|
AppUtils.loginTips(context);
|
||
|
return;
|
||
|
}
|
||
|
Navigator.of(context).pushNamed('/router/mine_wallet');
|
||
|
});
|
||
|
},
|
||
|
child: mineItem(
|
||
|
S.of(context).wodeqianbao,
|
||
|
"assets/image/icon_mine_wallet.png",
|
||
|
),
|
||
|
),
|
||
|
InkWell(
|
||
|
onTap: () {
|
||
|
SharedPreferences.getInstance().then((value) {
|
||
|
if (value.getString("token") == null ||
|
||
|
value.getString("token") == "") {
|
||
|
AppUtils.loginTips(context);
|
||
|
return;
|
||
|
}
|
||
|
Navigator.of(context)
|
||
|
.pushNamed('/router/exchange_history_page');
|
||
|
});
|
||
|
},
|
||
|
child: mineItem(
|
||
|
S.of(context).duihuanlishi,
|
||
|
"assets/image/icon_mine_records_of_consumption.png",
|
||
|
),
|
||
|
),
|
||
|
InkWell(
|
||
|
onTap: () {
|
||
|
SharedPreferences.getInstance().then((value) {
|
||
|
if (value.getString("token") == null ||
|
||
|
value.getString("token") == "") {
|
||
|
AppUtils.loginTips(context);
|
||
|
return;
|
||
|
}
|
||
|
Navigator.of(context).pushNamed('/router/roll_center_page');
|
||
|
});
|
||
|
},
|
||
|
child: mineItem(
|
||
|
S.of(context).lingquanzhongxin,
|
||
|
"assets/image/icon_mine_invoice_assistant.png",
|
||
|
),
|
||
|
),
|
||
|
InkWell(
|
||
|
onTap: () {
|
||
|
SharedPreferences.getInstance().then((value) {
|
||
|
if (value.getString("token") == null ||
|
||
|
value.getString("token") == "") {
|
||
|
AppUtils.loginTips(context);
|
||
|
return;
|
||
|
}
|
||
|
Navigator.of(context).pushNamed('/router/manage_address_page');
|
||
|
});
|
||
|
},
|
||
|
child: mineItem(
|
||
|
S.of(context).guanlidizhi,
|
||
|
"assets/image/icon_location_address.png",
|
||
|
),
|
||
|
),
|
||
|
InkWell(
|
||
|
onTap: () {
|
||
|
Navigator.of(context).pushNamed('/router/setting_page');
|
||
|
},
|
||
|
child: mineItem(
|
||
|
S.of(context).shezhi,
|
||
|
"assets/image/icon_mine_setting.png",
|
||
|
),
|
||
|
),
|
||
|
// mineItem(
|
||
|
// S.of(context).bangzhuyufankui,
|
||
|
// "assets/image/icon_mine_feedback.png",
|
||
|
// ),
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
|
||
|
///我的页面下面条目
|
||
|
Widget mineItem(text, icon) {
|
||
|
return Container(
|
||
|
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
|
||
|
child: Row(
|
||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||
|
children: [
|
||
|
Image.asset(
|
||
|
icon,
|
||
|
width: 28.w,
|
||
|
height: 28.h,
|
||
|
),
|
||
|
SizedBox(
|
||
|
width: 12.w,
|
||
|
),
|
||
|
Expanded(
|
||
|
flex: 1,
|
||
|
child: Text(
|
||
|
text,
|
||
|
style: TextStyle(
|
||
|
fontWeight: MyFontWeight.medium,
|
||
|
fontSize: 16.sp,
|
||
|
color: Color(0xFF353535),
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
Icon(
|
||
|
Icons.keyboard_arrow_right,
|
||
|
size: 20,
|
||
|
color: Colors.black,
|
||
|
)
|
||
|
],
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|