@@ -21,7 +21,8 @@ class RepositoryDetailFileListPage extends StatefulWidget {
2121
2222 final String ? reposName;
2323
24- const RepositoryDetailFileListPage (this .userName, this .reposName, {super .key});
24+ const RepositoryDetailFileListPage (this .userName, this .reposName,
25+ {super .key});
2526
2627 @override
2728 RepositoryDetailFileListPageState createState () =>
@@ -51,10 +52,10 @@ class RepositoryDetailFileListPageState
5152 ? null
5253 : const Icon (GSYICons .REPOS_ITEM_NEXT , size: 12.0 );
5354 return GSYCardItem (
54- margin: const EdgeInsets .only (left: 10.0 , top: 5.0 , right: 10.0 , bottom: 5.0 ),
55+ margin:
56+ const EdgeInsets .only (left: 10.0 , top: 5.0 , right: 10.0 , bottom: 5.0 ),
5557 child: ListTile (
56- title:
57- Text (fileItemViewModel.name! , style: GSYConstant .smallSubText),
58+ title: Text (fileItemViewModel.name! , style: GSYConstant .smallSubText),
5859 leading: Icon (
5960 iconData,
6061 size: 16.0 ,
@@ -80,8 +81,8 @@ class RepositoryDetailFileListPageState
8081 onPressed: () {
8182 _resolveHeaderClick (index);
8283 },
83- child: Text ( "${ headerList [ index ]!} > " ,
84- style: GSYConstant .smallText),
84+ child:
85+ Text ( "${ headerList [ index ]!} > " , style: GSYConstant .smallText),
8586 );
8687 },
8788 itemCount: headerList.length,
@@ -95,7 +96,7 @@ class RepositoryDetailFileListPageState
9596 Fluttertoast .showToast (msg: GSYLocalizations .i18n (context)! .loading_text);
9697 return ;
9798 }
98- if (headerList[index] != "." ) {
99+ if (headerList.isNotEmpty && index != - 1 && headerList [index] != "." ) {
99100 List <String ?> newHeaderList = headerList.sublist (0 , index + 1 );
100101 String path = newHeaderList.sublist (1 , newHeaderList.length).join ("/" );
101102 setState (() {
@@ -129,7 +130,8 @@ class RepositoryDetailFileListPageState
129130 });
130131 showRefreshLoading ();
131132 } else {
132- String path = "${headerList .sublist (1 , headerList .length ).join ("/" )}/${fileItemViewModel .name !}" ;
133+ String path =
134+ "${headerList .sublist (1 , headerList .length ).join ("/" )}/${fileItemViewModel .name !}" ;
133135 if (CommonUtils .isImageEnd (fileItemViewModel.name)) {
134136 NavigatorUtils .gotoPhotoViewPage (
135137 context, "${fileItemViewModel .htmlUrl !}?raw=true" );
0 commit comments