my_page.dart
3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/app_bar.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
class MyPage extends StatefulWidget{
@override
State<StatefulWidget> createState() {
// TODO: implement createState
return new MyPageState();
}
}
class MyPageState extends State<MyPage>{
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_f5f5f5,
child: Column(
children: <Widget>[
MyAppBar("我的",showBack: false,backgroundColor: MyColours.color_2bb5b7,fontColor: MyColours.color_fefefe,),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(396),
decoration: BoxDecoration(
color: MyColours.color_2bb5b7,
boxShadow: [BoxShadow(color: MyColours.color_2e000000,offset: Offset(.0,2.0))],
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(ScreenUtil().setWidth(350)),bottomRight: Radius.circular(ScreenUtil().setWidth(350)))
),
child: Consumer<UserModel>(builder: (BuildContext context,UserModel model,Widget child){
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
VEmptyView(25),
Image.asset("assets/my_logo.png",width: ScreenUtil().setWidth(228),height: ScreenUtil().setWidth(228),),
VEmptyView(30),
Text(model.user.sellername,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(26)),),
VEmptyView(12),
Text(model.user.account+" | "+model.user.role_name,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(24)),)
],
);
},)
),
Consumer<UserModel>(builder: (BuildContext context,UserModel model,Widget child){
return GestureDetector(
onTap: (){
model.loginOut(context, {"seller_code":model.user.sellercode,"account":model.user.account});
},
child: Container(
height: ScreenUtil().setHeight(106),
margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20),vertical: ScreenUtil().setHeight(40)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(8))),
boxShadow: [BoxShadow(color: MyColours.color_14000000,offset: Offset(.0, 1.0))]
),
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset("assets/icon_exist.png",width: ScreenUtil().setWidth(25),height: ScreenUtil().setWidth(25),),
HEmptyView(18),
Text("退出登录",style: TextStyle(color: MyColours.color_353535,fontSize: ScreenUtil().setSp(30)))
],
),
),
),
);
},)
],
),
);
}
}