[baozhangchao] 3 gadus atpakaļ
vecāks
revīzija
2ca7527769
2 mainītis faili ar 157 papildinājumiem un 53 dzēšanām
  1. 51
    5
      lib/pages/main/index.dart
  2. 106
    48
      lib/pages/main/widgets/OtherColumn.dart

+ 51
- 5
lib/pages/main/index.dart Parādīt failu

@@ -2,6 +2,7 @@ import 'package:farmer_client/pages/main/widgets/OtherColumn.dart';
2 2
 import 'package:farmer_client/pages/main/widgets/UserAddress.dart';
3 3
 import 'package:farmer_client/pages/main/widgets/UserInfo.dart';
4 4
 import 'package:flutter/material.dart';
5
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5 6
 
6 7
 
7 8
 class MainPage extends StatefulWidget {
@@ -26,13 +27,58 @@ class _MainPageState extends State<MainPage> {
26 27
       ),
27 28
       body:Container(
28 29
         alignment: Alignment.center,
29
-        child:   Column(
30
+        child:   ListView(
30 31
           children: [
31
-            UserInfo(),
32
-            UserAddress(),
33
-            OtherColumn()
32
+            Column(
33
+              children: [
34
+                UserInfo(),//头部,头像手机号姓名
35
+                UserAddress(),//用户地址
36
+                OtherColumn(),//功能菜单栏
37
+                Container(
38
+                  height: 70.h,
39
+                  margin: EdgeInsets.only(top: 0, bottom: 40.0),
40
+                  alignment: Alignment.bottomCenter,
41
+                  decoration:  BoxDecoration(
42
+                    boxShadow: [
43
+                      BoxShadow(
44
+                        blurRadius: 10, //阴影范围
45
+                        spreadRadius: 0.1, //阴影浓度
46
+                        color: Colors.grey.withOpacity(0.2), //阴影颜色
47
+                      ),
48
+                    ],
49
+                  ),
50
+                  child: SizedBox(
51
+                    width: 315.w,
52
+                    height: 49.h,
53
+                    child: ElevatedButton(
54
+                      onPressed: () {
55
+                        // _handelSubmit();
56
+                        print('用户点击了支付啊阿松大撒地方');
57
+                      },
58
+                      child: const Text(
59
+                        "退出登陆",
60
+                        style: TextStyle(
61
+                            fontSize: 18,
62
+                            color: Colors.black,
63
+                            fontWeight: FontWeight.bold),
64
+                      ),
65
+                      style: ButtonStyle(
66
+                        elevation: MaterialStateProperty.all(0),
67
+                        backgroundColor:
68
+                        MaterialStateProperty.all(const Color(0xFFFFFFFF)),
69
+                        shape: MaterialStateProperty.all(
70
+                            const RoundedRectangleBorder(
71
+                                borderRadius:
72
+                                BorderRadius.all(Radius.circular(24.4)))),
73
+                      ),
74
+                    ),
75
+                  ),
76
+                ),
77
+              ],
78
+            ),
34 79
           ],
35
-        ),
80
+        )
81
+
36 82
       )
37 83
 
38 84
 

+ 106
- 48
lib/pages/main/widgets/OtherColumn.dart Parādīt failu

@@ -6,9 +6,8 @@ class OtherColumn extends StatelessWidget {
6 6
 
7 7
   @override
8 8
   Widget build(BuildContext context) {
9
-    return Container(
9
+    return  Container(
10 10
         alignment: Alignment.center,
11
-        height: 123.w,
12 11
         width: 345.w,
13 12
         margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
14 13
         decoration: BoxDecoration(
@@ -30,8 +29,8 @@ class OtherColumn extends StatelessWidget {
30 29
                 decoration: const BoxDecoration(
31 30
                     border: Border(
32 31
                         left: BorderSide(width: 5, color: Color(0xff000000)
33
-                          // 0x17000000
34
-                        ))),
32
+                            // 0x17000000
33
+                            ))),
35 34
                 child: Padding(
36 35
                   padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
37 36
                   child: Text(
@@ -43,54 +42,113 @@ class OtherColumn extends StatelessWidget {
43 42
                     ),
44 43
                   ),
45 44
                 )),
46
-            Row(
47
-              mainAxisAlignment: MainAxisAlignment.spaceBetween,
48
-              children: [
49
-                Container(
50
-                  child: Row(
51
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
52
-                    children: [
53
-                      Padding(
54
-                        padding: EdgeInsets.fromLTRB(17.w, 0, 10.w, 0),
55
-                        child: Image(
56
-                          image: AssetImage('images/aboutUs.png'),
57
-                          width: 17.w,
58
-                          height: 21.w,
59
-                        ),
45
+            Container(
46
+              child: Column(
47
+                children: [
48
+                  Container(
49
+                    height: 45.w,
50
+                    width: 310.w,
51
+                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
52
+
53
+                    decoration: const BoxDecoration(
54
+                        border:Border(
55
+                            bottom:
56
+                            BorderSide(width: 0.5, color: Color(0x20000000)
57
+                              // 0x17000000
58
+                            ))
59
+                    ),
60
+
61
+                    child: ListTile(
62
+                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
63
+                      // 这边使用了contentPadding
64
+                      leading: Image(
65
+                        image: AssetImage('images/aboutUs.png'),
66
+                        width: 18.w,
67
+                        height: 21.w,
68
+                      ),
69
+                      title: Transform(
70
+                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
71
+                        child: Text("版本更新",
72
+                            style: TextStyle(
73
+                                fontSize: 17.sp, color: Color(0xff333333))),
74
+                      ),
75
+                      trailing: Image(
76
+                        image: AssetImage('images/userRight.png'),
77
+                        width: 10.w,
78
+                        height: 18.w,
79
+                      ),
80
+                    ),
81
+                  ),
82
+                  Container(
83
+                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
84
+                    width: 310.w,
85
+                    height: 45.w,
86
+                    decoration: const BoxDecoration(
87
+                        border:Border(
88
+                            bottom:
89
+                            BorderSide(width: 0.5, color: Color(0x20000000)
90
+                              // 0x17000000
91
+                            ))
92
+                    ),
93
+
94
+                    child: ListTile(
95
+                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
96
+
97
+                      leading: Image(
98
+                        image: AssetImage('images/versionUpdate.png'),
99
+                        width: 18.w,
100
+                        height: 21.w,
60 101
                       ),
61
-                      Container(
62
-                        width: 260,
63
-                        child: GestureDetector(
64
-                          child: Text(
65
-                            '请填写详细地址请填写详细地址请填写详细地址',
66
-                            softWrap: true,
67
-                            maxLines: 1,
68
-                            textAlign: TextAlign.left,
69
-                            overflow: TextOverflow.ellipsis,
102
+                      title: Transform(
103
+                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
104
+                        child: Text("用户协议及隐私政策",
70 105
                             style: TextStyle(
71
-                              fontWeight: FontWeight.bold,
72
-                              fontSize: 17,
73
-                            ),
74
-                          ),
75
-                          onTap: () {
76
-                            print('修改地址');
77
-                          },
78
-                        ),
79
-                      )
80
-                    ],
106
+                                fontSize: 17.sp, color: Color(0xff333333))),
107
+                      ),
108
+                      trailing: Image(
109
+                        image: AssetImage('images/userRight.png'),
110
+                        width: 10.w,
111
+                        height: 18.w,
112
+                      ),
113
+                    ),
81 114
                   ),
82
-                ),
83
-                Container(
84
-                  alignment: Alignment.center,
85
-                  padding: EdgeInsets.fromLTRB(0, 0, 30.w, 0),
86
-                  child: Image(
87
-                    image: AssetImage('images/userRight.png'),
88
-                    width: 10.w,
89
-                    height: 18.w,
115
+                  Container(
116
+                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 20.w),
117
+                    width: 310.w,
118
+                    height: 45.w,
119
+                    decoration: const BoxDecoration(
120
+                        border:Border(
121
+                            bottom:
122
+                            BorderSide(width: 0.5, color: Color(0x20000000)
123
+                              // 0x17000000
124
+                            ))
125
+                    ),
126
+
127
+                    child: ListTile(
128
+                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
129
+
130
+                      leading: Image(
131
+                        image: AssetImage('images/feedbacks.png'),
132
+                        width: 18.w,
133
+                        height: 21.w,
134
+                      ),
135
+                      title: Transform(
136
+                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
137
+                        child: Text("意见反馈",
138
+                            style: TextStyle(
139
+                                fontSize: 17.sp, color: Color(0xff333333))),
140
+                      ),
141
+                      trailing: Image(
142
+                        image: AssetImage('images/userRight.png'),
143
+                        width: 10.w,
144
+                        height: 18.w,
145
+                      ),
146
+                    ),
90 147
                   ),
91
-                ),
92
-              ],
93
-            ),
148
+
149
+                ],
150
+              ),
151
+            )
94 152
           ],
95 153
         ));
96 154
   }