@@ -77,42 +77,69 @@ class _IssueDetailPageState extends GSYListState<IssueDetailPage> {
7777 }
7878 }
7979
80+ _editIssue () {
81+ String title = issueHeaderViewModel.issueComment;
82+ String content = issueHeaderViewModel.issueDesHtml;
83+ issueInfoTitleControl = new TextEditingController (text: title);
84+ issueInfoValueControl = new TextEditingController (text: content);
85+ //编译Issue Info
86+ CommonUtils .showEditDialog (
87+ context,
88+ GSYStrings .issue_edit_issue,
89+ (titleValue) {
90+ title = titleValue;
91+ },
92+ (contentValue) {
93+ content = contentValue;
94+ },
95+ () {
96+ CommonUtils .showLoadingDialog (context);
97+ //提交修改
98+ IssueDao .editIssueDao (userName, reposName, issueNum, {"title" : title, "body" : content}).then ((result) {
99+ _getHeaderInfo ();
100+ Navigator .pop (context);
101+ Navigator .pop (context);
102+ });
103+ },
104+ titleController: issueInfoTitleControl,
105+ valueController: issueInfoValueControl,
106+ needTitle: true ,
107+ );
108+ }
109+
110+ _replyIssue () {
111+ //回复 Info
112+ String content = "" ;
113+ CommonUtils .showEditDialog (context, GSYStrings .issue_reply_issue, null , (replyContent) {
114+ content = replyContent;
115+ }, () {
116+ CommonUtils .showLoadingDialog (context);
117+ //提交评论
118+ IssueDao .addIssueCommentDao (userName, reposName, issueNum, content).then ((result) {
119+ showRefreshLoading ();
120+ Navigator .pop (context);
121+ Navigator .pop (context);
122+ });
123+ }, needTitle: false );
124+ }
125+
80126 _getBottomWidget () {
81127 List <Widget > bottomWidget = (! headerStatus)
82128 ? []
83129 : < Widget > [
84130 new FlatButton (
85- onPressed: () {
86- //回复 Info
87- CommonUtils . showEditDialog (context, GSYStrings .issue_reply_issue, null , (replyContent) {}, () {}, needTitle : false );
88- } ,
89- child : new Text ( GSYStrings .issue_reply, style : GSYConstant .smallText) ),
131+ onPressed: () {
132+ _replyIssue ();
133+ },
134+ child : new Text ( GSYStrings .issue_reply, style : GSYConstant .smallText) ,
135+ ),
90136 new Container (width: 0.3 , height: 30.0 , color: Color (GSYColors .subLightTextColor)),
91137 new FlatButton (
92- onPressed: () {
93- String title = issueHeaderViewModel.issueComment;
94- String content = issueHeaderViewModel.issueDesHtml;
95- issueInfoTitleControl = new TextEditingController (text: title);
96- issueInfoValueControl = new TextEditingController (text: content);
97- //编译Issue Info
98- CommonUtils .showEditDialog (
99- context,
100- GSYStrings .issue_edit_issue,
101- (titleValue) {
102- title = titleValue;
103- },
104- (contentValue) {
105- content = contentValue;
106- },
107- () {
108- //提交
109- },
110- titleController: issueInfoTitleControl,
111- valueController: issueInfoValueControl,
112- needTitle: true ,
113- );
114- },
115- child: new Text (GSYStrings .issue_edit, style: GSYConstant .smallText)),
138+ onPressed: () {
139+ _editIssue ();
140+ },
141+ child: new Text (GSYStrings .issue_edit, style: GSYConstant .smallText),
142+ ),
116143 new Container (width: 0.3 , height: 30.0 , color: Color (GSYColors .subLightTextColor)),
117144 new FlatButton (
118145 onPressed: () {
0 commit comments