InlineKeyboardButton class abstract

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

Annotations
  • @freezed

Constructors

InlineKeyboardButton.new({@JsonKey(name: 'text') required String text, @JsonKey(name: 'url') String? url, @JsonKey(name: 'login_url') LoginURL? loginUrl, @JsonKey(name: 'callback_data') String? callbackData, @JsonKey(name: 'switch_inline_query') String? switchInlineQuery, @JsonKey(name: 'switch_inline_query_current_chat') String? switchInlineQueryCurrentChat, @JsonKey(name: 'callback_game') CallbackGame? callbackGame, @JsonKey(name: 'pay') bool? pay, @JsonKey(name: 'web_app') WebAppInfo? webApp, @JsonKey(name: 'switch_inline_query_chosen_chat') SwitchInlineQueryChosenChat? switchInlineQueryChosenChat, @JsonKey(name: 'copy_text') CopyTextButton? copyText})
This object represents one button of an inline keyboard.
const
factory
InlineKeyboardButton.fromJson(Map<String, dynamic> json)
Creates an InlineKeyboardButton from JSON object
factory

Properties

callbackData String?
Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
no setterinherited
callbackGame CallbackGame?
Optional. Description of the game that will be launched when the user presses the button.
no setterinherited
copyText CopyTextButton?
Optional. Description of the button that copies the specified text to the clipboard.
no setterinherited
copyWith → $InlineKeyboardButtonCopyWith<InlineKeyboardButton>
Create a copy of InlineKeyboardButton with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
loginUrl LoginURL?
Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
no setterinherited
pay bool?
Optional. Specify True, to send a Pay button.
no setterinherited
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. Can be empty, in which case just the bot's username will be inserted.
no setterinherited
switchInlineQueryChosenChat SwitchInlineQueryChosenChat?
Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
no setterinherited
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. Can be empty, in which case only the bot's username will be inserted.
no setterinherited
text String
Label text on the button
no setterinherited
url String?
Optional. HTTP or tg:// url to be opened when button is pressed
no setterinherited
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.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this InlineKeyboardButton to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited