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 ef4f1fa..0eb7451 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 @@ -15,7 +15,17 @@ class ChatUserModel { final String? lastName; final String? imageUrl; - String? get fullName => firstName == null && lastName == null - ? null - : '${firstName ?? ''} ${lastName ?? ''}'; + String? get fullName { + var fullName = ''; + + if (firstName != null) { + fullName += firstName!; + } + + if (lastName != null) { + fullName += ' $lastName'; + } + + return fullName == '' ? null : fullName; + } }