Skip to content

Commit de165f6

Browse files
committed
登录界面
1 parent 0c04fbc commit de165f6

File tree

3 files changed

+123
-25
lines changed

3 files changed

+123
-25
lines changed

images/logo.png

15.4 KB
Loading

lib/ui/login/LoginPage.dart

Lines changed: 121 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:coderiver/common/GlobalConfig.dart';
2+
import 'package:coderiver/common/Snack.dart';
23
import 'package:coderiver/common/color_const.dart';
3-
import 'package:coderiver/utils/SizeUtil.dart';
4+
import 'package:coderiver/ui/mine/MinePage.dart';
45
import 'package:flutter/cupertino.dart';
56
import 'package:flutter/material.dart';
67

@@ -14,9 +15,6 @@ class _MarketPageState extends State<LoginPage> {
1415
Widget build(BuildContext context) {
1516
return new MaterialApp(
1617
home: new Scaffold(
17-
/*appBar: new AppBar(
18-
title: new Text('登录', textAlign: TextAlign.right),
19-
),*/
2018
body: Container(
2119
alignment: AlignmentDirectional.topStart,
2220
padding: EdgeInsets.only(top: 40, left: 20, right: 20),
@@ -28,29 +26,128 @@ class _MarketPageState extends State<LoginPage> {
2826
colors: [GREEN, GlobalConfig.colorPrimary]),
2927
),
3028
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+
],
44136
),
45137
),
46-
ImageIcon(
47-
AssetImage('sources/images/logo.png'), color: Colors.white,)
48-
//TopTitleBar(),
49-
//_body(),
50-
],
51138
),
52-
),)
53-
,
54139
);
55140
}
56141
}
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+
}

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ flutter:
3737
# the material Icons class.
3838
uses-material-design: true
3939

40-
40+
assets:
41+
- images/logo.png

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy