MenuButton class abstract
This object describes the bot's menu button in a private chat. It should be
one of MenuButtonCommands
, MenuButtonWebApp
, or MenuButtonDefault
.
If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise, the default menu button is applied. By default, the menu button opens the list of bot commands.
- Annotations
-
- @Freezed(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)
Constructors
- MenuButton.new({@JsonKey(name: 'type') @Default(MenuButtonType.defaultButton) MenuButtonType type})
-
Describes that no specific value for the menu button was set.
constfactory
- MenuButton.commands({@JsonKey(name: 'type') @Default(MenuButtonType.commands) MenuButtonType type})
-
Represents a menu button, which opens the bot's list of commands.
constfactory
-
MenuButton.fromJson(Map<
String, dynamic> json) -
Creates a new MenuButton object. This method decides which MenuButton
subclass to use based on the
type
field.factory - MenuButton.webApp({@JsonKey(name: 'type') @Default(MenuButtonType.webApp) MenuButtonType type, @JsonKey(name: 'text') required String text, @JsonKey(name: 'web_app') required WebAppInfo webApp})
-
Represents a menu button, which launches a Web App.
constfactory
Properties
-
copyWith
→ $MenuButtonCopyWith<
MenuButton> -
Create a copy of MenuButton
with the given fields replaced by the non-null parameter values.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → MenuButtonType
-
Type of the menu button
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this MenuButton to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited