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

fix: hide language bar if no data

This commit is contained in:
Rongjian Zhang 2019-09-23 16:10:46 +08:00
parent cbfa6221e4
commit 7562f391cc

View File

@ -199,25 +199,26 @@ class RepoScreen extends StatelessWidget {
],
),
borderView1,
Container(
padding: const EdgeInsets.all(_languageBarPadding),
child: ClipRRect(
borderRadius: BorderRadius.circular(2),
child: SizedBox(
height: 10,
child: Row(
children: join(
SizedBox(width: 1),
(payload['languages']['edges'] as List)
.map((lang) => Container(
color: convertColor(lang['node']['color']),
width: langWidth *
lang['size'] /
payload['languages']['totalSize']))
.toList())),
if ((payload['languages']['edges'] as List).isNotEmpty)
Container(
padding: const EdgeInsets.all(_languageBarPadding),
child: ClipRRect(
borderRadius: BorderRadius.circular(2),
child: SizedBox(
height: 10,
child: Row(
children: join(
SizedBox(width: 1),
(payload['languages']['edges'] as List)
.map((lang) => Container(
color: convertColor(lang['node']['color']),
width: langWidth *
lang['size'] /
payload['languages']['totalSize']))
.toList())),
),
),
),
),
TableView(
hasIcon: true,
items: [