KeyboardButton class

This object represents one button of the reply keyboard.

For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive.

Note: requestContact and requestLocation options will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

Note: requestPoll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.

https://core.telegram.org/bots/api#keyboardbutton

Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake)

Constructors

KeyboardButton({required String text, KeyboardButtonRequestUser? requestUser, bool? requestContact, bool? requestLocation, KeyboardButtonPollType? requestPoll, WebAppInfo? webApp})
KeyboardButton.fromJson(Map<String, dynamic> json)
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
requestChat KeyboardButtonRequestChat?
getter/setter pair
requestContact bool?
getter/setter pair
requestLocation bool?
getter/setter pair
requestPoll KeyboardButtonPollType?
getter/setter pair
requestUser KeyboardButtonRequestUser?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
getter/setter pair
webApp WebAppInfo?
getter/setter pair

Methods

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

Operators

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