1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-17 10:48:50 +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, borderView1,
Container( if ((payload['languages']['edges'] as List).isNotEmpty)
padding: const EdgeInsets.all(_languageBarPadding), Container(
child: ClipRRect( padding: const EdgeInsets.all(_languageBarPadding),
borderRadius: BorderRadius.circular(2), child: ClipRRect(
child: SizedBox( borderRadius: BorderRadius.circular(2),
height: 10, child: SizedBox(
child: Row( height: 10,
children: join( child: Row(
SizedBox(width: 1), children: join(
(payload['languages']['edges'] as List) SizedBox(width: 1),
.map((lang) => Container( (payload['languages']['edges'] as List)
color: convertColor(lang['node']['color']), .map((lang) => Container(
width: langWidth * color: convertColor(lang['node']['color']),
lang['size'] / width: langWidth *
payload['languages']['totalSize'])) lang['size'] /
.toList())), payload['languages']['totalSize']))
.toList())),
),
), ),
), ),
),
TableView( TableView(
hasIcon: true, hasIcon: true,
items: [ items: [