getOptionStatus method

bool getOptionStatus(
  1. String optionName
)

Implementation

bool getOptionStatus(String optionName) {
  switch (optionName) {
    case 'Reply':
      return selectedChatList.length > 1 ? false : true;

    case 'Report':
      return selectedChatList.length > 1
          ? false
          : selectedChatList[0].isMessageSentByMe
              ? false
              : true;

    case 'Message Info':
      return selectedChatList.length > 1
          ? false
          : selectedChatList[0].isMessageSentByMe
              ? true
              : false;

    case 'Share':
      for (var chatList in selectedChatList) {
        if (chatList.messageType == Constants.mText ||
            chatList.messageType == Constants.mLocation ||
            chatList.messageType == Constants.mContact) {
          return false;
        }
      }
      return true;

    case 'Favourite':
      // for (var chatList in selectedChatList) {
      //   if (chatList.isMessageStarred) {
      //     return true;
      //   }
      // }
      // return false;
      return selectedChatList.length > 1 ? false : true;

    default:
      return false;
  }
}