SfChat constructor

const SfChat({
  1. Key? key,
  2. required List<ChatMessage> messages,
  3. required String outgoingUser,
  4. ChatComposer? composer = const ChatComposer(),
  5. ChatActionButton? actionButton,
  6. WidgetBuilder? placeholderBuilder,
  7. ChatWidgetBuilder? messageHeaderBuilder,
  8. ChatWidgetBuilder? messageAvatarBuilder,
  9. ChatWidgetBuilder? messageContentBuilder,
  10. ChatWidgetBuilder? messageFooterBuilder,
  11. ChatSuggestionItemSelectedCallback? onSuggestionItemSelected,
  12. ChatMessageSettings incomingMessageSettings = const ChatMessageSettings(),
  13. ChatMessageSettings outgoingMessageSettings = const ChatMessageSettings(),
})

Creates an SfChat widget that displays the content of either incoming or outgoing messages based on the current user.

Each message includes details such as the message text, timestamp, author information, list of suggestions and suggestion settings.

Implementation

const SfChat({
  super.key,
  required this.messages,
  required this.outgoingUser,
  this.composer = const ChatComposer(),
  this.actionButton,
  this.placeholderBuilder,
  this.messageHeaderBuilder,
  this.messageAvatarBuilder,
  this.messageContentBuilder,
  this.messageFooterBuilder,
  this.onSuggestionItemSelected,
  this.incomingMessageSettings = const ChatMessageSettings(),
  this.outgoingMessageSettings = const ChatMessageSettings(),
});