Skip to content

Commit

Permalink
fix(gl): handle statistics null
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Apr 5, 2020
1 parent a5c1d0f commit a198430
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions lib/screens/gl_project.dart
Expand Up @@ -114,12 +114,13 @@ class GlProjectScreen extends StatelessWidget {
TableView(
hasIcon: true,
items: [
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}',
),
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}',
),
if (p.issuesEnabled)
TableViewItem(
leftIconData: Octicons.issue_opened,
Expand All @@ -133,12 +134,13 @@ class GlProjectScreen extends StatelessWidget {
text: Text('Merge requests'),
url: '/gitlab/projects/$id/merge_requests?prefix=$prefix',
),
TableViewItem(
leftIconData: Octicons.history,
text: Text('Commits'),
rightWidget: Text(p.statistics.commitCount.toString()),
url: '/gitlab/projects/$id/commits?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',
),
],
),
CommonStyle.verticalGap,
Expand Down

0 comments on commit a198430

Please sign in to comment.