1
1
import 'package:coderiver/common/GlobalConfig.dart' ;
2
+ import 'package:coderiver/common/Snack.dart' ;
2
3
import 'package:coderiver/common/color_const.dart' ;
3
- import 'package:coderiver/utils/SizeUtil .dart' ;
4
+ import 'package:coderiver/ui/mine/MinePage .dart' ;
4
5
import 'package:flutter/cupertino.dart' ;
5
6
import 'package:flutter/material.dart' ;
6
7
@@ -14,9 +15,6 @@ class _MarketPageState extends State<LoginPage> {
14
15
Widget build (BuildContext context) {
15
16
return new MaterialApp (
16
17
home: new Scaffold (
17
- /*appBar: new AppBar(
18
- title: new Text('登录', textAlign: TextAlign.right),
19
- ),*/
20
18
body: Container (
21
19
alignment: AlignmentDirectional .topStart,
22
20
padding: EdgeInsets .only (top: 40 , left: 20 , right: 20 ),
@@ -28,29 +26,128 @@ class _MarketPageState extends State<LoginPage> {
28
26
colors: [GREEN , GlobalConfig .colorPrimary]),
29
27
),
30
28
child: Column (
31
- mainAxisAlignment: MainAxisAlignment .start,
32
- crossAxisAlignment: CrossAxisAlignment .start,
33
- children: < Widget > [
34
- Padding (
35
- padding: const EdgeInsets .fromLTRB (280.0 , 10.0 , 0.0 , 0.0 ),
36
- child: Text (
37
- '登录' ,
38
- style: TextStyle (
39
- fontSize: 18 ,
40
- inherit: false , //2.不继承默认样式
41
- color: Colors .white),
42
- //TextDirection.ltr从左至右,TextDirection.rtl从右至左
43
- textDirection: TextDirection .rtl,
29
+ mainAxisAlignment: MainAxisAlignment .start,
30
+ crossAxisAlignment: CrossAxisAlignment .start,
31
+ children: < Widget > [
32
+ new Align (
33
+ alignment: FractionalOffset .topRight,
34
+ child: new Padding (
35
+ padding: EdgeInsets .only (right: 0.0 , top: 0.0 ),
36
+ child: new GestureDetector (
37
+ child: new Text (
38
+ '登录' ,
39
+ style: new TextStyle (
40
+ fontSize: 18.0 ,
41
+ color: Colors .white,
42
+ fontStyle: FontStyle .normal),
43
+ ),
44
+ onTap: () {
45
+ Navigator .push (
46
+ context,
47
+ new MaterialPageRoute (
48
+ builder: (BuildContext context) =>
49
+ new LoginPage ()));
50
+ },
51
+ ),
52
+ ),
53
+ ),
54
+ Padding (
55
+ padding: const EdgeInsets .fromLTRB (0.0 , 70.0 , 0.0 , 0.0 ),
56
+ child: new Image .asset (
57
+ 'images/logo.png' ,
58
+ width: 90 ,
59
+ height: 90 ,
60
+ )),
61
+ Padding (
62
+ padding: const EdgeInsets .fromLTRB (0.0 , 40.0 , 0.0 , 0.0 ),
63
+ child: new Text (
64
+ '欢迎来到CodeRiver' ,
65
+ style: new TextStyle (
66
+ fontSize: 24.0 ,
67
+ color: Colors .white,
68
+ fontStyle: FontStyle .normal),
69
+ ),
70
+ ),
71
+ RaisedButton .icon (
72
+ color: Colors .white,
73
+ disabledColor: Colors .transparent,
74
+ shape: new RoundedRectangleBorder (
75
+ side: BorderSide (color: Colors .white),
76
+ borderRadius: BorderRadius .all (Radius .circular (50 ))),
77
+ icon: new Icon (Icons .star),
78
+ onPressed: () {
79
+ Snack .show (context, "666" );
80
+ },
81
+ label: new Text ('使用GitHub账号登录使用GitHub账号登录' )),
82
+ RaisedButton .icon (
83
+ color: Colors .transparent,
84
+ disabledColor: Colors .transparent,
85
+ onPressed: () {
86
+ Snack .show (context, "777" );
87
+ },
88
+ shape: new RoundedRectangleBorder (
89
+ side: BorderSide (color: Colors .white),
90
+ borderRadius: BorderRadius .all (Radius .circular (50 ))),
91
+ icon: new Icon (null ),
92
+ label: new Text (
93
+ '创建账号创建账号创建账号创建账号创建账号' ,
94
+ style: new TextStyle (
95
+ color: Colors .white, fontStyle: FontStyle .normal),
96
+ )),
97
+ Padding (
98
+ padding: const EdgeInsets .fromLTRB (0.0 , 30.0 , 0.0 , 0.0 ),
99
+ child: new Text (
100
+ '更多登录方式' ,
101
+ style: new TextStyle (
102
+ fontSize: 18.0 ,
103
+ color: Colors .white,
104
+ fontStyle: FontStyle .normal),
105
+ ),
106
+ ),
107
+ Row (
108
+ mainAxisAlignment: MainAxisAlignment .start,
109
+ children: < Widget > [
110
+ Padding (
111
+ padding: EdgeInsets .all (10.0 ),
112
+ child: RaisedButton .icon (
113
+ color: Colors .white,
114
+ disabledColor: Colors .transparent,
115
+ icon: new Icon (Icons .star),
116
+ label: new Text ('新浪微博' ,
117
+ style: new TextStyle (
118
+ color: Colors .white,
119
+ fontStyle: FontStyle .normal)))),
120
+ Padding (
121
+ padding: EdgeInsets .all (20.0 ),
122
+ child: RaisedButton .icon (
123
+ color: Colors .transparent,
124
+ disabledColor: Colors .transparent,
125
+ icon: new Icon (Icons .star),
126
+ label: new Text (
127
+ '微信' ,
128
+ style: new TextStyle (
129
+ color: Colors .white,
130
+ fontStyle: FontStyle .normal),
131
+ ))),
132
+ ],
133
+ )
134
+ //_body(),
135
+ ],
44
136
),
45
137
),
46
- ImageIcon (
47
- AssetImage ('sources/images/logo.png' ), color: Colors .white,)
48
- //TopTitleBar(),
49
- //_body(),
50
- ],
51
138
),
52
- ),)
53
- ,
54
139
);
55
140
}
56
141
}
142
+
143
+ Widget _buildLoginBtn (BuildContext context) {
144
+ return RaisedButton (
145
+ padding: const EdgeInsets .all (8.0 ),
146
+ color: GlobalConfig .colorPrimary,
147
+ textColor: Colors .white,
148
+ child: Text ("登录" ),
149
+ elevation: 4.0 ,
150
+ onPressed: () {
151
+ Snack .show (context, "账号/密码不符合标准" );
152
+ });
153
+ }
0 commit comments