From 8cc4246569617ce2cf21d8354feb156ce0f572c6 Mon Sep 17 00:00:00 2001 From: shilangyu Date: Mon, 22 Feb 2021 19:47:38 +0100 Subject: [PATCH] Hide followed communities --- lib/widgets/user_profile.dart | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/lib/widgets/user_profile.dart b/lib/widgets/user_profile.dart index 0e46088..6160ca4 100644 --- a/lib/widgets/user_profile.dart +++ b/lib/widgets/user_profile.dart @@ -388,32 +388,23 @@ class _AboutTab extends HookWidget { ..sort((a, b) => a.community.name.compareTo(b.community.name))) communityTile( comm.community.name, comm.community.icon, comm.community.id), - divider + divider, ], - ListTile( - title: Center( - child: Text( - 'Subscribed:', - style: theme.textTheme.headline6.copyWith(fontSize: 18), + if (userDetails.follows.isNotEmpty) ...[ + ListTile( + title: Center( + child: Text( + 'Subscribed:', + style: theme.textTheme.headline6.copyWith(fontSize: 18), + ), ), ), - ), - if (userDetails.follows.isNotEmpty) for (final comm in userDetails.follows ..sort((a, b) => a.community.name.compareTo(b.community.name))) communityTile( comm.community.name, comm.community.icon, comm.community.id) - else - const Padding( - padding: EdgeInsets.only(top: 8), - child: Center( - child: Text( - 'this user does not subscribe to any community', - style: TextStyle(fontStyle: FontStyle.italic), - ), - ), - ) + ] ], ); }