InlineKeyboardButton class
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
Constructors
- InlineKeyboardButton.callbackData(String text, String? callbackData)
- CallbackData constructor
- InlineKeyboardButton.callbackGame(String text, CallbackGame? callbackGame)
- CallbackGame constructor
- InlineKeyboardButton.loginURL(String text, LoginUrl? loginUrl)
- LoginUrl constructor
- InlineKeyboardButton.pay(String text, {bool? pay})
- Pay constructor
- InlineKeyboardButton.switchInlineQuery(String text, String? switchInlineQuery)
- SwitchInlineQuery constructor
- InlineKeyboardButton.switchInlineQueryCurrentChat(String text, String? switchInlineQueryCurrentChat)
- SwitchInlineQueryCurrentChat constructor
- InlineKeyboardButton.url(String text, String? url)
- Url constructor
- InlineKeyboardButton.webApp(String text, WebAppInfo? webApp)
- WebApp constructor
Properties
- callbackData ↔ String?
-
Optional.
Data to be sent in a callback query to the bot when button is pressed,
1-64 bytes
getter/setter pair
- callbackGame ↔ CallbackGame?
-
Optional. Description of the game that will be launched when the user
presses the button.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- loginUrl ↔ LoginUrl?
-
Optional.
An HTTPS URL used to automatically authorize the user.
Can be used as a replacement for the Telegram Login Widget.
getter/setter pair
- pay ↔ bool?
-
Optional.
Specify True, to send a Pay button.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- switchInlineQuery ↔ String?
-
Optional.
If set, pressing the button will prompt the user to select one of their
chats, open that chat and insert the bot's username and the specified
inline query in the input field.
May be empty, in which case just the bot's username will be inserted.
getter/setter pair
- switchInlineQueryCurrentChat ↔ String?
-
Optional.
If set, pressing the button will insert the bot's username and the
specified inline query in the current chat's input field.
May be empty, in which case only the bot's username will be inserted.
getter/setter pair
- text ↔ String
-
Label text on the button
getter/setter pair
- url ↔ String?
-
Optional.
HTTP or tg:// URL to be opened when the button is pressed.
Links tg://user?id=<user_id> can be used to mention a user by their
ID without using a username, if this is allowed by their privacy settings.
getter/setter pair
- webApp ↔ WebAppInfo?
-
Optional.
Description of the Web App that will be launched when the user presses the
button.
The Web App will be able to send an arbitrary message on behalf of the
user using the method answerWebAppQuery. Available only in private chats
between a user and the bot.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map - Creates a json from the object
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, dynamic> json) → InlineKeyboardButton - Creates a object from a json
-
listFromJsonArray(
List json) → List< InlineKeyboardButton> - Creates a list of object from a json array
-
listOfListsFromJsonArray(
List json) → List< List< InlineKeyboardButton> > - Creates a list of list of object from a json array