KeyboardMenu class

This object represents a Keyboard menu with the actions to be done.

Implemented types

Constructors

KeyboardMenu({String? name, String? inputFieldPlaceholder, bool? isPersistent, bool? oneTimeKeyboard, bool? resizeKeyboard, bool? selective})
Constructs a KeyboardMenu

Properties

hashCode int
The hash code for this object.
no setterinherited
inputFieldPlaceholder String?
Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
getter/setter pairoverride
isPersistent bool?
Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
getter/setter pairoverride
keyboard List<List<KeyboardButton>>
List of rows of the keyboard
getter/setter pairoverride
name String
Name of the menu
getter/setter pairoverride-getter
oneTimeKeyboard bool?
Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
getter/setter pairoverride
resizeKeyboard bool?
Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
getter/setter pairoverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selective bool?
Optional. Use this parameter if you want to show the keyboard to specific users only. Targets:
getter/setter pairoverride

Methods

makeSelective() KeyboardMenu
Makes the menu selective
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
oneTime() KeyboardMenu
Makes the menu one time
persistent() KeyboardMenu
Makes the menu persistent
requestChat({required String text, required Handler handler, required int requestId, bool chatIsChannel = false, bool? chatIsForum, bool? chatHasUsername, bool? chatIsCreated, ChatAdministratorRights? userAdministratorRights, ChatAdministratorRights? botAdministratorRights, bool? botIsMember, ScopeOptions? options}) KeyboardMenu
Requests the user to select a chat from the list.
requestContact(String text, Handler handler, {ScopeOptions? options}) KeyboardMenu
Request contact from the user
requestLocation(String text, Handler handler, {ScopeOptions? options}) KeyboardMenu
Request location from the user
requestPoll(String text, KeyboardButtonPollType requestPoll, {ScopeOptions? options}) KeyboardMenu
Add a poll button to the last row
requestUser({required String text, required Handler handler, required int requestId, bool? userIsBot, bool? userIsPremium, ScopeOptions? options}) KeyboardMenu
Request the user to select a user from the list
requestUsers({required String text, required Handler handler, required int requestId, bool? userIsBot, bool? userIsPremium, int? maxQuantity, ScopeOptions? options}) KeyboardMenu
Request the user to select multiple users from the list
resized() KeyboardMenu
Makes the menu resized
row() KeyboardMenu
Add a new row to the keyboard
text(String text, Handler handler, {ScopeOptions? options}) KeyboardMenu
Add new item to the last row
toJson() Map<String, dynamic>
Converts the object to a JSON object
override
toString() String
A string representation of this object.
inherited
webApp(String text, String url) KeyboardMenu
Add a web app button to the last row

Operators

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