fix(gl): project commits

This commit is contained in:
Rongjian Zhang 2020-04-06 13:30:44 +08:00
parent ce4f7a1809
commit 60904d763d
1 changed files with 16 additions and 14 deletions

View File

@ -114,13 +114,14 @@ class GlProjectScreen extends StatelessWidget {
TableView(
hasIcon: true,
items: [
if (p.statistics != null)
TableViewItem(
leftIconData: Octicons.code,
text: Text(langs.keys.isEmpty ? 'Code' : langs.keys.first),
rightWidget: Text(filesize(p.statistics.repositorySize)),
url: '/gitlab/projects/$id/tree/${p.defaultBranch}',
),
TableViewItem(
leftIconData: Octicons.code,
text: Text(langs.keys.isEmpty ? 'Code' : langs.keys.first),
rightWidget: p.statistics == null
? null
: Text(filesize(p.statistics.repositorySize)),
url: '/gitlab/projects/$id/tree/${p.defaultBranch}',
),
if (p.issuesEnabled)
TableViewItem(
leftIconData: Octicons.issue_opened,
@ -134,13 +135,14 @@ class GlProjectScreen extends StatelessWidget {
text: Text('Merge requests'),
url: '/gitlab/projects/$id/merge_requests?prefix=$prefix',
),
if (p.statistics != null)
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
rightWidget: Text(p.statistics.commitCount.toString()),
url: '/gitlab/projects/$id/commits?prefix=$prefix',
),
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
rightWidget: p.statistics == null
? null
: Text(p.statistics.commitCount.toString()),
url: '/gitlab/projects/$id/commits?prefix=$prefix',
),
],
),
CommonStyle.verticalGap,