diff --git a/packages/flutter_community_chat_interface/lib/src/model/chat_user.dart b/packages/flutter_community_chat_interface/lib/src/model/chat_user.dart index 0eb7451..6b28765 100644 --- a/packages/flutter_community_chat_interface/lib/src/model/chat_user.dart +++ b/packages/flutter_community_chat_interface/lib/src/model/chat_user.dart @@ -18,12 +18,12 @@ class ChatUserModel { String? get fullName { var fullName = ''; - if (firstName != null) { + if (firstName != null && lastName != null) { + fullName += '$firstName $lastName'; + } else if (firstName != null) { fullName += firstName!; - } - - if (lastName != null) { - fullName += ' $lastName'; + } else if (lastName != null) { + fullName += lastName!; } return fullName == '' ? null : fullName;