From d4e42ac4402d766e2abe1d2be4f56a873a2e7b60 Mon Sep 17 00:00:00 2001 From: Niels Gorter Date: Tue, 26 Sep 2023 11:48:17 +0200 Subject: [PATCH] fix --- .../lib/src/model/chat_user.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;