InputMessageContent.widget constructor

const InputMessageContent.widget({
  1. @JsonKey.new(name: 'html') required String html,
  2. @JsonKey.new(name: 'width') int? width,
  3. @JsonKey.new(name: 'height') int? height,
  4. @JsonKey.new(name: 'public_data') String? publicData,
  5. @JsonKey.new(name: 'chat_data') String? chatData,
  6. @JsonKey.new(name: 'caption') String? caption,
  7. @JsonKey.new(name: 'parse_mode') ParseMode? parseMode,
  8. @JsonKey.new(name: 'caption_entities') List<MessageEntity>? captionEntities,
  9. @JsonKey.new(name: 'show_caption_above_media') bool? showCaptionAboveMedia,
  10. @JsonKey.new(name: 'allow_queries') bool? allowQueries,
  11. @JsonKey.new(name: 'is_shared') bool? isShared,
})

An HTML widget to send as the result of an inline query.

Inline widget results are currently available only in the Telegram test environment.

Implementation

const factory InputMessageContent.widget({
  /// HTML source of the widget, 1-32768 bytes before compression and
  /// at most 4096 bytes compressed with zlib at maximum compression.
  @JsonKey(name: 'html') required final String html,

  /// Width of the widget in logical pixels. Omit to fill the message bubble.
  @JsonKey(name: 'width') final int? width,

  /// Height of the widget in logical pixels. Omit for a variable height.
  @JsonKey(name: 'height') final int? height,

  /// Data available wherever the widget is shown, up to 1024 bytes.
  @JsonKey(name: 'public_data') final String? publicData,

  /// Data specific to the message, up to 1024 bytes.
  @JsonKey(name: 'chat_data') final String? chatData,

  /// Widget caption, up to 1024 characters after parsing entities.
  @JsonKey(name: 'caption') final String? caption,

  /// Mode for parsing entities in the caption.
  @JsonKey(name: 'parse_mode') final ParseMode? parseMode,

  /// Caption entities to use instead of a parse mode.
  @JsonKey(name: 'caption_entities')
  final List<MessageEntity>? captionEntities,

  /// Whether to show the caption above the widget.
  @JsonKey(name: 'show_caption_above_media')
  final bool? showCaptionAboveMedia,

  /// Whether the widget can send queries to the bot.
  @JsonKey(name: 'allow_queries') final bool? allowQueries,

  /// Whether sending the result creates a separate shared widget each time.
  @JsonKey(name: 'is_shared') final bool? isShared,
}) = InputWidgetMessageContent;