1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-16 02:11:11 +01:00

fix: sort files

This commit is contained in:
Rongjian Zhang 2019-12-07 17:00:23 +08:00
parent 9afa88d30b
commit 1055517650

View File

@ -78,22 +78,21 @@ class ObjectScreen extends StatelessWidget {
expression: _expression,
),
));
return res.data.repository.object;
final data = res.data.repository.object;
// if (type == 'tree') {
// var entries = data['repository']['object']['entries'] as List;
// entries.sort((a, b) {
// if (a['type'] == 'tree' && b['type'] == 'blob') {
// return -1;
// }
// if (a['type'] == 'blob' && b['type'] == 'tree') {
// return 1;
// }
// return 0;
// });
// }
if (data.resolveType == 'Tree') {
(data as GithubObjectTree).entries.sort((a, b) {
if (a.type == 'tree' && b.type == 'blob') {
return -1;
}
if (a.type == 'blob' && b.type == 'tree') {
return 1;
}
return 0;
});
}
// return data['repository']['object'];
return data;
},
actionBuilder: (data, _) {
if (data == null) return null;