From 6c227a55f453246f1c7c4cdc36f11b152dbd1189 Mon Sep 17 00:00:00 2001 From: Jonjo McKay Date: Sun, 4 Sep 2022 20:03:11 +0100 Subject: [PATCH] Added follower and following counts back to profiles. Fixes #245 --- .../android/en-US/changelogs/next.txt | 3 +- lib/profile/profile.dart | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/fastlane/metadata/android/en-US/changelogs/next.txt b/fastlane/metadata/android/en-US/changelogs/next.txt index 385edf56..a6dc62bd 100644 --- a/fastlane/metadata/android/en-US/changelogs/next.txt +++ b/fastlane/metadata/android/en-US/changelogs/next.txt @@ -19,4 +19,5 @@ * Fixed pinned tweets not appearing on profiles (#410) * Added support for some Discord embed addresses (fx/vxtwitter.com) (#436) * Tapping dates now switches between relative and absolute timestamps (#358) -* Added support for hiding NSFW tweets (#248) \ No newline at end of file +* Added support for hiding NSFW tweets (#248) +* Added follower and following counts back to profiles (#245) \ No newline at end of file diff --git a/lib/profile/profile.dart b/lib/profile/profile.dart index 2b89abab..0bb64973 100644 --- a/lib/profile/profile.dart +++ b/lib/profile/profile.dart @@ -273,6 +273,40 @@ class _ProfileScreenBodyState extends State with TickerProvid crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.end, children: [ + if (user.friendsCount != null) + Padding( + padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Icon(Icons.person, size: 12, color: Colors.white), + const SizedBox(width: 4), + Text.rich(TextSpan( + children: [ + TextSpan(text: '${widget.profile.user.friendsCount}', style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500)), + TextSpan(text: ' ${L10n.current.following.toLowerCase()}', style: const TextStyle(fontSize: 12)) + ] + )), + ], + ), + ), + if (user.followersCount != null) + Padding( + padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Icon(Icons.person, size: 12, color: Colors.white), + const SizedBox(width: 4), + Text.rich(TextSpan( + children: [ + TextSpan(text: '${widget.profile.user.followersCount}', style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500)), + TextSpan(text: ' ${L10n.current.followers.toLowerCase()}', style: const TextStyle(fontSize: 12)) + ] + )), + ], + ), + ), if (user.location != null && user.location!.isNotEmpty) Padding( padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 0),