From 5a449eb0bec34e89dca1de2a61af55b9b2cd95b5 Mon Sep 17 00:00:00 2001 From: krawieck Date: Tue, 26 Jan 2021 22:28:06 +0100 Subject: [PATCH] rename getter properName -> displayName --- lib/util/extensions/api.dart | 4 ++-- lib/widgets/comment.dart | 2 +- lib/widgets/post.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util/extensions/api.dart b/lib/util/extensions/api.dart index c47ad1c..1b851fc 100644 --- a/lib/util/extensions/api.dart +++ b/lib/util/extensions/api.dart @@ -33,8 +33,8 @@ extension GetInstanceCommentView on Comment { // TODO: change it to something more robust? regex? String _extract(String s) => cleanUpUrl(s.split('/')[2]); -extension ProperName on UserSafe { - String get properName { +extension DisplayName on UserSafe { + String get displayName { final name = () { if (preferredUsername != null && preferredUsername != '') { return preferredUsername; diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index d592260..e1e8562 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -216,7 +216,7 @@ class CommentWidget extends HookWidget { } // decide which username to use - final username = comment.creator.properName; + final username = comment.creator.displayName; final body = () { if (isDeleted.value) { diff --git a/lib/widgets/post.dart b/lib/widgets/post.dart index dda07e4..4a816a3 100644 --- a/lib/widgets/post.dart +++ b/lib/widgets/post.dart @@ -195,7 +195,7 @@ class PostWidget extends HookWidget { text: 'by', style: TextStyle(fontWeight: FontWeight.w300)), TextSpan( - text: ' ${post.creator.properName}', + text: ' ${post.creator.displayName}', style: const TextStyle(fontWeight: FontWeight.w600), recognizer: TapGestureRecognizer()