setTitle method

void setTitle(
  1. String title
)

Sets the modal's title.

The title appears at the top of the modal dialog and should clearly describe the modal's purpose. Discord displays this prominently in the modal header.

Example

final modal = ModalBuilder('user_feedback')
  .setTitle('Share Your Feedback')
  .addTextInput(
    customId: 'message',
    label: 'Message',
    style: TextInputStyle.paragraph,
  );

Implementation

void setTitle(String title) {
  _title = title;
}