switchInline method

InlineMenu<CTX> switchInline(
  1. String text,
  2. String query
)

Adds a switch inline query button to the current row.

Parameters:

  • text: The text to display on the button
  • query: The inline query to insert

Example:

menu.switchInline('Share', 'check this out');

Implementation

InlineMenu<CTX> switchInline(String text, String query) {
  _ensureCurrentRow();
  final button = InlineKeyboardButton(text: text, switchInlineQuery: query);
  _rows.last.add(_InlineMenuItemStatic(_InlineMenuStaticButton(button)));
  return this;
}