@@ -42,14 +42,18 @@ class _RepositoryDetailPageState extends State<RepositoryDetailPage> {
4242
4343 final TarWidgetControl tarBarControl = new TarWidgetControl ();
4444
45- String currentBranch = "master" ;
45+ final BranchControl branchControl = new BranchControl ("master" );
46+
47+ final GlobalKey <RepositoryDetailFileListPageState > fileListKey = new GlobalKey <RepositoryDetailFileListPageState >();
48+
49+ final GlobalKey <ReposDetailInfoPageState > infoListKey = new GlobalKey <ReposDetailInfoPageState >();
4650
4751 List <String > branchList = new List ();
4852
4953 _RepositoryDetailPageState (this .userName, this .reposName);
5054
5155 _getReposDetail () async {
52- var result = await ReposDao .getRepositoryDetailDao (userName, reposName);
56+ var result = await ReposDao .getRepositoryDetailDao (userName, reposName, branchControl.currentBranch );
5357 if (result != null && result.result) {
5458 setState (() {
5559 reposDetailInfoPageControl.reposHeaderViewModel = result.data;
@@ -183,7 +187,14 @@ class _RepositoryDetailPageState extends State<RepositoryDetailPage> {
183187 padding: 5.0 ,
184188 mainAxisAlignment: MainAxisAlignment .center,
185189 )),
186- _renderBranchPopItem (currentBranch, branchList, (value) {}),
190+ _renderBranchPopItem (branchControl.currentBranch, branchList, (value) {
191+ setState (() {
192+ branchControl.currentBranch = value;
193+ });
194+ _getReposDetail ();
195+ //fileListKey.currentState.showRefreshLoading();
196+ infoListKey.currentState.showRefreshLoading ();
197+ }),
187198 ];
188199 return bottomWidget;
189200 }
@@ -207,9 +218,9 @@ class _RepositoryDetailPageState extends State<RepositoryDetailPage> {
207218 new Tab (text: GSYStrings .repos_tab_readme),
208219 ],
209220 tabViews: [
210- new ReposDetailInfoPage (reposDetailInfoPageControl, userName, reposName),
221+ new ReposDetailInfoPage (reposDetailInfoPageControl, userName, reposName, branchControl, key : infoListKey ),
211222 new RepositoryDetailIssuePage (userName, reposName),
212- new RepositoryDetailFileListPage (userName, reposName),
223+ new RepositoryDetailFileListPage (userName, reposName, branchControl, key : fileListKey ),
213224 new RepositoryDetailReadmePage (),
214225 ],
215226 backgroundColor: GSYColors .primarySwatch,
@@ -228,3 +239,9 @@ class BottomStatusModel {
228239
229240 BottomStatusModel (this .watchText, this .starText, this .watchIcon, this .starIcon, this .watch, this .star);
230241}
242+
243+ class BranchControl {
244+ String currentBranch;
245+
246+ BranchControl (this .currentBranch);
247+ }
0 commit comments