Widget constructor

const Widget({
  1. @JsonKey.new(name: 'html') required String html,
  2. @JsonKey.new(name: 'id') String? id,
  3. @JsonKey.new(name: 'width') int? width,
  4. @JsonKey.new(name: 'height') int? height,
  5. @JsonKey.new(name: 'public_data') String? publicData,
  6. @JsonKey.new(name: 'chat_data') String? chatData,
})

Creates a Widget.

Implementation

const factory Widget({
  /// The HTML source of the widget.
  @JsonKey(name: 'html') required String html,

  /// Identifier of the widget, if it is shared.
  @JsonKey(name: 'id') String? id,

  /// Width in logical pixels, if fixed.
  @JsonKey(name: 'width') int? width,

  /// Height in logical pixels, if fixed.
  @JsonKey(name: 'height') int? height,

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

  /// Data specific to the message.
  @JsonKey(name: 'chat_data') String? chatData,
}) = _Widget;