setAtsignToChatWith method

void setAtsignToChatWith(
  1. String? chatWithAtSignFromApp,
  2. bool isGroup,
  3. String? groupId,
  4. List<String>? groupMembers,
)

Implementation

void setAtsignToChatWith(String? chatWithAtSignFromApp, bool isGroup, String? groupId, List<String>? groupMembers) {
  if (isGroup) {
    isGroupChat = isGroup;
    groupChatId = groupId;
    groupChatMembers = groupMembers;
  } else {
    // ignore: unnecessary_null_comparison
    if (chatWithAtSignFromApp != null) {
      if (chatWithAtSignFromApp.startsWith('@')) {
        chatWithAtSign = chatWithAtSignFromApp;
      } else {
        chatWithAtSign = '@$chatWithAtSignFromApp';
      }
    } else {
      chatWithAtSign = '';
    }
  }
}