getModal abstract method

Future<ModalContext> getModal(
  1. {required String title,
  2. required List<TextInputBuilder> components,
  3. Duration? timeout}
)

Present the user with a modal, wait for them to submit it, and return a context representing that submission.

title is the title of the modal that should be shown to the user.

If timeout is set, this method will complete with an error after timeout has passed.

components are the text inputs that will be presented to the user. The TextInputBuilder.customId can be later used with ModalContext.operator[] to get the value submitted by the user.

Implementation

Future<ModalContext> getModal({
  required String title,
  required List<TextInputBuilder> components,
  Duration? timeout,
});