Skip to content

Commit 40bf2bb

Browse files
committed
add issueList
1 parent 2ca3ae3 commit 40bf2bb

2 files changed

Lines changed: 68 additions & 43 deletions

File tree

‎lib/page/RepositoryDetailIssueList.dart‎

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
77
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
88
import 'package:gsy_github_app_flutter/widget/GSYPullLoadWidget.dart';
99
import 'package:gsy_github_app_flutter/widget/IssueItem.dart';
10+
import 'package:gsy_github_app_flutter/widget/RepositoryIssueListHeader.dart';
1011

1112
/**
1213
* 仓库详情issue列表
@@ -111,51 +112,24 @@ class _RepositoryDetailIssuePageState extends State<RepositoryDetailIssuePage> w
111112
Widget build(BuildContext context) {
112113
super.build(context); // See AutomaticKeepAliveClientMixin.
113114
return new Scaffold(
115+
backgroundColor: Color(GSYColors.mainBackgroundColor),
114116
appBar: new AppBar(
115-
backgroundColor: Colors.white,
116-
leading: new Column(
117-
children: <Widget>[
118-
new Container(
119-
child: new TextField(
120-
autofocus: true,
121-
decoration: new InputDecoration.collapsed(
122-
hintText: GSYStrings.repos_issue_search,
123-
hintStyle: GSYConstant.subSmallText,
124-
),
125-
style: GSYConstant.smallText,
126-
onSubmitted: (result) {}),
127-
),
128-
new GSYCardItem(
129-
color: Color(GSYColors.primaryValue),
130-
margin: EdgeInsets.all(10.0),
131-
shape: new RoundedRectangleBorder(
132-
borderRadius: BorderRadius.all(Radius.circular(4.0)),
133-
),
134-
child: new Padding(
135-
padding: new EdgeInsets.only(left: 10.0, top: 5.0, right: 10.0, bottom: 5.0),
136-
child: new Row(
137-
children: <Widget>[
138-
new Expanded(
139-
child: new Text(
140-
"Ffff",
141-
style: GSYConstant.middleTextWhite,
142-
)),
143-
new Container(width: 0.3, height: 40.0, color: Color(GSYColors.subLightTextColor)),
144-
new Expanded(
145-
child: new Text(
146-
"Ffff",
147-
style: GSYConstant.middleTextWhite,
148-
)),
149-
new Container(width: 0.3, height: 40.0, color: Color(GSYColors.subLightTextColor)),
150-
new Expanded(
151-
child: new Text(
152-
"Ffff",
153-
style: GSYConstant.middleTextWhite,
154-
)),
155-
],
156-
)))
157-
],
117+
leading: new Container(),
118+
flexibleSpace: new Container(
119+
padding: new EdgeInsets.only(left: 20.0, top: 12.0, right: 20.0, bottom:12.0),
120+
color: Colors.white,
121+
child: new TextField(
122+
autofocus: true,
123+
decoration: new InputDecoration.collapsed(
124+
hintText: GSYStrings.repos_issue_search,
125+
hintStyle: GSYConstant.subSmallText,
126+
),
127+
style: GSYConstant.smallText,
128+
onSubmitted: (result) {}),
158129
),
130+
elevation: 0.0,
131+
backgroundColor: Color(GSYColors.mainBackgroundColor),
132+
bottom: new RepositoryIssueListHeader(),
159133
),
160134
body: GSYPullLoadWidget(pullLoadWidgetControl, (BuildContext context, int index) => _renderEventItem(index), _handleRefresh, _onLoadMore),
161135
);
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
3+
import 'package:gsy_github_app_flutter/widget/GSYCardItem.dart';
4+
5+
/**
6+
* Created by guoshuyu
7+
* Date: 2018-07-19
8+
*/
9+
10+
class RepositoryIssueListHeader extends StatelessWidget implements PreferredSizeWidget {
11+
@override
12+
Widget build(BuildContext context) {
13+
return new GSYCardItem(
14+
color: Color(GSYColors.primaryValue),
15+
margin: EdgeInsets.all(10.0),
16+
shape: new RoundedRectangleBorder(
17+
borderRadius: BorderRadius.all(Radius.circular(4.0)),
18+
),
19+
child: new Padding(
20+
padding: new EdgeInsets.only(left: 0.0, top: 5.0, right: 0.0, bottom: 5.0),
21+
child: new Row(
22+
children: <Widget>[
23+
new Expanded(
24+
child: new Text(
25+
"All",
26+
style: GSYConstant.middleTextWhite,
27+
textAlign: TextAlign.center,
28+
)),
29+
new Container(width: 1.0, height: 30.0, color: Color(GSYColors.subLightTextColor)),
30+
new Expanded(
31+
child: new Text(
32+
"Open",
33+
style: GSYConstant.middleTextWhite,
34+
textAlign: TextAlign.center,
35+
)),
36+
new Container(width: 1.0, height: 30.0, color: Color(GSYColors.subLightTextColor)),
37+
new Expanded(
38+
child: new Text(
39+
"Closed",
40+
style: GSYConstant.middleTextWhite,
41+
textAlign: TextAlign.center,
42+
)),
43+
],
44+
)));
45+
}
46+
47+
@override
48+
Size get preferredSize {
49+
return new Size.fromHeight(50.0);
50+
}
51+
}

0 commit comments

Comments
 (0)