ReplyMarkup class sealed

Represents a ReplyMarkup that can be used to send a message with custom keyboard, instructions to hide keyboard or to force a reply from the user.

Implementers
Available extensions
Annotations
  • @Freezed.new(fromJson: true, toJson: true, copyWith: false)

Constructors

ReplyMarkup.forceReply({@JsonKey.new(name: 'force_reply') @Default.new(true) bool forceReply, @JsonKey.new(name: 'input_field_placeholder') String? inputFieldPlaceholder, @JsonKey.new(name: 'selective') bool? selective})
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
const
factory
ReplyMarkup.fromJson(Map<String, dynamic> json)
Create the Reply Markup from JSON
factory
ReplyMarkup.inlineKeyboard({@JsonKey.new(name: 'inline_keyboard') @Default.new([<InlineKeyboardButton>[]]) List<List<InlineKeyboardButton>> inlineKeyboard})
This object represents an inline keyboard that appears right next to the message it belongs to.
const
factory
ReplyMarkup.keyboard({@JsonKey.new(name: 'keyboard') required List<List<KeyboardButton>> keyboard, @JsonKey.new(name: 'resize_keyboard') bool? resizeKeyboard, @JsonKey.new(name: 'one_time_keyboard') bool? oneTimeKeyboard, @JsonKey.new(name: 'input_field_placeholder') String? inputFieldPlaceholder, @JsonKey.new(name: 'selective') bool? selective, @JsonKey.new(name: 'is_persistent') bool? isPersistent})
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
const
factory
ReplyMarkup.keyboardRemove({@JsonKey.new(name: 'remove_keyboard') @Default.new(true) bool removeKeyboard, @JsonKey.new(name: 'selective') bool? selective})
Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult forceReply(ForceReply value), required TResult inlineKeyboard(InlineKeyboardMarkup value), required TResult keyboard(ReplyKeyboardMarkup value), required TResult keyboardRemove(ReplyKeyboardRemove value)}) → TResult

Available on ReplyMarkup, provided by the ReplyMarkupPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? forceReply(ForceReply value)?, TResult? inlineKeyboard(InlineKeyboardMarkup value)?, TResult? keyboard(ReplyKeyboardMarkup value)?, TResult? keyboardRemove(ReplyKeyboardRemove value)?}) → TResult?

Available on ReplyMarkup, provided by the ReplyMarkupPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult forceReply(ForceReply value)?, TResult inlineKeyboard(InlineKeyboardMarkup value)?, TResult keyboard(ReplyKeyboardMarkup value)?, TResult keyboardRemove(ReplyKeyboardRemove value)?, required TResult orElse()}) → TResult

Available on ReplyMarkup, provided by the ReplyMarkupPatterns 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 ReplyMarkup to a JSON map.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

inline() → InlineKeyboardMarkup
Easy way to create an inline keyboard with buttons that can be pressed inline. This is a shortcut for InlineKeyboardMarkup