Skip to content

Commit 782ed4a

Browse files
committed
格式化代码
1 parent 874ea02 commit 782ed4a

5 files changed

Lines changed: 44 additions & 58 deletions

File tree

‎lib/common/style/GSYStyle.dart‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class GSYColors {
3030

3131
class GSYConstant {}
3232

33-
3433
class GSYStrings {
3534
static const String login_text = "登录";
3635
}

‎lib/page/LoginPage.dart‎

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,36 @@ class LoginPage extends StatelessWidget {
77
@override
88
Widget build(BuildContext context) {
99
return new Container(
10-
color: Color(GSYColors.primaryValue),
11-
child: new Center(
12-
child: new Card(
13-
elevation: 5.0,
14-
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
15-
color: Color(GSYColors.cardWhite),
16-
margin: const EdgeInsets.all(30.0),
17-
child: new Padding(
18-
padding: new EdgeInsets.only(left: 30.0, top: 60.0, right: 30.0, bottom: 80.0),
19-
child: new Column(
20-
mainAxisAlignment: MainAxisAlignment.center,
21-
mainAxisSize: MainAxisSize.min,
22-
children: <Widget>[
23-
new Image(image: new AssetImage('static/images/logo.png'), width: 80.0, height: 80.0),
24-
new Padding(padding: new EdgeInsets.all(10.0)),
25-
new GSYInputWidget(hintText: "11111", iconData: Icons.access_alarm),
26-
new Padding(padding: new EdgeInsets.all(10.0)),
27-
new GSYInputWidget(hintText: "11111", iconData: Icons.access_alarm),
28-
new Padding(padding: new EdgeInsets.all(30.0)),
29-
new GSYFlexButton(
30-
text: GSYStrings.login_text,
31-
color: Color(GSYColors.primaryValue),
32-
textColor: Color(GSYColors.textWhite),
33-
onPress: () {},
34-
)
35-
],
36-
)))));
10+
color: Color(GSYColors.primaryValue),
11+
child: new Center(
12+
child: new Card(
13+
elevation: 5.0,
14+
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
15+
color: Color(GSYColors.cardWhite),
16+
margin: const EdgeInsets.all(30.0),
17+
child: new Padding(
18+
padding: new EdgeInsets.only(left: 30.0, top: 40.0, right: 30.0, bottom: 80.0),
19+
child: new Column(
20+
mainAxisAlignment: MainAxisAlignment.center,
21+
mainAxisSize: MainAxisSize.min,
22+
children: <Widget>[
23+
new Image(image: new AssetImage('static/images/logo.png'), width: 90.0, height: 90.0),
24+
new Padding(padding: new EdgeInsets.all(10.0)),
25+
new GSYInputWidget(hintText: "11111", iconData: Icons.access_alarm),
26+
new Padding(padding: new EdgeInsets.all(10.0)),
27+
new GSYInputWidget(hintText: "11111", iconData: Icons.access_alarm),
28+
new Padding(padding: new EdgeInsets.all(30.0)),
29+
new GSYFlexButton(
30+
text: GSYStrings.login_text,
31+
color: Color(GSYColors.primaryValue),
32+
textColor: Color(GSYColors.textWhite),
33+
onPress: () {},
34+
)
35+
],
36+
),
37+
),
38+
),
39+
),
40+
);
3741
}
3842
}

‎lib/page/WelcomePage.dart‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ class WelcomePage extends StatelessWidget {
99
Widget build(BuildContext context) {
1010
// 一秒以后将任务添加至event队列
1111
new Future.delayed(const Duration(seconds: 2), () {
12-
Navigator
13-
.of(context)
14-
.pushReplacement(new MaterialPageRoute(builder: (context) {
12+
Navigator.of(context).pushReplacement(new MaterialPageRoute(builder: (context) {
1513
return new LoginPage();
1614
}));
1715
});
1816
return new Container(
1917
color: Colors.white,
2018
child: new Center(
21-
child: new Text("李彦宏传闻辟谣", style: new TextStyle(color: Colors.black, fontSize:22.0)),
19+
child: new Text("李彦宏传闻辟谣", style: new TextStyle(color: Colors.black, fontSize: 22.0)),
2220
),
2321
);
2422
}

‎lib/widget/GSYInputWidget.dart‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22

33
/// 带图标的输入框
44
class GSYInputWidget extends StatefulWidget {
5-
65
final String hintText;
76

87
final IconData iconData;
@@ -15,7 +14,6 @@ class GSYInputWidget extends StatefulWidget {
1514

1615
/// State for [GSYInputWidget] widgets.
1716
class _GSYInputWidgetState extends State<GSYInputWidget> {
18-
1917
final String hintText;
2018

2119
final IconData iconData;
@@ -27,11 +25,11 @@ class _GSYInputWidgetState extends State<GSYInputWidget> {
2725
@override
2826
Widget build(BuildContext context) {
2927
return new TextField(
30-
controller: _controller,
31-
decoration: new InputDecoration(
32-
hintText: hintText,
33-
icon: new Icon(iconData),
34-
),
35-
);
28+
controller: _controller,
29+
decoration: new InputDecoration(
30+
hintText: hintText,
31+
icon: new Icon(iconData),
32+
),
33+
);
3634
}
37-
}
35+
}

‎lib/widget/GSYTabBarWidget.dart‎

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22

33
///支持顶部和顶部的TabBar控件
44
class GSYTabBarWidget extends StatefulWidget {
5-
65
///底部模式type
76
static const int BOTTOM_TAB = 1;
87

@@ -21,23 +20,13 @@ class GSYTabBarWidget extends StatefulWidget {
2120

2221
final String title;
2322

24-
GSYTabBarWidget(
25-
{Key key,
26-
this.type,
27-
this.tabItems,
28-
this.tabViews,
29-
this.backgroundColor,
30-
this.indicatorColor,
31-
this.title})
32-
: super(key: key);
23+
GSYTabBarWidget({Key key, this.type, this.tabItems, this.tabViews, this.backgroundColor, this.indicatorColor, this.title}) : super(key: key);
3324

3425
@override
35-
_GSYTabBarState createState() => new _GSYTabBarState(
36-
type, tabItems, tabViews, backgroundColor, indicatorColor, title);
26+
_GSYTabBarState createState() => new _GSYTabBarState(type, tabItems, tabViews, backgroundColor, indicatorColor, title);
3727
}
3828

39-
class _GSYTabBarState extends State<GSYTabBarWidget>
40-
with SingleTickerProviderStateMixin {
29+
class _GSYTabBarState extends State<GSYTabBarWidget> with SingleTickerProviderStateMixin {
4130
final int _type;
4231

4332
final List<Widget> _tabItems;
@@ -50,9 +39,7 @@ class _GSYTabBarState extends State<GSYTabBarWidget>
5039

5140
final String _title;
5241

53-
_GSYTabBarState(this._type, this._tabItems, this._tabViews,
54-
this._backgroundColor, this._indicatorColor, this._title)
55-
: super();
42+
_GSYTabBarState(this._type, this._tabItems, this._tabViews, this._backgroundColor, this._indicatorColor, this._title) : super();
5643

5744
TabController _tabController;
5845

0 commit comments

Comments
 (0)