1
0
mirror of https://github.com/git-touch/git-touch synced 2025-01-05 12:27: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, expression: _expression,
), ),
)); ));
return res.data.repository.object; final data = res.data.repository.object;
// if (type == 'tree') { if (data.resolveType == 'Tree') {
// var entries = data['repository']['object']['entries'] as List; (data as GithubObjectTree).entries.sort((a, b) {
// entries.sort((a, b) { if (a.type == 'tree' && b.type == 'blob') {
// if (a['type'] == 'tree' && b['type'] == 'blob') { return -1;
// return -1; }
// } if (a.type == 'blob' && b.type == 'tree') {
// if (a['type'] == 'blob' && b['type'] == 'tree') { return 1;
// return 1; }
// } return 0;
// return 0; });
// }); }
// }
// return data['repository']['object']; return data;
}, },
actionBuilder: (data, _) { actionBuilder: (data, _) {
if (data == null) return null; if (data == null) return null;