Skip to content

Commit 754c681

Browse files
committed
fix bug
1 parent 204d89b commit 754c681

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

lib/common/dao/user_dao.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class UserDao {
3737
);
3838
dynamic resultData;
3939
if (res != null && res.result) {
40-
var result = Uri.parse("gsy://oauth?$res.data");
40+
var result = Uri.parse("gsy://oauth?${res.data}");
4141
var token = result.queryParameters["access_token"]!;
4242
var token0 = 'token $token';
4343
await LocalStorage.save(Config.TOKEN_KEY, token0);

lib/page/repos/repository_file_list_page.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)