Skip to content

Commit 34a72d5

Browse files
committed
add bottom icon
1 parent c7e7c4d commit 34a72d5

2 files changed

Lines changed: 60 additions & 6 deletions

File tree

‎lib/common/style/GSYStyle.dart‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,16 @@ class GSYStrings {
224224
static const String repos_tab_issue_open = "打开";
225225
static const String repos_tab_issue_closed = "关闭";
226226

227+
227228
static const String repos_issue_search = "搜索";
229+
230+
static const String issue_reply = "回复";
231+
static const String issue_edit = "编辑";
232+
static const String issue_open = "打开";
233+
static const String issue_close = "关闭";
234+
static const String issue_lock = "锁定";
235+
static const String issue_unlock = "解锁";
236+
228237
}
229238

230239
class GSYICons {

‎lib/page/IssueDetailPage.dart‎

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:gsy_github_app_flutter/common/dao/IssueDao.dart';
3+
import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart';
4+
import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart';
35
import 'package:gsy_github_app_flutter/widget/GSYListState.dart';
46
import 'package:gsy_github_app_flutter/widget/GSYPullLoadWidget.dart';
57
import 'package:gsy_github_app_flutter/widget/IssueHeaderItem.dart';
@@ -33,6 +35,8 @@ class _IssueDetailPageState extends GSYListState<IssueDetailPage> {
3335

3436
int selectIndex = 0;
3537

38+
bool headerStatus = false;
39+
3640
IssueHeaderViewModel issueHeaderViewModel = new IssueHeaderViewModel();
3741

3842
_IssueDetailPageState(this.issueNum, this.userName, this.reposName);
@@ -52,16 +56,56 @@ class _IssueDetailPageState extends GSYListState<IssueDetailPage> {
5256

5357
_getDataLogic() async {
5458
if (page <= 1) {
55-
var res = await IssueDao.getIssueInfoDao(userName, reposName, issueNum);
56-
if (res != null && res.result) {
57-
setState(() {
58-
issueHeaderViewModel = res.data;
59-
});
60-
}
59+
_getHeaderInfo();
6160
}
6261
return await IssueDao.getIssueCommentDao(userName, reposName, issueNum, page: page);
6362
}
6463

64+
_getHeaderInfo() async {
65+
var res = await IssueDao.getIssueInfoDao(userName, reposName, issueNum);
66+
if (res != null && res.result) {
67+
setState(() {
68+
issueHeaderViewModel = res.data;
69+
headerStatus = true;
70+
});
71+
}
72+
}
73+
74+
_getBottomWidget() {
75+
List<Widget> bottomWidget = (headerStatus)
76+
? []
77+
: <Widget>[
78+
new FlatButton(
79+
onPressed: () {
80+
CommonUtils.showLoadingDialog(context);
81+
/*return ReposDao.doRepositoryStarDao(userName, reposName, bottomStatusModel.star).then((result) {
82+
_getHeaderInfo();
83+
Navigator.pop(context);
84+
});*/
85+
},
86+
child: new Text(GSYStrings.issue_reply, style: GSYConstant.smallText)),
87+
new Container(width: 0.3, height: 30.0, color: Color(GSYColors.subLightTextColor)),
88+
new FlatButton(
89+
onPressed: () {
90+
CommonUtils.showLoadingDialog(context);
91+
/*return ReposDao.doRepositoryWatchDao(userName, reposName, bottomStatusModel.watch).then((result) {
92+
_refresh();
93+
Navigator.pop(context);
94+
});*/
95+
},
96+
child: new Text(GSYStrings.issue_edit, style: GSYConstant.smallText)),
97+
new Container(width: 0.3, height: 30.0, color: Color(GSYColors.subLightTextColor)),
98+
new FlatButton(
99+
onPressed: () {},
100+
child: new Text((issueHeaderViewModel.state == 'closed') ? GSYStrings.issue_open : GSYStrings.issue_close, style: GSYConstant.smallText)),
101+
new Container(width: 0.3, height: 30.0, color: Color(GSYColors.subLightTextColor)),
102+
new FlatButton(
103+
onPressed: () {},
104+
child: new Text((issueHeaderViewModel.locked) ? GSYStrings.issue_unlock : GSYStrings.issue_lock, style: GSYConstant.smallText)),
105+
];
106+
return bottomWidget;
107+
}
108+
65109
@override
66110
bool get wantKeepAlive => true;
67111

@@ -85,6 +129,7 @@ class _IssueDetailPageState extends GSYListState<IssueDetailPage> {
85129
Widget build(BuildContext context) {
86130
super.build(context); // See AutomaticKeepAliveClientMixin.
87131
return new Scaffold(
132+
persistentFooterButtons: _getBottomWidget(),
88133
appBar: new AppBar(
89134
title: new Text(
90135
reposName,

0 commit comments

Comments
 (0)