Skip to main content

Form Bubble

The CometChatFormBubble component is used to render a form within a chat bubble. The form fields are dynamically built based on the data passed in the message prop. The form fields can include TextInput Element, Label Element, Checkbox Element, Radio Button Element, Dropdown, Single Select Element, Button Element. Once the form is filled out and submitted, the data will be sent to the provided URL or handled by a custom function.

Properties

PropertiesTypeDescription
titleString
formMessageFormMessageAn instance of the FormMessage class which holds information about the form fields. The form inputs are dynamically built based on the form fields' information in the message.
formBubbleStyleFormBubbleStyleAn object of styles for customizing the UI of the form bubble. You can override styles for the wrapper, title, goal completion text, and form inputs, etc. If a style is not provided, the default style will be used.
onSubmitTapFunction(Map<String, dynamic>)A parameter that defines if a custom callback is available or not.
themeCometChatThemePasses theme to the form bubble.
loggedInUserUserAn instance of the logged-in user object.
QuickViewStyleQuickViewStyleAn instance for setting goal completion styling properties.

FormBubbleStyle

FormBubbleStyle is a class extending BaseStyle containing attributes to customize the appearance of the CometChatFormBubble component.

PropertiesTypeDescription
dropDownElementStyleDropDownElementStyleUsed to set the font style of the title. The object should include fontFamily, fontSize, and fontWeight.
submitButtonStyleButtonStyleUsed to set the color of the title.
buttonElementStyleButtonStyleUsed to set the background color of the message bubble.
labelStyleTextStyleUsed to set the border radius of the message bubble.
textInputStyleTextInputElementStyleUsed to set the padding of the message bubble.
checkBoxStyleCheckBoxElementStyleUsed to set the font style of the goal completion text. The object should include fontFamily, fontSize, and fontWeight.
quickViewStyleQuickViewStyleUsed to set the color of the goal completion text.

Usage

CometChatFormBubble(
formMessage: formMessage,
loggedInUser: loggedInUser, // replace this with the logged-in user
)