getDefaultSubtitle method

Widget getDefaultSubtitle(
  1. CometChatTheme theme, {
  2. required BuildContext context,
  3. required Conversation conversation,
  4. required bool showTypingIndicator,
  5. bool? hideThreadIndicator = true,
  6. String? threadIndicatorText,
  7. required CometChatConversationsController controller,
})

Implementation

Widget getDefaultSubtitle(CometChatTheme theme,
    {required BuildContext context,
    required Conversation conversation,
    required bool showTypingIndicator,
    bool? hideThreadIndicator = true,
    String? threadIndicatorText,
    required CometChatConversationsController controller}) {
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    mainAxisSize: MainAxisSize.min,
    children: [
      if (hideThreadIndicator != null && hideThreadIndicator == false)
        Text(
          cc.Translations.of(context).inAThread,
          style: conversationsStyle.threadIndicatorStyle ??
              TextStyle(
                  color: theme.palette.getPrimary(),
                  fontWeight: theme.typography.subtitle1.fontWeight,
                  fontSize: theme.typography.subtitle1.fontSize,
                  fontFamily: theme.typography.subtitle1.fontFamily),
        ),
      Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisSize: MainAxisSize.min,
        children: [
          getReceiptIcon(theme,
              conversation: conversation,
              hideReceipt:
                  controller.getHideReceipt(conversation, disableReceipt)),
          if (showTypingIndicator)
            Text(
              typingIndicatorText ??
                  ((conversation.conversationWith is User)
                      ? cc.Translations.of(context).isTyping
                      : "${controller.typingMap[conversation.conversationId]?.sender.name ?? ''} ${cc.Translations.of(context).isTyping}"),
              style: conversationsStyle.typingIndicatorStyle ??
                  TextStyle(
                      color: theme.palette.getPrimary(),
                      fontWeight: theme.typography.subtitle1.fontWeight,
                      fontSize: theme.typography.subtitle1.fontSize,
                      fontFamily: theme.typography.subtitle1.fontFamily),
            )
          else
            Expanded(
                child: getSubtitle(theme, context, conversation, controller))
        ],
      ),
    ],
  );
}