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.

Available extensions
Annotations
  • @Freezed.new(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)

Constructors

Describes that no specific value for the menu button was set.
const
factory
Represents a menu button, which opens the bot's list of commands.
const
factory
Creates a new MenuButton object. This method decides which MenuButton subclass to use based on the type field.
factory
Represents a menu button, which launches a Web App.
const
factory

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

map<TResult extends Object?>(TResult $default(MenuButtonDefault value), {required TResult webApp(MenuButtonWebApp value), required TResult commands(MenuButtonCommands value)}) → TResult

Available on MenuButton, provided by the MenuButtonPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(MenuButtonDefault value)?, {TResult? webApp(MenuButtonWebApp value)?, TResult? commands(MenuButtonCommands value)?}) → TResult?

Available on MenuButton, provided by the MenuButtonPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(MenuButtonDefault value)?, {TResult webApp(MenuButtonWebApp value)?, TResult commands(MenuButtonCommands value)?, required TResult orElse()}) → TResult

Available on MenuButton, provided by the MenuButtonPatterns extension

A variant of map that fallback to returning orElse.
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