@@ -29,7 +29,9 @@ class _RepositoryDetailIssuePageState extends GSYListState<RepositoryDetailIssue
2929
3030 final String reposName;
3131
32+ String searchText;
3233 String issueState;
34+ int selectIndex;
3335
3436 _RepositoryDetailIssuePageState (this .userName, this .reposName);
3537
@@ -41,7 +43,7 @@ class _RepositoryDetailIssuePageState extends GSYListState<RepositoryDetailIssue
4143 );
4244 }
4345
44- _resolveSelectIndex (selectIndex ) {
46+ _resolveSelectIndex () {
4547 clearData ();
4648 switch (selectIndex) {
4749 case 0 :
@@ -57,6 +59,13 @@ class _RepositoryDetailIssuePageState extends GSYListState<RepositoryDetailIssue
5759 showRefreshLoading ();
5860 }
5961
62+ _getDataLogic (String searchString) async {
63+ if (searchString == null || searchString.trim ().length == 0 ) {
64+ return await IssueDao .getRepositoryIssueDao (userName, reposName, issueState, page: page);
65+ }
66+ return await IssueDao .searchRepositoryIssue (searchString, userName, reposName, this .issueState, page: this .page);
67+ }
68+
6069 @override
6170 bool get wantKeepAlive => true ;
6271
@@ -68,12 +77,12 @@ class _RepositoryDetailIssuePageState extends GSYListState<RepositoryDetailIssue
6877
6978 @override
7079 requestLoadMore () async {
71- return await IssueDao . getRepositoryIssueDao (userName, reposName, issueState, page : page );
80+ return await _getDataLogic ( this .searchText );
7281 }
7382
7483 @override
7584 requestRefresh () async {
76- return await IssueDao . getRepositoryIssueDao (userName, reposName, issueState, page : page );
85+ return await _getDataLogic ( this .searchText );
7786 }
7887
7988 @override
@@ -83,15 +92,20 @@ class _RepositoryDetailIssuePageState extends GSYListState<RepositoryDetailIssue
8392 backgroundColor: Color (GSYColors .mainBackgroundColor),
8493 appBar: new AppBar (
8594 leading: new Container (),
86- flexibleSpace: GSYSearchInputWidget ((value){}),
95+ flexibleSpace: GSYSearchInputWidget ((value) {
96+ this .searchText = value;
97+ }, (value) {
98+ _resolveSelectIndex ();
99+ }),
87100 elevation: 0.0 ,
88101 backgroundColor: Color (GSYColors .mainBackgroundColor),
89102 bottom: new GSYSelectItemWidget ([
90103 GSYStrings .repos_tab_issue_all,
91104 GSYStrings .repos_tab_issue_open,
92105 GSYStrings .repos_tab_issue_closed,
93106 ], (selectIndex) {
94- _resolveSelectIndex (selectIndex);
107+ this .selectIndex = selectIndex;
108+ _resolveSelectIndex ();
95109 }),
96110 ),
97111 body: GSYPullLoadWidget (
0 commit comments